pract ecu diferenciales

Upload: vick-vaskez

Post on 05-Jul-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/15/2019 Pract Ecu Diferenciales

    1/15

  • 8/15/2019 Pract Ecu Diferenciales

    2/15

    -2 0 2

    0

    2

    4

    6

    8

    10

    12

    p 2

    K 0 E EMPLO DE TRAYECTORIAS ORTOGONALES

    s1 s 1 J13 0 2 1 3

    0 2 1-!% "3(%)) ; 0 2;,; ;/

    1-!% " 3 20 0

    3sol e ;1-!% "320 0 ;,; ;/

    3 *=201-!% "=

    e(%)3s$5s ;1< 0 234;,; ;, / e(%) 3 1

  • 8/15/2019 Pract Ecu Diferenciales

    3/15

    p 3

    Ejemplos con Matlab, clase Métodos Numéricos: ______________________

    Ej 22 hojas clase

    >> dsolve('D2y*y=Dy^2+6*x*y^2','y(0)=1','Dy(0)=0','x')ans = exp(x^3)

    >> dsolve('D2y=Dy','y(0)=0','Dy(1)=1','x')ans = -1/exp(1)+1/exp(1)*exp(x)

    >> sol=simpli y(ans)sol = -exp(-1)+exp(x-1)

    Ej libro Ex FinFeb 96

    >> dsolve('D2y+(2/x)*Dy=0','y(1)=0','Dy(2)=1','x')ans = !-!/x

    """"""""""""""""""""

    Exam Final MN Feb 02

    >> misol=dsolve('x*D2y+(2*x-1)*Dy=-!*x^2','y(0)=0','Dy(1)=0','x')misol = -x^2+1/2/exp(-2)-1/2/exp(-2)*(2*exp(-2*x)*x+exp(-2*x)) >> misol=simple(misol)misol = -x^2+1/2*exp(2)-exp(2-2*x)*x-1/2*exp(2-2*x)

    #$%&$ % % $>> misol=dsolve('Dy1=y2','Dy2=-(2*x-1)*y2/x-!*x','y1(0)=0','y2(1)=0','x')

    misol =y1. 1x1 sym

    y2. 1x1 sym>> x=0 y0" =eval(misol y1), yp4ima"0" =eval(misol y2)y0" = 0 5262yp4ima"0" = 1 51 3

    >> simpli y(misol y1)ans = -x^2-x*exp(2-2*x)+1/2*exp(2)-1/2*exp(2-2*x) >> misol1=simpli y(misol y1)misol1 = -x^2-x*exp(2-2*x)+1/2*exp(2)-1/2*exp(2-2*x) >> misol y1ans = -x^2-1/exp(-2)*exp(-2*x)*x+1/2/exp(-2)-1/2/exp(-2)*exp(-2*x) >> di (misol1,'x')ans = -2*x+2*x*exp(2-2*x)

    >> simpli y(misol y2)ans = 2*x*(-1+exp(2-2*x))

  • 8/15/2019 Pract Ecu Diferenciales

    4/15

    p 4

    Ex Sep 96, Feb 87, Hojas clase, Blasius

    >> dsolve('7*D27+2*D37=0','7(0)=0','D7(0)=0','D27(0)=1/2','x')8a4nin9. $xpli:i; sol>

  • 8/15/2019 Pract Ecu Diferenciales

    5/15

    p 5

    EDO , -!o5le " (e "lo! %'%#%"l P!o5le " (e C"$# 1/EDO *e! o!(e', e -lQ#%@":1 3 ) ,1/, ",5 , 1 "/3

    O5s ! ese $e l" EDO 'os (" l"s (e!% "("s s$#es% "s (e 1!es-e#@o (e : 1 /3 ) ,1 // ,1 /3 ) ,1 // + ) 1 ,1 //0(1=( 31 /3 ) ,1 // + ) 1 ,1 //0 ) ,1 //

    1 /3 ) +) 10(1=( +) 1 0) +) 110(1=( 0)+) 10) +) 10) 10(1=( 31 /3 ) +) 10) + ) 1 0) +) 110)0)+) 10) +) 10) 10) 31 /3 ) + 20) 10) + ) 110) 2 + ) 10) + ) 120)

    e@#.Resol$#%&' '$ !%#" PASO " PASO @o(os (e T"1lo!, * -"so/

    1 #+ /3 1 #/+ 1 #/0 =* + 1 #/0 2=2 + 1 #/0 >=> ++ 1 % #/0 = +...

    1 #+ /3 1 #/+ 1 #/0 =* + 1 #/0 2=2 + 1 #/0 >=> ++ 1 % #/0 = + /

    ERROR DE TRUNCATURA LOCAL : /

    M @o(o (e T"1lo! (e o!(e' * E$le!/

    1%+*3 1 %+ 1 %0 =* De l" EDO, 1 %3 ) %,1 %/1%+*3 1 %+ ) %,1 %/0 , %34,*,2,... 1 % "-!o % " " 1 %/14 3 E!!o! T!$'# Lo#"l: 2/

    M @o(o (e T"1lo! (e o!(e' 21%+*3 1 %+ 1 %0 =* + 1 %0 2=2

    De l" EDO: 1 %3 ) %,1 %/,

    1 %3 ) %,1 %/+ ) 1 %,1 %/0 ) %,1 %/14 3 %34,*,2,... E!!o! T!$'# Lo#"l: >/

    x0=a x

    1x

    2 ... xi xi+1 ...

    ...hh h

  • 8/15/2019 Pract Ecu Diferenciales

    6/15

    p 6

    EDO , -!o5le " (e "lo! %'%#%"l P!o5le " (e C"$# 1/EDO *e! o!(e', e -lQ#%@":1 3 ) ,1/, e' ",5 , 1 "/3

    Para evitar el cálculo de derivadas sucesivas de los métodos deTaylor: M @o(os -"so " -"so (e * -"so/ (e R$'6e 3 ) %+ =2/,1 %+ =2/072/7 3 ) %+ ,1 %+ 07>/

    14 3 %34,*,2,...

  • 8/15/2019 Pract Ecu Diferenciales

    7/15

    p 7

    S%s@e " (e EDO:

    1* 3 )* ,1*,12/ Y 3 ,Y/, Y3 1*,12 ,12 3 )2 ,1*,12/ 3 )* ,Y/,)2 ,Y/

    V"! %'(e-: ",5 ,

    1* "/3 *12 "/3 2

    T"1lo! o!(e' * E$le!/

    1*%+*3 1* %+ 1* %0 =* Y%+*3 Y% + ,Y/0 =*12%+*3 12 %+ 12 %0 =*

    1*%+*3 1* %+ )* %,1* %,12 %/0 , %34,*,2,...12%+*3 12 %+ )2 %,1* %,12 %/0 ,

    1*% , 12 % "-!o % "' " 1* %/, 12 %/14 3 , 1* 43 * , 12 43 2

    T"1lo! o!(e' 2 Y%+*3 Y% + ,Y/0 =* + ,Y/0 2=2

    1*%+*3 1* %+ 1* %0 =* + 1* %02

    =212%+*3 12 %+ 12 %0 =* + 12 %0 2=2

    s%e'(o1* %3 )* %,1* %,12 %/1* %3 )* %,1* %,12 %/+)* 1* %,1* %,12 %/0)* %,1* %,12 %/+

    +)* 12 %,1* %,12 %/0)2 %,1* %,12 %/

    12 %3 )2 %,1* %,12 %/

    12 %3 )2 %,1* %,12 %/+)2 1* %,1* %,12 %/0)* %,1* %,12 %/++)2 12 %,1* %,12 %/0)2 %,1* %,12 %/

    %34,*,2,... E!!o! T!$'#"@$!" Lo#"l e' 1* e 12: >//

    1*4 3 1* "/3 *124 3 12 "/3 2

    x0=a x

    1x

    2 ... xi xi+1 ...

    ...hh h

  • 8/15/2019 Pract Ecu Diferenciales

    8/15

    p 8

    EDO e -lQ#%@" (e o!(e' -, P!o5le " (e C"$# 1:1 - 3 ) ,1,1 ,1 ,...,1 - , 12 "/3 21> 3 1 , 1> "/3 >... ...1- 3 ) ,1*,12,...,1-/, 1- "/3 -

    Eje -lo: T"1lo! o!(e' 2 -"!" 1 3) ,1,1 /, ",51 "/3 *1 "/3 2

    SISTEMA: 1* 312,12 3) ,1*,12/

    Z 1* 312, 1* 312 3 ) ,1*,12/

    12 3) ,1*,12/, 12 3 ) ,1*,12/+) 1* ,1*,12/012+ ) 12 ,1*,12/0) ,1*,12/ [

    1*%+*3 1* %+1* %0 +1* %0 2=2

    12%+*3 12 %+12 %0 + 12 %0 2=2 @o "'(o:1* %312% , 12 % 3) %,1* %,12 %/1* %3) %,1* %,12 %/ ,12 %3) %,1* %,12 %/+) 1* %,1* %,12 %/012 %+) 12 %,1* %,12 %/0) %,1* %,12 %/

    -"!" %34,*,2,... E!!o! T!$'#"@$!" Lo#"l e' 1* e 12: >//

    1*4 3 1* "/3 *

    124 3 12 "/3 2

    x0=a x

    1x

    2 ...

    xi

    xi+1 ..

    .

    ..

    .

    hh h

  • 8/15/2019 Pract Ecu Diferenciales

    9/15

    p 9

  • 8/15/2019 Pract Ecu Diferenciales

    10/15

    0 0.2 0.4 0.6 0.8 1 1.2 1.40.65

    0.7

    0.75

    0.8

    0.85

    0.9

    0.95

    1

    0 0.2 0.4 0.6 0.8 1 1.2 1.40.65

    0.7

    0.75

    0.8

    0.85

    0.9

    0.95

    1

    p 10

    K EjL"5*5"s%#oT"1lo!*, E$le!/ -"so " -"so, 5"s%#oK 1%+*31%+ 01;%K 1;3

  • 8/15/2019 Pract Ecu Diferenciales

    11/15

    0 0.5 10

    5

    10

    15

    20

    25

    30

    35

    40

    45yaprox + , yexac o

    Eje X0 0.5 1

    0

    20

    40

    60

    80

    100

    120

    140yprim aprox + , yprim exac o

    Eje X

    p 114A5 0 AR64"7OS "8PL"6ADOS1) Programa principal --------------------9 rE +Sis R; , "#tee& %0>&total'$ie& %0>&'3) 3 Función un paso RK2 tag pto medio --------------------9 $u#cio# R; T$%&i,yi''yim+!yi=)>$EDOsis%&i=)@ ,yi=%)@ '>$EDOsis%&i,yi''&im+!&i=)

  • 8/15/2019 Pract Ecu Diferenciales

    12/15

  • 8/15/2019 Pract Ecu Diferenciales

    13/15

    p 13

    ED : DIFERENCIAG FINIHAG, problema de C NH RN

    66'$#) , ) en 0a,b4, #a 'al$a, #b 'beta *...... *...... *...... *...... *...... *i.2 i i;2

    / ' #b.a 8n , n'nJ subinter , n;2 ' nKm ptos discret, )'a )'b

    66i'# i;2 .-+ i; i .2 8/ -, #Error: #/ - 66i apro) a 66#)i * 66#)i '$#)i

    Llanteamos 2 ecuaci5n por cada pto discret* Gistema de ecuaciones M apro)'b:

    2 ecuaci5n en ) 2'a : 2 ' al$a

    Ecuaci5n i'-,>, ,n i.2 . - i ; i ;2 ' $#) i +/ -

    n ecuaci5n en ) n;2 'b : n;2 ' beta

    Lara n'? subinter alos: M apro) b

    2 1 1 1 1 1 2 al$a2 .- 2 1 1 1 - $#)- +/ -1 2 .- 2 1 1 > $#)> +/ -1 1 2 .- 2 1 = $#)= +/ -1 1 1 2 .- 2 ? $#)? +/ -1 1 1 1 1 2 9 beta

    Gistema de ecuaciones lineales* MatriO de coe$icientes tipo banda6, dispersa6, sparse6, conmuc/os ceros6

    Lro%L(&'C,C&C,CLC'

    &!li#s ace%a,F,#=+'8!Meros%#=+,#=+' 9 co#struir matriM coe$ 88%+,+'!+ 8%#=+,#=+'!+ F%+'!al$a F%#=+'!Feta

    $or i! :# 8%i,?i(+,i,i=+ '!?+,( ,+ F%i'!$%&%i',L'>)Ne#d8,F 9 EscriFimos e# 7e#ta#a 6oma#dos matriM coe$ y vector i#de

    ya ro&!8 FC 9 resolucio# sistema ecuacio#es li#ealesye&acta!L>&.N0@2(&.N3@+ (LN0>&@+ 9 calculo solucio# e&acta

    9 Escritura y diFu o de resultadosdis %C&, ya ro&,ye&actaC',?&C,ya ro&,ye&actaC$i

  • 8/15/2019 Pract Ecu Diferenciales

    14/15

  • 8/15/2019 Pract Ecu Diferenciales

    15/15

    p 15

    % Ej Pab2 HAQP R 2 LAG A LAG , AGIC% ('). , ) en 01,2*-4, #1 '2, clear all)#2 '1, apro)#2 '23 e)acta#2 '-+e)p#.)#2 ;)#2 .23error#2 '13/'1*12npasos'round#2*-8/ 3$or i'2:npasos )#i;2 ')#i ;/3 apro)#i;2 ' apro)#i ;/+#)#i . apro)#i 3 e)acta#i;2 '-+e)p#.)#i;2 ;)#i;2 .23 error#i;2 ' e)acta#i;2 . apro)#i;2 3end), apro), e)acta,error

    % Contorno 66'$#) DIFERENCIAG FINIHAG, AGIC

    clear all

    n'213P'?3/'P8n3$'inline#()+#P.) (,()(,(P()#2 '13$or i'-:n;2, )#i ')#i.2 ;/3end)M'Oeros#n;2,n;2 3M#2,2 '23M#n;2,n;2 '23$or i'-:n, M#i,0i.2,i,i;24 '02,.-,243endMb#2 '13b#n;2 '13

    $or i'-:n, b#i '$#)#i ,P +/ -3endb

    apro)'MSb(e)acta'P+)* >89.)* =82-.P >+)82-