please print denise

Please print denise - the actual values of y b Use the answers generated in part(a and linear interpolation to approximate the following values of

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
>> %This is an implementation of Euler's Method to determine the ODE% >> h= .05; n = 20; a = 1; b = 2; y0 = -1; >> t=a; >> w=-1; >> for i=1:n w=w+h*f(t,w); t=a+ih; end ??? Undefined function or variable 'f'. >> f = 1/(t^2)- y/t - y^2; (I changed letters back to original) >> for i=1:n w=w+h*f(t,w); t=a+ih; end ??? Subscript indices must either be real positive integers or logicals. >>1 < t < 2 y(1)=-1 exact value = -1/t a.) Use Eulers method with h=.05 to approximate the solution, and compare it with
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the actual values of y. b.) Use the answers generated in part (a) and linear interpolation to approximate the following values of y, and compare them to the actual values. I. y(1.052) II.y(1.555) III. Y(1.978) c.) Compute the value of h necessary for |y(t1)-w1| < =.05 using equ. 5.10 Delta = roundoff error associated with ui. M is a constant that is >= to the second derivate of y(t) at any point |y(t1)-w1|<= hM/2L[e^(L{ti-a})-1]...
View Full Document

This note was uploaded on 05/01/2009 for the course PSTAT 120A taught by Professor Mackgalloway during the Spring '08 term at UCSB.

Ask a homework question - tutors are online