Homework Discussion 2

# Homework Discussion 2 - 1 Homework Discussion 2 Computer...

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

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 9/13/2011 1 Homework Discussion 2 Computer Problems 10.1.4, 10.1.7, 10.2.4, RK45, RK45_Adaptive 10.1 9/13/2011 2 10.1.4 function rval = problem4b() n=100; a=0; b=1; h = (b-a)/n; t=a; x=1; for k=1:n x1=(1+t)^(-1)*x; x2=(-1)*(1+t)^(-2)*x + (1+t)^(-1)*x1; x3=2*(1+t)^(-3)*x + (-2)*(1+t)^(-2)*x1 + (1+t)^(-1)*x2; x4=(-6)*(1+t)^(-4)*x+(-2)*(1+t)^(-3)*x1 + ... (-3)*(1+t)^(-2)*x2 + (1+t)^(-1)*x3; x5=24*(1+t)^(-5)*x + 4*(1+t)^(-3)*x2 + ... (-4)*(1+t)^(-2)*x3 + (1+t)^(-1)*x4; x=x+h*(x1+(1/2)*h*(x2+(1/3)*h*(x3+... (1/4)*h*(x4+(1/5)*h*(x5))))); t=a+k*h; end rval = x; end function rval=problem4a() n=100; a=0; b=1; h=(b-a)/n; t=a; x=0; for k=1:n x1=1 + x^2; x2=2*x*x1; x3=2*x1^2 + 2*x*x2; x4=6*x1*x2 + 2*x*x3; x5=6*x2^2 + 8*x1*x3 + 2*x*x4; x=x+h*(x1+(1/2)*h*(x2+(1/3)*h*(x3+... (1/4)*h*(x4+(1/5)*h*(x5))))); t=a+k*h; end rval=x; end 10.1 9/13/2011 3 Solution • Given ′ = with = 1 . We have ′′ = ′ + , ′′ = 1 ′′′ = ′′ + 2 ′...
View Full Document

## This note was uploaded on 11/27/2011 for the course MAP 4371 taught by Professor Xli during the Fall '11 term at University of Central Florida.

### Page1 / 5

Homework Discussion 2 - 1 Homework Discussion 2 Computer...

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

View Full Document
Ask a homework question - tutors are online