help with Matlab 4

MatLab 4 Assignment

Part 1

%% Lab 4 - Your Name - MAT 275 Lab

% MATLAB solvers for First-Order IVP

%% EX1

%A 6 PTS

type LAB04ex1

LAB04ex1


%B 2PTS

%do not print the entire vectors t and Y, but include a few values which

%show where maxima occur


%C 2 PTS

%[ENTER COMMENTS. Each line must have % before it]


%D 2 PTS

%create a function file "LAB04ex1d" which is a duplicate of LAB04ex1 but with

%the initial conditions for y and v changed.

%figure(1) and figure(2) also need to be

%changed to figure(3) and figure(4) (in order to plot part a and part d on separate figures).

type LAB04ex1d

LAB04ex1d

%% EX2


%A 5 PTS

%create a new mfile with the differential equation changed

type LAB04ex2

%alternatively, you can paste in only the segment of the code that you modified


%B 1 PTS

%comments


%C 1 PTS

%comments


%D 3 PTS

%unfortunately, you may have to create yet another mfile, LAB04ex2d, in

%order for the publishing to work in this case.

%NOTE: there should only be ONE output plot for the code you write in

%LAB04ex2d. The plot should superimpose solutions for y(t) from euler.m and

%ode45. Include a legend to label each solution

type LAB04ex2d

LAB04ex2d

%% EX 3 6 PTS

%NOTE: the code for this part should be very similar to what you wrote for

%EX1-A. You just need to modify the system of differential equations.

% It's OK if you get the following error message:

%"Warning: Failure at t=5.840631e+000. Unable to meet integration tolerances without

%reducing the step size below the smallest value allowed (1.421085e-014) at time t

type LAB04ex3

LAB04ex3

%Its fine if there is only be one outputted plot here (showing y(t) and v(t))

%% EX4

%A 6 PTS

%NOTE: this code should also be very similar to what you wrote for

%EX1-A and EX3

%when defining the function f at the bottom of your LAB04ex5.m file, dYdt

%now needs to be a column with THREE elements.

%LAB04ex5 should include commands which reproduce the plots shown in the

%lab4 document

type LAB04ex5

LAB04ex5

%B 2 PTS

%short comment


%C 2 PTS

%differentiate each term of L4.7 with respect to time. You will need to use

%the chain rule and product rule


%D 2 PTS

%Substitute the initial conditions of L4.8 into equation L4.7 at t=0, and

%check that the equation is satisfied. You can write this as a comment.

Part 1

%% Lab 4 - Your Name - MAT 275 Lab

% MATLAB solvers for First-Order IVP

%% EX1

%A 6 PTS

type LAB04ex1

LAB04ex1


%B 2PTS

%do not print the entire vectors t and Y, but include a few values which

%show where maxima occur


%C 2 PTS

%[ENTER COMMENTS. Each line must have % before it]


%D 2 PTS

%create a function file "LAB04ex1d" which is a duplicate of LAB04ex1 but with

%the initial conditions for y and v changed.

%figure(1) and figure(2) also need to be

%changed to figure(3) and figure(4) (in order to plot part a and part d on separate figures).

type LAB04ex1d

LAB04ex1d

%% EX2


%A 5 PTS

%create a new mfile with the differential equation changed

type LAB04ex2

%alternatively, you can paste in only the segment of the code that you modified


%B 1 PTS

%comments


%C 1 PTS

%comments


%D 3 PTS

%unfortunately, you may have to create yet another mfile, LAB04ex2d, in

%order for the publishing to work in this case.

%NOTE: there should only be ONE output plot for the code you write in

%LAB04ex2d. The plot should superimpose solutions for y(t) from euler.m and

%ode45. Include a legend to label each solution

type LAB04ex2d

LAB04ex2d

%% EX 3 6 PTS

%NOTE: the code for this part should be very similar to what you wrote for

%EX1-A. You just need to modify the system of differential equations.

% It's OK if you get the following error message:

%"Warning: Failure at t=5.840631e+000. Unable to meet integration tolerances without

%reducing the step size below the smallest value allowed (1.421085e-014) at time t

type LAB04ex3

LAB04ex3

%Its fine if there is only be one outputted plot here (showing y(t) and v(t))

%% EX4

%A 6 PTS

%NOTE: this code should also be very similar to what you wrote for

%EX1-A and EX3

%when defining the function f at the bottom of your LAB04ex5.m file, dYdt

%now needs to be a column with THREE elements.

%LAB04ex5 should include commands which reproduce the plots shown in the

%lab4 document

type LAB04ex5

LAB04ex5

%B 2 PTS

%short comment


%C 2 PTS

%differentiate each term of L4.7 with respect to time. You will need to use

%the chain rule and product rule


%D 2 PTS

%Substitute the initial conditions of L4.8 into equation L4.7 at t=0, and

%check that the equation is satisfied. You can write this as a comment.