The Mathematica Journal
Departments
Download This Issue
Home
Feature Articles
Graphics Gallery
Tricks of the Trade
In and Out
Columns
The Mathematica Programmer
New Products
New Publications
Classifieds
Calendar
News Bulletins
Editor's Pick
Mailbox
Letters
Write Us
About the Journal
Staff and Contributors
Submissions
Subscriptions
Advertising
Back Issues

Tracing NDSolve

Q: Why does
[Graphics:../Images/index_gr_41.gif]
[Graphics:../Images/index_gr_42.gif]
not stop at [Graphics:../Images/index_gr_43.gif]?
A: David Withoff (withoff@wolfram.com) answers: This particular example is a degenerate case, because the first step at which the value of the StoppingTest option was True turned out to be the endpoint of the integration. Using smaller steps by reducing the MaxStepSize option of NDSolve makes this effect more conspicuous.
[Graphics:../Images/index_gr_44.gif]
[Graphics:../Images/index_gr_45.gif]
A useful trick for analyzing NDSolve is to make StoppingTest a delayed rule (:> not ->) which includes a Print statement. Here we print out the pairs of [Graphics:../Images/index_gr_46.gif] and [Graphics:../Images/index_gr_47.gif] values.
[Graphics:../Images/index_gr_48.gif]
[Graphics:../Images/index_gr_49.gif]
[Graphics:../Images/index_gr_50.gif]
[Graphics:../Images/index_gr_51.gif]
[Graphics:../Images/index_gr_52.gif]
[Graphics:../Images/index_gr_53.gif]
[Graphics:../Images/index_gr_54.gif]
You can see that t was incremented by MaxStepSize in the last two steps.


Converted by Mathematica      September 29, 1999

[Prev Page][Next Page]