Question: Consider the following differential equation: dy/dx = y-sin(x) for -3 lessthanorequalto x lessthanorequalto 3. During our lab period, we observed that the small difference in

 Consider the following differential equation: dy/dx = y-sin(x) for -3 lessthanorequalto

Consider the following differential equation: dy/dx = y-sin(x) for -3 lessthanorequalto x lessthanorequalto 3. During our lab period, we observed that the small difference in the initial condition would result in a large difference in the final condition. For instance, with y(-3)= -0.5 the function would curve up to make y(3) positive, but with y(-3)= -0.6 the function would curve down to make y(3) negative. By a method of an informal "try and error, " find y (-3) such that y(3) would be between -1.0 and -0.5 (rather than between 0 and 1 we did during the lab period). Create two function files called f .m (to define the differential equation above) and Euler .m (which serves as a differential equation solver based on the Euler's method). Then run a third m-file with the following information. xo=-3; yo=?; xf=3; h=0.01; [X, Y]= Euler(xo, yo, xf, h); plot (X, Y), axis ([-3 3 -3 3]) xlabel('x'), ylabel('y'), title('Your Name')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!