MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of MATLAB Mathematics - SERC - Index of

serc.iisc.ernet.in
from serc.iisc.ernet.in More from this publisher
15.11.2014 Views

5 Differential Equations solution y 200 180 160 140 120 100 80 60 40 20 y 1 y 2 y 3 An example of Wille’ and Baker 0 0 1 2 3 4 5 time t Evaluating the Solution at Specific Points The method implemented in dde23 produces a continuous solution over the whole interval of integration [ t 0 , t f ]. You can evaluate the approximate solution, St (), at any point in [ t 0 , t f ] using the helper function deval and the structure sol returned by dde23. Sint = deval(sol,tint) The deval function is vectorized. For a vector tint, the ith column of Sint approximates the solution y( tint(i) ) . Using the output sol from the previous example, this code evaluates the numerical solution at 100 equally spaced points in the interval [0,5] and plots the result. tint = linspace(0,5); Sint = deval(sol,tint); plot(tint,Sint); 5-56

Initial Value Problems for DDEs Discontinuities dde23 can solve problems with discontinuities in the history or discontinuities in coefficients of the equations. It provides properties that enable you to supply locations of known discontinuities and a different initial value. Discontinuity Property Comments At the initial value InitialY Generally the initial value yt ( 0 ) is the t = t 0 value St ( 0 ) returned by the history function, which is to say that the solution is continuous at the initial point. However, if this is not the case, supply a different initial value using the InitialY property. In the history, i.e., the solution at t < t 0 , or in the equation coefficients for t > t 0 Jumps Provide the known locations t of the discontinuities in a vector as the value of the Jumps property. State-dependent Events dde23 uses the events function you supply to locate these discontinuities. When dde23 finds such a discontinuity, restart the integration to continue. Specify the solution structure for the current integration as the history for the new integration. dde23 extends each element of the solution structure after each restart so that the final structure provides the solution for the whole interval of integration. If the new problem involves a change in the solution, use the InitialY property to specify the initial value for the new integration. 5-57

5 Differential Equations<br />

solution y<br />

200<br />

180<br />

160<br />

140<br />

120<br />

100<br />

80<br />

60<br />

40<br />

20<br />

y 1<br />

y 2<br />

y 3<br />

An example <strong>of</strong> Wille’ and Baker<br />

0<br />

0 1 2 3 4 5<br />

time t<br />

Evaluating the Solution at Specific Points<br />

The method implemented in dde23 produces a continuous solution over the<br />

whole interval <strong>of</strong> integration [ t 0 , t f ]. You can evaluate the approximate<br />

solution, St (), at any point in [ t 0 , t f ] using the helper function deval and the<br />

structure sol returned by dde23.<br />

Sint = deval(sol,tint)<br />

The deval function is vectorized. For a vector tint, the ith column <strong>of</strong> Sint<br />

approximates the solution y( tint(i) ) .<br />

Using the output sol from the previous example, this code evaluates the<br />

numerical solution at 100 equally spaced points in the interval [0,5] and plots<br />

the result.<br />

tint = linspace(0,5);<br />

Sint = deval(sol,tint);<br />

plot(tint,Sint);<br />

5-56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!