I have a MATLAB assignment. (Diiferential equations)

%% EX1 %A 6 PTS type LAB04ex1 LAB04ex1 %B 2PTS %do not print the entire v ect ors t a nd Y, b ut in cl ude a fe w va lu es which %show where maxima oc cur %C 2 PTS %[ENTER COMMENTS. Ea ch lin e mu st h ave % b efo re it ] %D 2 PTS %create a function file "L AB04ex1 d" w hich is a d uplica te o f L AB0 4ex1 b ut w it h th e in it ia l conditions for y and v chan ged.

%figure(1) and figure(2) al so n eed to b e %changed to figure(3) and fig ure (4) (in o rd er to p lo t p art a a nd p art d o n se para te fig ure s) .

type LAB04ex1d LAB04ex1d %% EX2 %A 5 PTS %create a new mfile with th e d if fe re ntia l e quatio n ch anged type LAB04ex2 %alternatively, you can pa ste in o nly th e se gme nt o f th e co de th at yo u m odif ie d %B 1 PTS %comments %C 1 PTS %comments %D 3 PTS %unfortunately, you may have to cre ate ye t a noth er mf ile , L AB0 4ex2 d, in %order for the publishing to w ork in th is ca se.

%NOTE: there should on ly be O NE outp ut p lo t fo r th e co de yo u w rit e in %LAB04ex2d. The plot sh ould su perimp ose so lu tio ns fo r y(t ) fro m e ule r.m a nd %ode45. Include a legend to la bel e ach so lu tio n type LAB04ex2d LAB04ex2d %% EX 3 6 PTS %NOTE: the code for this part sh ould b e ve ry simi la r to w hat yo u w ro te fo r %EX1-A. You just need t o mo dif y th e syst em of d if fe re ntia l e quatio ns.

% It's OK if you get the fol lo w in g e rro r me ssa ge:

%"Warning: Failure at t=3. 774765e+0 00. U nable to me et in te gra tio n to le ra nce s wit h out reducing the step size bel ow th e sma lle st va lu e a llo w ed (7 .1 05427e-0 15) a t tim e t type LAB04ex3 LAB04ex3 %Its fine if there is only be o ne o utp utte d p lo t h ere (sh ow in g y(t ) and v( t) ) %% EX4 %A 6 PTS %NOTE: this code should a lso b e ve ry simi la r to w hat yo u w ro te fo r %EX1-A and EX3 %when defining the funct io n f a t th e b otto m of yo ur LAB0 4ex5 .m file , d Y dt %now needs to be a colu mn w it h T H REE ele me nts.

%LAB04ex5 should inclu de co mma nds which re pro duce th e p lo ts sh ow n in th e %lab4 document type LAB04ex5 LAB04ex5 %B 2 PTS %short comment %C 2 PTS %differentiate each term of L 4.7 w it h re sp ect to time . Yo u w ill n eed to u se %the chain rule and prod uct ru le %D 2 PTS %Substitute the initial cond it io ns of L 4.8 in to e quatio n L 4.7 a t t=0 , a nd %check that the equation is sa tisf ie d. Yo u ca n w rite th is as a co mment.