Question: Need help solving this differential equation in MATLAB using the shooting method. I have included the RK4 code that the problem is asking for. Just

Need help solving this differential equation in MATLAB using the shooting method. I have included the RK4 code that the problem is asking for. Just need to be able to manipualte it to solve this differential equation.

Need help solving this differential equation in MATLAB using the shooting method.

RK4 code:

 function [ t,y ] = RK4(t0, y0, f,dt,tsteps) t = t0 : dt : t0+tsteps*dt; % put y's into a vector y(1,:) = y0; % to get to new y, must calculate the k's for i = 1:tsteps h2 = dt/2; ttemp = t(i) + h2; yy = y(i,:); k1 = f(t(i),yy); k2 = f(ttemp, yy + h2*k1); k3 = f(ttemp, yy + h2*k2); k4 = f(t(i+1), yy + dt*k3); y(i+1,:) = yy + dt/6 * (k1 + k4 + 2*(k2+k3)); end end 

Write Matlab code to implement the shooting method for the boundary value problem d2 dz2 dy y(a) a Recall that use of the shooting method in this context requires us to solve four very silar initial value problems. Therefore, your code should include a Matlab function that your main program calls four times, once for each IVP. For this function, use the RK4 function you produced on Homework 9. Younr output should be a plot of your data points. Write Matlab code to implement the shooting method for the boundary value problem d2 dz2 dy y(a) a Recall that use of the shooting method in this context requires us to solve four very silar initial value problems. Therefore, your code should include a Matlab function that your main program calls four times, once for each IVP. For this function, use the RK4 function you produced on Homework 9. Younr output should be a plot of your data points

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!