Sunteți pe pagina 1din 6

3 окт 2012 10:52:45 - Draghilev's method. Finding roots. System 3.

smz

Draghilev's method. Examples.

Viacheslav N. Mezentsev, viacheslavmezentsev@gmail.com

System 3.

1
3 w cos y z
2
2 2
F w ,y ,z w 81 y 0.1 sin z 1.06
w y 1
20 z e 3 10 π
3
3 окт 2012 10:52:45 - Draghilev's method. Finding roots. System 3.smz

A little bit of magic ;)

NameVec n , _v V 0
for ii 1 .. n
V _v
ii ii
V

n 3 X NameVec 2 n 1 ,x

X1 submatrix X ,1 ,n ,1 ,1 X2 submatrix X ,n 2 ,2 n 1 ,1 ,1

X3 submatrix X ,1 ,n 1 ,1 ,1

T for ii 1 .. n 1
X1 x x x
1 2 3 for jj 1 .. n 1
if ii jj
T Eorig 1
X2 x x x
5 6 7 ii jj
else
T Eorig 0
X3 x x x x
1 2 3 4 ii jj

1 0 0 0
0 1 0 0
Eorig
0 0 1 0
0 0 0 1

S evalm F x ,x ,x x F X ,X ,X
1 2 3 n 1 5 6 7

for ii 1 .. n 1
E Eorig
E 1
n 1 ii
E 0
ii ii
E 1
ii n 1
E 0
n 1 n 1
Y submatrix multiply E , X3 ,1 ,n ,1 ,1
if ii n 1
out maple jacobian convert S , vector , convert Y , vector
ii
else
out maple jacobian convert S , vector , convert Y , vector
ii
out
3 окт 2012 10:52:45 - Draghilev's method. Finding roots. System 3.smz

rows out 4

out
1
out
2
out
3
dG x
out
4
0
0
0

x x
1 2
3 5 4 3 18 exp 1 3 1 x 2 5 1 2 3 x sin x x x x
2 5 2 3 7 2

dG x
3 окт 2012 10:52:45 - Draghilev's method. Finding roots. System 3.smz

D t , _x dG _x

x0 0.489 y0 0.5 z0 0.513 v0 1 tmin 0 tmax 0.0008

N 200 X0 stack x0 , y0 , z0 , v0 , x0 , y0 , z0

73.0321
1699.673
29.677
dG X0 5828.714
0
0
0

result rkfixed X0 , tmin , tmax , N , D t , _x

T col result ,1 X col result ,2 Y col result ,3 Z col result ,4

V col result ,5

0,75
y

0,625

0,5

0,375

0,25

0,125

-0,125

-0,25

-0,375

-0,5

-0,625

-0,75
0 0,0001220703125 0,000244140625 0,0003662109375 0,00048828125 0,0006103515625

augment T ,X
augment T ,Y
augment T ,Z
augment T ,V
3 окт 2012 10:52:45 - Draghilev's method. Finding roots. System 3.smz

Now we have to find the roots. Each intersection of the parameter V


through zero gives us one root.

out 0

Search vector N length vector


k 1
n 1
while k N
if vector 0 vector 0
k k 1
out k
n
n n 1
else
if vector 0 vector 0
k k 1
out k
n
n n 1
else
if vector 0
k
out k
n
n n 1
else
n n
k k 1
out

Roots Search V rows Roots 2

A more accurate value of the roots:


v1
Interpol p1 , p2 , v1 , v2 p1 p2 p1
v2 v1

for ii 1 ,ii length Roots ,ii ii 1


Rx Interpol X ,X , V , V
ii Roots Roots 1 Roots Roots 1
ii ii ii ii
Ry Interpol Y ,Y , V , V
ii Roots Roots 1 Roots Roots 1
ii ii ii ii
Rz Interpol Z ,Z , V , V
ii Roots Roots 1 Roots Roots 1
ii ii ii ii

0.5 5 0.5236
Rx Ry 5.7992 10 Rz
0.4981 0.5288
0.1996
3 окт 2012 10:52:45 - Draghilev's method. Finding roots. System 3.smz

rows Roots
1
F Rx , Ry , Rx 0.0003
rows Roots ii ii ii
ii = 1 1

rows Roots
1
F Rx , Ry , Rz 0.0007
rows Roots ii ii ii
ii = 1 2

rows Roots
1 6
F Rx , Ry , Rz 1.1 10
for ii 1 .. rows Roots
rows Roots ii ii ii
ii = 1 3 pp "o"
ii

0,375

0,25

0,125

-0,125

-0,25

-0,375

-0,5

-0,6250,1875 0,25 0,3125 0,375 0,4375 0,5 0,5625 0,625 0,6875 0,75

augment X ,Y
augment Rx , Ry , pp

out 0
V2 for ii 1 .. rows Roots
V1 for ii 1 .. rows Roots
out F Rx , Ry , Rz
out F Rx , Ry , Rz ii ii ii ii
ii ii ii ii 2
1
out
out

V3 for ii 1 .. rows Roots


5
out 0.5 5.7992 10 0.5236
F Rx , Ry , Rz Rx Ry Rz
ii ii ii ii 0.4981 0.5288
3 0.1996
out

6 6
1.5863 10 0.0009 1.4472 10
V1 V2 V3
7 0.0005 7
9.5261 10 7.5281 10

We can use these initial conditions in order to find


more accurate values of the roots.

S-ar putea să vă placă și