NDSolve`StateData MethodsAn NDSolve`StateData object contains a lot of information, but it is arranged in a manner which makes it easy to iterate solutions, and not in a manner which makes it easy to understand where the information is kept. However, sometimes you will want to get information from the state data object: for this reason several method functions have been defined to make accessing the information easy. General method functions for an NDSolve`StateData object state.Much of the available information depends on the current solution values. Each NDSolve`StateData object keeps solution information for solutions in both the forward and backward direction. At the initial condition these are the same, but once the problem has been iterated in either direction, these will be different. Directional method functions for an NDSolve`StateData object state.If the direction argument is omitted, the functions will return a list with the data for both directions (a list with a single element at the initial condition). Otherwise, the direction can be Forward, Backward, or Active as specified in the previous section. Here is an NDSolve`StateData object for a solution of the nonlinear Schrodinger equation that has been computed up to t = 1. In[21]:=  |
Out[23]=
|
"Current" refers to the most recent point reached in the integration. This gives the current time in both the forward and backward directions. In[24]:=  |
Out[24]=
|
This gives the size of the system of ordinary differential equations being solved. In[25]:=  |
Out[25]=
|
The method functions are relatively low-level hooks into the data structure, they do little processing on the data returned to you. Thus, unlike NDSolve`ProcessSolutions, the solutions given are simply vectors of data points relating to the system of ordinary differential equations NDSolve is solving. This makes a plot of the modulus of current solution in the forward direction. In[26]:=  |
This plot does not show the correspondence with the x-grid values correctly. To get the correspondence with the spatial grid correctly, you must use NDSolve`ProcessSolutions. There is a tremendous amount of control provided by these methods, but an exhaustive set of examples is beyond the scope of this documentation. One of the most important uses of the information from an NDSolve`StateData object is to initialize integration methods. Examples are shown in the section describing The Method Plug-in Framework.
|