HW1_3b - Problem 3 Part(b) Table of Contents (1)Exact...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem 3 Part(b) Table of Contents (1)Exact solution . ........................................................................................................ 1 (2)EE . ....................................................................................................................... 1 (3)RK2 . .................................................................................................................... 2 (1)Exact solution S=subs(solve( 'x^2+c*x+g/l' )); sr=real(S(1));si=abs(imag(S(1))); t=a:0.01:b; theta=theta0.*exp(sr*t).*cos(si*t)+0.099327.*exp(sr*t).*sin(si*t); h1=0.15;h2=0.5;h3=1; (2)EE E1b=euler2b(h1,a,b,theta0); E2b=euler2b(h2,a,b,theta0); E3b=euler2b(h3,a,b,theta0); figure plot(E1b(:,1),E1b(:,2), '-' ) hold on li=plot(t,theta, 'k' ); set(li, 'linewidth' ,1.5); hold off legend( 'h=0.15' , 'exact' ) title( 'solution of EE when time step is small' ) figure plot(E2b(:,1),E2b(:,2),
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

HW1_3b - Problem 3 Part(b) Table of Contents (1)Exact...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online