Question: I need help with this matlab problem. Thank you in advance. Consider the following ODE: d 2 y d x 2 + x 2 d

I need help with this matlab problem. Thank you in advance.
Consider the following ODE:
d2ydx2+x2dydx+y=4cos(x), for ,0x10, with ,y(0)=3, and ,y(10)=2
Write a script that:
named ys.
finite difference approximations in your formulation.
b) Solve for y(x) using the finite difference method with x=0.5. Save result as a column vector named ydx.
c) Solve for y(x) using the finite difference method with x=0.25. Save result as a column vector named ydx2.
d) Solve for y(x) using the finite difference method with x=0.05. Save result as a column vector named ydx3.
e) Compare the accuracy of your results for (b),(c), and (d) by doing the following:
vectors of lona values. Note this means you will need to extract only the relevant y values (corresponding to the specified nodes) from your solutions for (b),(c) and (d) to use in this calculation.
 I need help with this matlab problem. Thank you in advance.

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!