0

I am currently trying to numerically solve a first order system of ODES, of the form:

$$\frac{d\rho}{ds}(s)=f_1(\rho,\theta,k_1,k_2)$$ $$\frac{d\theta}{ds}(s)=f_2(\rho,\theta,k_1,k_2)$$ $$\frac{dk_1}{ds}(s)=f_3(\rho,\theta,k_1,k_2)$$ $$\frac{dk_2}{ds}(s)=f_4(\rho,\theta,k_1,k_2)$$

Where $f_i$ can be found here http://pastebin.com/yMnDq60C

I have inital conditions, $$(k_1,k_2)=(\frac{1}{\sqrt2},\frac{1}{\sqrt2})$$ and $k_3=0$ ($k_3$ is a constant). I have been solving for multiple $(x,y)$ conditions, namely, $$(x,y)=(-1,y),\quad \text{for}\quad y=-2,-1.9,...,1.9,2$$

However my problem is I have been getting extremely strange solutions, upon plotting the solutions for $(x,y)$ in the $(x,y)$ plane, I find only straight lines. I have thoroughly checked through all my code, however I cannot find any mistake that could be causing this.

If someone might be able to check the numerical solutions, say using a standard solver such as ode15s, to see if they also get straight line solutions I would be incredibly grateful! I am new to trying to numerically solve equations, so any help or advice here would be much appreciated.

Below you can see a comparison between the solutions I am getting and the sort of thing I am expecting.

enter image description here

Amzoti
  • 56,093
Freeman
  • 5,399
  • Can you please simplify those variable names to single variables? Regards – Amzoti Oct 27 '13 at 23:55
  • @Kyle: Sorry about the delay, I realised after posting this that I had omitted details on constants. eps_para=0.2, eps_perp=0.1, k3=0.

    Ah, so for the initial positions, effectively anywhere near the line stated should be fine. So $\theta$ ranging between $3\pi/4$ to $5\pi/4$ and $\rho=1$ should work.

    So $\rho$ and $\theta$ are polar coordinates and $k_1$ and $k_2$ represent effectively 'velocity'.

    There may be some imaginary results, but these don't seem to be causing any problems so far.

    – Freeman Oct 28 '13 at 17:15
  • You have four unknowns... but the initial conditions are for only two of them, and your output is in the plane? Perhaps what you did (or did not do) with $\rho$ and $\theta$ is the source of confusion. – Post No Bulls Dec 15 '13 at 03:36

0 Answers0