Message Boards Message Boards

GROUPS:

NdSolve::ndnum error and Polar Coordinates plot

Posted 10 years ago
5003 Views
|
6 Replies
|
3 Total Likes
|
Hello,
I'm trying to solve the system of differential equations in polar coordinates and after that plot this solution.
The system is










Here is the code
 c = 100;
 b = 1;
 a = 0.99;
 w = NDSolve[{r'[t] ==
     r[t]*(Cos[tet[t]]^2 + a*Sin[tet[t]]^2) -
      c*r[t]^2*Sin[tet[t]]*Cos[tet[t]]*(Cos[tet[t]] - a*Sin[tet[t]]) -
      r[t]^2*(Cos[tet[t]]^3 + a*b*Sin[tet[t]]^3),
      tet'[t] == (a - 1)*Sin[tet[t]]*Cos[tet[t]] -
      c*r[t]*Sin[tet[t]]*Cos[tet[t]]*(a*Cos[tet[t]] - Sin[tet[t]]) -
     r[t]*Sin[tet[t]]*Cos[tet[t]]*(a*b*Sin[tet[t]] - Cos[tet[t]]),
     r[0] == 0, tet[0] == 0}, {r[t], tet[t]}, {t, 0, 1000}]


How to plot this solution on polar plot?
I tried use ParametricPlot, PolarPlot and ListPolarPlot - no results

Thanks for help.

Best regards, 
Danila
POSTED BY: Danila Zharenkov
6 Replies
Thank  you, yes, I found some  mistakes in math model.
POSTED BY: Danila Zharenkov
With the given parameters and initial conditions, r and tet are always zero.
 In[1]:= c = 100;
 b = 1;
 a = 0.99;
 w = NDSolve[{r'[t] ==
     r[t]*(Cos[tet[t]]^2 + a*Sin[tet[t]]^2) -
      c*r[t]^2*Sin[tet[t]]*Cos[tet[t]]*(Cos[tet[t]] - a*Sin[tet[t]]) -
      r[t]^2*(Cos[tet[t]]^3 + a*b*Sin[tet[t]]^3),
    tet'[t] == (a - 1)*Sin[tet[t]]*Cos[tet[t]] -
      c*r[t]*Sin[tet[t]]*Cos[tet[t]]*(a*Cos[tet[t]] - Sin[tet[t]]) -
     r[t]*Sin[tet[t]]*Cos[tet[t]]*(a*b*Sin[tet[t]] - Cos[tet[t]]), r[0] == 0,
   tet[0] == 0}, {r[t], tet[t]}, {t, 0, 1000}]

Out[4]= {{r[t] -> InterpolatingFunction[][t], tet[t] -> InterpolatingFunction[][t]}}

        (* This samples only every 100th point.  All 1001 were zero.  *)
In[5]:= Table[ Evaluate[{r[t], tet[t]} /. w[[1]]], {t, 0, 1000, 100}]

Out[5]= {{0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.},
   {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}}

     (*  r' and  tet'  are zero at the beginning, and it looks like they
          never get the chance to grow.  *)
In[6]:= Eliminate[{r'[t] ==
    r[t]*(Cos[tet[t]]^2 + a*Sin[tet[t]]^2) -
     c*r[t]^2*Sin[tet[t]]*Cos[tet[t]]*(Cos[tet[t]] - a*Sin[tet[t]]) -
     r[t]^2*(Cos[tet[t]]^3 + a*b*Sin[tet[t]]^3),
   tet'[t] == (a - 1)*Sin[tet[t]]*Cos[tet[t]] -
     c*r[t]*Sin[tet[t]]*Cos[tet[t]]*(a*Cos[tet[t]] - Sin[tet[t]]) -
     r[t]*Sin[tet[t]]*Cos[tet[t]]*(a*b*Sin[tet[t]] - Cos[tet[t]]), r[0] == 0,
   tet[0] == 0} /. t -> 0, {r, tet}]

Out[6]= r[0] == 0. && tet[0] == 0. && r'[0] == 0. &&
  100. tet'[0] == -1. Cos[tet[0]] Sin[tet[0]]

In[7]:= FullSimplify[%]
Out[7]= r[0] == 0 && tet[0] == 0 && r'[0] == 0 && tet'[0] == 0
POSTED BY: Bruce Miller
Could you please first edit your post and correct syntax of your code?
POSTED BY: Vitaliy Kaurov
Of course, sorry.
Post was edited.
POSTED BY: Danila Zharenkov
Ohh, thanks. My fault.

I tried to use PolarPlot as I wrote above, but no results.
Can you give some advice how to plot this solution?
POSTED BY: Danila Zharenkov
Built-in functions in Mathematica start with capital letters.   Sin and Cos.
POSTED BY: Bruce Miller
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract