Message Boards Message Boards

2 Replies
0 Total Likes
View groups...
Share this post:

Coupled ODE equation solving

Posted 11 years ago
I have two differential equations,
?'[t] = l/(m r[t]^(2))
m r''[t]^(2) - l^(2)/(m r[t]^(3)) + k/(r[t]^(2))=0
that I want to solve and plot for r and ?. I want to let ?'[0]=1, ?[0] =0, r'[0]=0, r[0]=1, m=1, k=1, and l=1 that when plotted is a circle. How can I do that?
Thanks in advance.
POSTED BY: sean roubion
2 Replies
You have an equation for theta, which is first order, but you are giving 2 initial conditions for it. This is wrong. In addition, the equation for r(t) does not depend on theta(t). So all what you have to do is solve first for r(t), then simply use the solution obtained, and plug that in the ODE for theta(t), and solve for theta(t).

There is no reason to solve them both at the same time. There is no coupling here.

Just to make I am reading what you actually wrote (since this editorĀ  sometimes acts strange), here is a screen shot of what I am seeing now

POSTED BY: Nasser M. Abbasi
Posted 11 years ago
DSolve doesn't seem to want to do this, but NDSolve can do this.
 In[1]:= m = 1; k = 1; l = 1;
 sol = NDSolve[{\[CapitalTheta]'[t] == l/(m r[t]^2),
  m r''[t]^2 - l^2/(m r[t]^3) + k/(r[t]^2) == 0,
  \[CapitalTheta][0] == 0, r[0] == 1, r'[0] == 0},
  {\[CapitalTheta][t], r[t]}, {t, 0, 10}]
 {\[CapitalTheta][t] -> InterpolatingFunction[{{0.,10.}},<>][t],r[t] -> InterpolatingFunction[{{0.,10.}},<>][t]}}
In[3]:= Plot[{\[CapitalTheta][t], r[t]} /. sol[[1]], {t, 0, 10}]

<<<plot snipped>>>

In[4]:= ParametricPlot[{\[CapitalTheta][t], r[t]} /. sol[[1]], {t, 0, 10}]

<<<plot snipped>>>

But neither sol[[1]] nor sol[[2]] seem to show the circle that you describe. Is there perhaps some error in this?

Edit: I think this is what I should have understood to write.

In[5]:= ParametricPlot[{r[t]Sin[\[CapitalTheta][t]],r[t]Cos[\[CapitalTheta][t]]}/.sol[[1]],{t,0,10}]

Note: Hopefully I haven't introduced any errors by having to manually type in the contents of that second code box, because apparently the forum software makes it impossible to paste into a second code box. Or at least that is what appeared to have happened repeatedly for me.

It also seems surprising that DSolve cannot find a solution r=1, theta=t to the system of equations, with or without taking the liberty of multiplying both sides of both equations by an appropriate power of r to clear the denominators.
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract