{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW5 - Lora Northcutt APPM4660 HW5 April 4,2008 1 Using...

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

Lora Northcutt APPM4660 HW5 April 4,2008 1. Using non-linear shooting to solve the boundary problem in Sec 11.2.3a, oo y = y 3 - y y 1 x 2 y (1) = 1 2 y (2) = 1 3 by solving as ODE oo z = 3 y ( x ) 2 - y ( x ) ( ) z - y ( x ) z 1 x 2 y (1) = 0 y (1) =1

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

View Full Document
Lora Northcutt APPM4660 HW5 April 4,2008 All programs were written in OCTAVE, a MATLAB alternative for Mac. OCTAVE does not recognize tabs so indenting is used sporadically. I apologize for any readability issues this may create. The # symbol is used for comments instead of the % symbol. ################################## #Author: Lora Northcutt # #Date: April 1, 2008 # #Course: APPM 4660 # #Assignment: HW5 # ################################# ####################Non-Linear Shooting Method######################### a=1; b=2; alpha=.5; beta=(1/3); N=5; TOL=0.0001; M=20; k = zeros(N+1,N+1); u = zeros(N+1); w = zeros(N+1,N+1); k_ = zeros(N+1,N+1); function ans_y = y(x) ans_y = 1/(x+1); endfunction function ans_f = f(x,y,y_); ans_f = (y^3)-(y*y_); endfunction function ans_fy = fy(x,y,y_); ans_fy = 3*(y^2) - y_; endfunction function ans_fy_ = fy_(x,y,y_) ans_fy_ = -1*y; endfunction h=(b-a)/N; k=1;
Lora Northcutt APPM4660 HW5 April 4,2008 TK=(beta-alpha)/(b-a); while(k<=M) w(2,1)=alpha; w(3,1)=TK; u(2)=0; u(3)=1; for i=2:N+1 x=a+(i-1)/h; k(2,2)=h*w(3,i-1); k(2,3)=h*f(x,w(2,i-1),w(3,i-1)); k(3,2)=h*(w(3,i-1)+.5*k(2,3));

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.

{[ snackBarMessage ]}

### Page1 / 4

HW5 - Lora Northcutt APPM4660 HW5 April 4,2008 1 Using...

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

View Full Document
Ask a homework question - tutors are online