NR 2-dim ex 2011

# NR 2-dim ex 2011 - iter 5 xo 3.0000 2.0000 G 74.0000...

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

Example N-R Two-dim Root Finding File: Mult-NR.mle g1[{x1,x2}] := 4x1^3+4x1*x2-42x1+2x2^2-14; g2[{x1,x2}] := 2x1^2+4x1*x2+4x2^3-26x2 -22; G[{x1,x2}] :={{12x1^2+4x2-42, 4x1+4x2} {4x1+4x2, 4x1+12x2^2-26}}; iter: 1 xo: { 4, 3} G 162.0000 28.0000 28.0000 98.0000 Ginv -0.0065 0.0019 0.0019 -0.0107 g: { 140, 88} delx: { -0.7458, -0.6849} i: 1 xo: { 4, 3} xn: { 3.2542, 2.3151} iter: 2 xo: { 3.2542, 2.3151} G 94.3363 22.2772 22.2772 51.3348 Ginv -0.0118 0.0051 0.0051 -0.0217 g: { 28.0220, 18.7563} delx: { -0.2348, -0.2635} i: 2 xo: { 3.2542, 2.3151} xn: { 3.0193, 2.0517} iter: 3 xo: { 3.0193, 2.0517} G 75.6041 20.2841 20.2841 36.5895 Ginv -0.0155 0.0086 0.0086 -0.0321 g: { 2.4879, 2.2130} delx: { -0.0196, -0.0496} i: 3 xo: { 3.0193, 2.0517} xn: { 2.9998, 2.0020}

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

View Full Document
iter: 4 xo: { 2.9998, 2.0020} G 73.9904 20.0072 20.0072 34.0974 Ginv -0.0161 0.0094 0.0094 -0.0349 g: { 0.0227, 0.0648} delx: { 0.0002, -0.0020} i: 4 xo: { 2.9998, 2.0020} xn: { 3.0000, 2.0000}
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: iter: 5 xo: { 3.0000, 2.0000} G 74.0000 20.0000 20.0000 34.0002 Ginv -0.0161 0.0095 0.0095 -0.0350 g: { 0.0000, 0.0001} delx: { 0.0000, -0.0000} i: 5 xo: { 3.0000, 2.0000} xn: { 3.0000, 2.0000} Code (Mathematica type) Print["Mult-NR.mle"]; RealFormat[8,4]; g1[{x1,x2}] := 4x1^3+4x1*x2-42x1+2x2^2-14; g2[{x1,x2}] := 2x1^2+4x1*x2+4x2^3-26x2 -22; G[{x1,x2}] :={{12x1^2+4x2-42, 4x1+4x2},{4x1+4x2, 4x1+12x2^2-26}}; Print["g1[{x1,x2}] := 4x1^3+4x1*x2-42x1+2x2^2-14;"]; Print["g2[{x1,x2}] := 2x1^2+4x1*x2+4x2^3-26x2 -22;"]; Print["G[{x1,x2}] :={{12x1^2+4x2-42, 4x1+4x2}"]; Print[" {4x1+4x2, 4x1+12x2^2-26}};"]; xo = {4,3}; For[i=1,i<=5,i++, Print[" "]; Print["iter: ",i]; xn = xo -Inverse[G[xo] ].{g1[xo],g2[xo]}; Print["xo: ",xo]; Print["G"]; MatrixPrint[1.0G[xo] ]; Print["Ginv"]; MatrixPrint[-1.0Inverse[G[xo] ] ]; Print["g: ",{g1[xo], g2[xo] }]; Print["delx: ",-Inverse[G[xo] ].{g1[xo],g2[xo]} ]; Print["i: ",i," xo: ",xo," xn: ",xn]; xo = xn; ];...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

NR 2-dim ex 2011 - iter 5 xo 3.0000 2.0000 G 74.0000...

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

View Full Document
Ask a homework question - tutors are online