Hw4 Problem 1 Totalminutes1 151 Hours1 Minutes1 Message1 Mytimeconversion Total

hi, could you help with this programming assignment and it is due tonight 11:45. One of the tutor already worked on the code, but I could’t run it. could you please check it and help me changed the file name to “Project2.m”

Here’s the problem:

For Programming Assignment #2:

⢠Reformulate the system of second order ODEs into a system of first order ODEs, and solve 

the system with the matlab function ode45.

⢠Your program should take the same input arguments years and framerate. ⢠Your output should be

â a plot depicting the orbits of the Moon and the Earth.

â a plot depicting the orbits of the Earth, Mercury, and the Sun. 

CLARIFICATION:

  • Attachment 1
  • Attachment 2
  • Attachment 3

%% HW4 Problem 1TotalMinutes1 = 151;[Hours1,Minutes1,Message1] = myTimeConversion (TotalMinutes1)TotalMinutes2 = 84;[Hours2,Minutes2,Message2] = myTimeConversion (TotalMinutes2)TotalMinutes3 = 60;[Hours3,Minutes3,Message3] = myTimeConversion (TotalMinutes3)TotalMinutes4 = 181;[Hours4,Minutes4,Message4] = myTimeConversion (TotalMinutes4)TotalMinutes5 = 1;[Hours5,Minutes5,Message5] = myTimeConversion (TotalMinutes5)%% Problem 2message = ‘UC Berkeley is everything I hoped for.’;secretKey = ‘abc’;ctext = Convert(message,secretKey,’encrypt’)Convert(ctext,secretKey,’decrypt’)%% Problem 3temp1 = 50; unitsIn1 = ‘F’; unitsOut11 = ‘C’; unitsOut12 = ‘K’;[newTemp11,msg11] = myTempConversion(temp1, unitsIn1, unitsOut11)[newTemp12,msg12] = myTempConversion(temp1, unitsIn1, unitsOut12)temp2 = 10; unitsIn2 = ‘C’; unitsOut21 = ‘F’; unitsOut22 = ‘K’;[newTemp21,msg21] = myTempConversion(temp2, unitsIn2, unitsOut21)[newTemp22,msg22] = myTempConversion(temp2, unitsIn2, unitsOut22)temp3 = 30; unitsIn3 = ‘K’; unitsOut31 = ‘F’; unitsOut32 = ‘C’;[newTemp31,msg31] = myTempConversion(temp3, unitsIn3, unitsOut31)[newTemp32,msg32] = myTempConversion(temp3, unitsIn3, unitsOut32)temp4 = 30; unitsIn4 = ‘K’; unitsOut4 = ‘K’;[newTemp4,msg4] = myTempConversion(temp4,unitsIn4,unitsOut4)%% Problem 4 av = [1,0,3,4,5];vpad1 = padrv(v,2)vpad2 = padrv(v,9)vpad3 = padrv(v,4)%% Problem 4 bb1 = unpad(vpad1)b2 = unpad(vpad2)b3 = unpad(vpad3)%% Problem 4 cp1 = [1,0,3];p2 = [-1,2,1];result9c1 = polyadd(p1,p2)p3 = [1,1,0,3];p4 = [-1,2,1];result9c2 = polyadd(p3,p4)%% Problem 5f = @(x) cos(x.^2);df = @(x) -2*x.*sin(x.^2);h = 0.1;[df1est,df2est] = derivFCN(f,h);x = linspace(0,pi,100);plot(x,df(x),x,df1est(x),x,df2est(x))legend(‘Exact Derivative’,’d1 Estimate’,’d2 Estimate’);%% Problem 6f1h = @(z) cos(z)*sin(z);f2h = @(z) cos(z).*sin(z);L1 = 1; R1 = 2; N1 = 10;[sampleMean, sampleSdev, employV] = getStats(f1h,L1,R1,N1)[sampleMean, sampleSdev, employV] = getStats(f2h,L1,R1,N1)%% Problem 7 aA1 = [1.5,1.5,0]; A2 = [0,2.5,2.5]; A3 = [4,0,4];B1 = myDiagnoser1(A1)B2 = myDiagnoser1(A2)B3 = myDiagnoser1(A3)%% Problem 7 b C1D1D2D3 ==== [1425,1432,1426]; C2 = [1432,1433,1419]; C3 = [1431,1432,1435];myDiagnoser2(C1)myDiagnoser2(C2)myDiagnoser2(C3)