{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw8910_sol_cms02

# hw8910_sol_cms02 - CGN 3421 A solution to HW#8 ORIGIN 1...

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

CGN 3421 hw8910_sol_cms02.fm page 1 of 8 4/23/02 CGN 3421 Computer Methods Spring 2002 A solution to HW #8 input C:\..\test_data.txt := input ORIGIN 1 x input 1 ⟨ ⟩ := y input 2 ⟨ ⟩ := curvepoly x y , order , ( ) p i j + 2 A i j , x p A j i , A i j , i j if j i order 1 + .. for i 1 order 1 + .. for p i 1 B i x ( ) p y i 1 order 1 + .. for a A 1 B fx 1 order 1 + i a i x i 1 = A B a fx := curveexp x y , ( ) Y ln y ( ) stuff curvepoly x Y , 1 , ( ) a stuff 3 C exp a 1 ( ) A a 2 fx C exp A x ( ) A C fx := A B a fx1 curvepoly x y , 1 , ( ) := a 2.481 1.116 = A B a fx2 curvepoly x y , 2 , ( ) := a 0.699 1.88 0.509 = A B a fx3 curvepoly x y , 3 , ( ) := a 0.202 0.881 0.912 0.179 = A C fxexp curveexp x y , ( ) := A 1.4 = C 0.35 =

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

View Full Document
CGN 3421 hw8910_sol_cms02.fm page 2 of 8 4/23/02 4 3 2 1 0 1 2 3 2 0 2 4 6 8 10 12 1st order 2nd order 3rd order exp data fx1 fx2 fx3 fxexp y x
CGN 3421 hw8910_sol_cms02.fm page 3 of 8 4/23/02 A solution to HW #9 ORIGIN 1 Eulers f x0 , xf , y0 , N , ( ) dx xf x0 ( ) N y 1 y0 x 1 x0 y i y i 1 dx f x i 1 y i 1 , ( ) + x i x i 1 dx + i 2 N 1 + .. for x y := Differential Equation to solve yprime x y , ( ) y x 2 1.2 y := Exact Solution yexact x ( ) exp x 3 3 1.2 x := Heuns method is a combination of Euler (for the predictor) and Improved Euler (for the corrector) You cannot perform Improved Euler on a function of x and y because you cannot calculate a second value of y to create a guess of y - that is why you do Euler first in Heuns method.

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 / 8

hw8910_sol_cms02 - CGN 3421 A solution to HW#8 ORIGIN 1...

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

View Full Document
Ask a homework question - tutors are online