{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chapter5.page11

# chapter5.page11 - h = 1 Solution Set x t = • x(t y t ‚...

This preview shows page 1. Sign up to view the full content.

4. NUMERICAL METHOD FOR SYSTEM OF EQUATIONS 11 4. Numerical Method for System of Equations Both Euler’s method and Runge-Kutta method can be used to find the approximate solution to the system of first order differential equa- tions. In fact, the Mathcad codes for system of first differential equa- tions are exactly the same as Mathcad does not differentiate scalar and vectors when performs most computations. The only thing needs to be taken care is that at each step the result is vector instead of a scalar. Suppose x ( t ) is a vector-valued function that satisfies x 0 ( t ) = F ( t, x ( t )) , where F ( t, x ) is also vector-valued function, t i = a + ih then the Euler’s method compute the ith approximate, x i = x i - 1 + F ( t i - 1 , x i - 1 ) . (2) Example 4.1 . Let x 0 ( t ) = t 2 sin( x ( t )) + e t cos( y ( t )) y 0 ( t ) = 2 tx ( t ) + e y ( t ) x (0) = 1 , y (0) = - 1 Find approximate solution for x ( t ) , y ( t ) over interval [0, 1] with
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: h = . 1 Solution Set x ( t ) = • x(t) y ( t ) ‚ and F ( t, x ) = • t 2 sin(x) + e t cos(y) 2 tx + e y ‚ The equation can then be written, in vector form, x ( t ) = F ( t, x ( t )) , x (0) = • 1-1 ‚ From (2) we can ﬁnd, with t = 0, x 1 = x + h * F ( t , x ) = • 1-1 ‚ + • t 2 sin(x ) + e t cos(y ) 2 t x + e y ‚ = • cos(-1) e-1 ‚ The following screen shot shows the results obtain by calling our Mathcad implementation of Euler’s method. Notice that in deﬁning the vector-valued function F ( t, X ) , for Mathcad to know that X is an vector, in the deﬁnition, we use subscript to access the component of X , as shown in the screen shot....
View Full Document

{[ snackBarMessage ]}