Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Concepts and Questions for MATLAB Solving Ordinary Differential Equations What a

ID: 1981914 • Letter: C

Question

Concepts and Questions for MATLAB Solving Ordinary Differential Equations

What are the independent and dependent variables in an ordinary differential equation (ODE)?

What method did we learn to perform numerical integration of ODEs?

How do you apply Euler’s method to perform numerical integration (i.e., what is the formula)? Make sure you understand the variables that are used in the formula.

What is the result of applying Euler’s method to an ODE?

Can Euler’s method be applied to 2nd order (or higher order) ODEs?

How can we transform a 2nd order (or higher order) ODE into a form that can be solved by Euler’s method?

How do we write MATLAB code to apply Euler’s method? Make sure you understand what variables and equations need to be defined before, inside, and/or after the for loop.

Explanation / Answer

1) What are the independent and dependent variables in an ordinary differential equation (ODE) ?

let second order differential equation be : x^2y+xy'+(x^2z^2)z=0

in this y is a dependent variable of the independent variable x.The equation for y as a function of x and z does not mean that y is a function of z, but given z,y(x) solve the differential equation with z fixed.

dydx=x,

where is a parameter, has the solution y(x)=Ce^x with C a real constant.

The expression y does not mean that y is a function of in differential equation.

2)What method did we learn to perform numerical integration of ODEs ?

Numerical methods are used to find numerical approximations of ordinary differential equations (ODEs).

they are several methods to perform numerical integration of ODE are:

Generalizations,

Euler method,

Backward Euler method,

First-order exponential integrator method.

3)How do you apply Euler’s method to perform numerical integration ?

A first-order differential equation is an Initial value problem is of :

y'(t)=f(t,y(t)), y(t0)=y0

in place of differential equation, we replace the derivative y' by the finite difference approximation.

y'(t)= [y(t+h)-y(t)]/h.

and y(t+h)=y(t)+hy'(t)

by using ODE we heve y(t+h)=y(t)+hf(t,y(t)).

take step size h, construct the sequence t0, t1 = t0 + h, t2 = t0 + 2h...................................................................

yn+1=yn+hf(tn,yn).This is the Euler method to perform numerical integration.

4)Can Euler’s method be applied to 2nd order (or higher order) ODEs ?

NO, eulers method is applicable to first order differential equations only.

5)How can we transform a 2nd order (or higher order) ODE into a form that can be solved by Euler’s method ?

in order to transform a 2nd order (or higher order) ODE into a form that can be solved by Euler’s method, we need to convert 2nd order into 2 first order ODEs.

Consider the differential equation:

y''=-y'+sin(ty) and initial conditions would be y(0)=1,y'(0)=3 then

STEP1: The first step is to convert the above second-order ODE into two first-order ODE. This is a standard operation. Let v(t)=y'(t). Then v'(t)=y''(t). We then get two differential equations.

V=Y'

STEP2: The second is obtained by rewriting the original ode.that y''=v' and y'=v,

V'=-V+SIN(TY),

NOW  approximate the two first-order ODE by Euler's method.

6)How do we write MATLAB code to apply Euler’s method ?

STEP1: WRITE program AS a filename.m-file,and call it euler.m

   STEP2: you type in your equation in the file ex.m and, where n is the number of t-values, t0 and t1 are the left and right end points and y(t0)=y0 is the initial condition.

   STEP3: Now, on matlab, you write euler(n,t0,t1,y0) and return

%function t=t(n,t0,t1,y0) function y=y(n,t0,t1,y0) h=(t1-t0)/n; t(1)=t0; y(1)=y0; for i=1:n t(i+1)=t(i)+h; y(i+1)=y(i)+h*ex(t(i),y(i)); end; V=[t',y'] plot(t,y) title('CHEGG')
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote