Code - time2(i) = time2(i-1)+step2; end; step3 = 0.15;...

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

View Full Document Right Arrow Icon
tinitial = 0; tfnal = 3; step1 = .03; interval1 = tfnal/step1; time1 = zeros(1,interval1+1); approx1 = zeros(1,interval1+1); time1(1) = tinitial; approx1(1) = .9; For i = 2:interval1+1 approx1(i) = approx1(i-1) - approx1(i-1)*(1-approx1(i-1))*step1; time1(i) = time1(i-1)+step1; end; step2 = 0.15; interval2 = tfnal/step2; time2 = zeros(1,interval2+1); approx2 = zeros(1,interval2+1); time2(1) = tinitial; approx2(1) = 0.9; For i = 2:interval2+1 approx2(i) = approx2(i-1) - approx2(i-1)*(1-approx2(i-1))*step2;
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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: time2(i) = time2(i-1)+step2; end; step3 = 0.15; interval3 = tfnal/step3; time3 = zeros(1,interval3+1); approx3 = zeros(1,interval3+1); time3(1) = tinitial; approx3(1) = 0.9; For i = 2:interval3+1 approx3(i) = approx3(i-1) - approx3(i-1)*(1-approx3(i-1))*step3; time3(i) = time3(i-1)+step3; end; fgure(1); A=plot(time3,approx3,' . ', time2,approx2, '-.',time1,approx1, '--');...
View Full Document

Page1 / 2

Code - time2(i) = time2(i-1)+step2; end; step3 = 0.15;...

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

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