The Computable Differential Equation Lecture ... - Bruce E. Shapiro
The Computable Differential Equation Lecture ... - Bruce E. Shapiro
The Computable Differential Equation Lecture ... - Bruce E. Shapiro
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CHAPTER 5. RUNGE-KUTTA METHODS 91<br />
which returns a list of rules for r ,<br />
{{r->0.},{r->1.-1.73205i}, {r->1.+1.73205i}, {r->2.}}<br />
To convert this to a list of numbers, replace the Solve with<br />
r/.Solve[f[r,Pi]==0]<br />
This returns<br />
{0.,1.-1.73205i, 1.+1.73205i, 2.}<br />
To get only the real roots,<br />
Select[r/.Solve[f[r,Pi]==0], And[Im[#] == 0, Re[#] >= 0]&]<br />
which now returns the list<br />
{0., 2.}<br />
Figure 5.1: Region of absolute stability for second-order Taylor series methods.<br />
Numerical solutions with hλ that fall inside this region are absolutely stable<br />
Putting the whole plotting algorithm together, the following will plot 100 points<br />
on the solution.<br />
points = {};<br />
Cartesian[{r , theta }] := {r*Cos[theta], r*Sin[theta]};<br />
For[theta = 0, theta = 0]&];<br />
c○2007, B.E.<strong>Shapiro</strong><br />
Last revised: May 23, 2007<br />
Math 582B, Spring 2007<br />
California State University Northridge