Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please help Suppose you implement Euler\'s method using Matlab, using step size

ID: 2961334 • Letter: P

Question

please help

Suppose you implement Euler's method using Matlab, using step size h, and create a vector t of time steps from t = 0 to t = 1. Often we refer to the first entry as t0 = 0, the next as t1 and the final entry will be tN = 1 where Nh = 1. Matlab does not enumerate these entries in the same way. The first element of a vector in Matlab is always t(1). In this case, we will have t(1)=0, and t(N+1)=1. Find the Matlab indices n so that t(n)=0, t(n) = .5, t(n) = .86, and t(n)=1 if you used N = 12 (Note: you cannot get t(n) = .86 in this case.) N = 120 (Note: you cannot get t(n) = .86 in this case.) N = 1200 N = 2400 Record these values of n in Table 1 below.

Explanation / Answer

for n=12: h=1/12,t(n)=x,where x is between 0 and 1,n=x/h+1

t(n)=0 implies n=1

t(n)=0.5,n=7

t(n)=0.86,n=11

t(n)=1,n=13

for N=120 h=1/120,t(n)=x,where x is between 0 and 1,n=x/h+1

t(n)=0,n=1

t(n)=0.5,n=61

t(n)=0.86,n=104

t(n)=1,n=121

for N=1200 h=1/1200,t(n)=x,where x is between 0 and 1,n=x/h+1

t(n)=0,n=1

t(n)=0.5,n=601

t(n)=0.86,n=1033

t(n)=1,n=1201


for N=2400 h=1/2400,t(n)=x,where x is between 0 and 1,n=x/h+1

t(n)=0,n=1

t(n)=0.5,n=1201

t(n)=0.86,n=2065

t(n)=1,n=2401