Group Abstract Group Abstract

Message Boards Message Boards

1
|
11.4K Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How to plot a phase portrait in a circle for a nonlinear DE?

Posted 10 years ago

Hi,

I want to plot

1) the phase portrait in a circle

and 2) thetadot versus theta for different values of mu.

for the differential equation \!(*OverscriptBox[([Theta]), (.)]) == [Mu]Sin[[Theta]] - Sin[2 [Theta]]

My code is not working as given below:

Clear [\[Theta]];
eqn=Overscript[\[Theta], .]==\[Mu]Sin[\[Theta]]-Sin[2\[Theta]]
sol=\[Theta]/.DSolve[{eqn,\[Theta][0]==0},\[Theta],t][[1,1]];
ParametricPlot[Evaluate[Table[Limit[{sol[t],D[sol[t],t]},\[Mu]->i],{i,{-3,-2,-1,0,1,2,3}}]],{t,0,100},AspectRatio->1,PlotRange->{{-5,5},{0,50}},PlotPoints->1000]
tTicks=Range[-24,24 30,24];
tGrid=Range[-60,24 30,6];
[Frame->True,FrameTicks->{tTicks,Automatic},FrameTicksStyle->Directive[Red,Thick],GridLines->{tGrid,Automatic},GridLinesStyle->LightGray,FrameLabel->(Style[#,14,Bold]&/@{\[Theta],Overscript[\[Theta],"."]}),AspectRatio->1]

Regards,

POSTED BY: Rahul Chakrabory
5 Replies
POSTED BY: Murray Eisenberg

If you have version 9 or later, you can use NDSolveValue, with an easier syntax. You get a less boring plot by plotting over larger values of t and by zooming in with PlotRange:

\[Mu] = -1;
eon = \[Theta]'[t] == \[Mu] Sin[\[Theta][t]] - Sin[2 \[Theta][t]];
sol = NDSolveValue[{eon, \[Theta][0] == 1/2}, \[Theta], {t, 0, 50}];
ParametricPlot[{sol[t], sol'[t]}, {t, 4, 50}, Frame -> True, 
 AxesLabel -> {"\[Theta]", Overscript[\[Theta], "."]}, 
 AspectRatio -> 1, PlotStyle -> Directive[Red, AbsoluteThickness[0]], 
 BaseStyle -> {FontFamily -> "Courier", FontWeight -> "Bold", 
   FontSize -> 16}, PlotRange -> 10^-9, ImageSize -> Large]
POSTED BY: Gianluca Gorni

You can avoid the use of Part by using the form NDSolve[{eqnAndICs}, dependentVar, {independenVar, start, end}].

Regarding the plot you're getting, does the following help explain anything?

 \[Mu] = -1;
 eon = \[Theta]'[t] == \[Mu] Sin[\[Theta][t]] - Sin[2 \[Theta][t]];
 sol = NDSolve[{eon, \[Theta][0] == 1/2}, \[Theta], {t, 0, 50}];

 Plot[Evaluate[{\[Theta][t] /. sol, D[\[Theta][t] /. sol, t]}], {t, 0, 10}, PlotRange -> 0.2]

enter image description here

POSTED BY: Murray Eisenberg

Have a look here for the usage of [[...]]: https://reference.wolfram.com/language/ref/Part.html

POSTED BY: Sander Huisman

Dear Sir,

I'm getting some plot as below:

Clear[\[Mu],x];
\[Mu]=-1;
eon=\[Theta]'[t]==\[Mu] Sin[\[Theta][t]]-Sin[2 \[Theta][t]];//Simplify;
sol=NDSolve[{eon,\[Theta][0]==1/2},\[Theta][t],{t,0,50}][[1]]
ParametricPlot[Evaluate[{\[Theta][t]/.sol,D[\[Theta][t]/.sol,t]}],{t,0,10},Frame->True,AxesLabel->{"\[Theta]",Overscript[\[Theta],"."]},AspectRatio->1,PlotStyle->{{Red,AbsoluteThickness[0]}},BaseStyle->{FontFamily->"Courier",FontWeight->"Bold",FontSize->16}]

But its a linear plot, there should have been some nonlinearity which doesn't seem to be available.

Sir, I'm not very clear regarding the use of [[1]] or [[1,1]]. If you kindly let me know , I would be grateful.

Sincerely, Rahul

POSTED BY: Rahul Chakrabory
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard