Hot answers tagged numerical-integration
7
I think your initial condition is singular. In order to solve the ODEs, consider $(x(t), y(t))$ as a planar curve, we may try changing the parameter $t$ to the arc length parameter $s$:
$$\left\{\begin{split}
\frac{\mathrm{d}x}{\mathrm{d}s}=\frac{x'(t)}{\sqrt{x'(t)^2+y'(t)^2}}\\
\frac{\mathrm{d}y}{\mathrm{d}s}=\frac{y'(t)}{\sqrt{x'(t)^2+y'(t)^2}}\\
...
5
The problem is that Mathematica prematurely threads r[t] - p not knowing r[t] is actually in $\mathbb{R}^2$
In[]:= r[t]-{0,0}
Out[]= {r[t],r[t]}
Which is not what you want. A quick fix for these types of issues is to create a function that only evaluates for numerical values (Changed to NDSolve since I only have v8):
dummy[r_?(VectorQ[#, NumericQ] ...
5
- update -
@whuber gives insightful comment and I agree I should mention here the following.
Below we consider a perturbed form (solvable exactly in Bessel functions) of original equation up to linear term. This allows us to understand behavior of the system around t ~ 0.
- original -
The following shows that under some general assumptions there is no ...
2
Your functions for y and x are single values and not lists, and thus doing a ParametricPlot for the sum of these is not going to work. However, to solve the equations and get a plot you can run the following:
alpha = 0.5
beta = 1
solf[b_, c_, tp_] := Module[{sol},
sol = NDSolve[{x'[t] == -x[t]*a[t] - 3*x[t] + alpha*y[t]^2 +
1/2*beta*(r1[t]^2 - ...
2
As an illustration of my initial comment, let's look at various starting points, following @Andrew's method:
sols = Table[
NDSolveValue[(2 + Sqrt[2] + s^2 - (-2 + Sqrt[2]) s^4 + s^6)/(1 + s^2)^2 yy[s] -
(1 - s^2)^2 yy''[s] == 0 && yy[start] == yy'[start] (start + 1) && yy'[start] == 1,
yy[s], {s, start, 1}], {start, -1 + ...
1
As a workaround it is possible to step up a bit from the left end:
leftend = -1 + 10^-8;
NDSolve[(2 + Sqrt[2] + s^2 - (-2 + Sqrt[2]) s^4 + s^6)/(1 + s^2)^2 yy[s]
- (1 - s^2)^2 yy''[s] == 0 && yy[leftend] == 0 && yy'[leftend] == 1, yy[s],
{s, leftend, 1}][[1]]
Only top voted, non community-wiki answers of a minimum length are eligible