aula maple 2a parte

6
7/23/2019 Aula Maple 2a Parte http://slidepdf.com/reader/full/aula-maple-2a-parte 1/6

Upload: rodrigo-barros

Post on 17-Feb-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Aula Maple 2a Parte

7/23/2019 Aula Maple 2a Parte

http://slidepdf.com/reader/full/aula-maple-2a-parte 1/6

Page 2: Aula Maple 2a Parte

7/23/2019 Aula Maple 2a Parte

http://slidepdf.com/reader/full/aula-maple-2a-parte 2/6

 

0.0025050134

0.4974949866

> dX:=-Ji^(-1).R[0];

 :=dX  

 

-0.0191136376969470723

0.576502430715991498

> X[1]:=X[0]+dX;

 := X 1

 

-1.01911363769694718

2.07650243071599138

> X[0]:=X[1]:

Equações diferenciais ordinarias lineares

Equação de movimento amortecido de um corpo com 1 GDL.

> :=eqd    m 

 

 

 

 

 

 

 

t ( )x   t    20

 

 

 

 

t ( )x   t k   ( )x   t    20 ( )cos 20 t 

 :=eqd    150     

 

d 2

t 2

  ( )x   t    20     

 

d d 

t ( )x   t    50 ( )x   t    20 ( )cos 20 t 

Solução analítica.

> k:=50; m:=150; c:=0.3;

 :=k    50

 :=m   150

 :=c   0.3

> eqd;

  150

 

 

 

 d 

d 2

t 2   ( )x   t    20

 

 

 

 d 

t  ( )x   t    50 ( )x   t    20 ( )cos 20 t 

> resultado:=dsolve(eqd,x(t));

resultado   ( )x   t  e

 

 

 

 

  t 

15    

 

 

 sin

74   t 

15_C2 e

 

 

 

 

  t 

15    

 

 

 cos

74   t 

15_C1:=

2398

7188325( )cos 20 t 

16

7188325( )sin 20 t 

Determinação de C1 e C2. Para x(0) = 0.8 e D(x)(0) = 1.0

> eq_aux:=rhs(resultado);

eq_aux e    

    t 

15    

 

 

 sin

74   t 

15_C2 e

    

    t 

15    

 

 

 cos

74   t 

15_C1

2398

7188325( )cos 20 t  :=

16

7188325( )sin 20 t 

> evalf(subs(t=0, eq_aux)=0.8);

  0.0003335964915 1. _C1   0.8

> isolate(%,_C1);

 _C1   0.8003335965

> assign(%);

> subs(t=0, diff(eq_aux,t))=1.0;

1

15e

0( )sin 0   _C2

1

15e

0( )cos 0 74   _C2   0.05335557310 e

0( )cos 0

0.05335557310 e0

( )sin 0 749592

1437665( )sin 0

64

1437665( )cos 0 1.0

> isolate(%,_C2); evalf(%);

 _C2   1.836673847

 _C2   1.836673847

> assign(%);

Finalmente a solução da equação diferencial.

> eq_aux;

1.836673847 e

 

 

 

 

  t 

15    

 

 

 sin

74   t 

150.8003335965 e

 

 

 

 

  t 

15    

 

 

 cos

74   t 

15 

2398

7188325( )cos 20 t 

16

7188325( )sin 20 t 

Em qualquer instante de tempo pode-se determinar a posição e a velocidade do sistema.

> evalf(subs(t=0.5,eq_aux)); evalf(subs(t=0.5,diff(eq_aux,t)));

1.245205591

0.7649618551

Solução numérica.

> dsys := {eqd, x(0)= 0.8,D(x)(0)=0.0};

dsys :=

{ }, ,

150

 

 

 

 

d 2

t 2   ( )x   t    20

 

 

 

 d 

t  ( )x   t    50 ( )x   t    20 ( )cos 20 t   ( )x 0 0.8

  ( )( )D   x   0 0.

Solução pelo método de Runge-Kutta.

> dsol := dsolve(dsys, numeric, method=rkf45,

output=procedurelist,range=0..30):

> dsol(0.5);

 

, ,t    0.5   ( )x   t    0.768197563745935952  

t ( )x   t    -0.130962361867184379

> with(plots):

> odeplot(dsol,[t,x(t)]);

Page 3: Aula Maple 2a Parte

7/23/2019 Aula Maple 2a Parte

http://slidepdf.com/reader/full/aula-maple-2a-parte 3/6

> odeplot(dsol,[t,D(x)(t)]);   Plano de fase

> odeplot(dsol,[x(t),D(x)(t)]);

Page 4: Aula Maple 2a Parte

7/23/2019 Aula Maple 2a Parte

http://slidepdf.com/reader/full/aula-maple-2a-parte 4/6

> for i from 0 by 0.5 to 30 do

dsol(i);

od;

 

, ,t    0.   ( )x   t    0.80000000000000  

t ( )x   t    0.

 

, ,t    0.5   ( )x   t    0.768197563745935952  

t ( )x   t    -0.130962361867184379

 

, ,t    1.0   ( )x   t    0.675982512402666824  

t ( )x   t    -0.230038011523358205

 

, ,t    1.5   ( )x   t    0.536052906814768804  

t ( )x   t    -0.325659869901727962

 

, ,t    2.0   ( )x   t    0.362430624143847357  

t ( )x   t    -0.366168679348157444

 

, ,t    2.5   ( )x   t    0.170201756173711305  

t ( )x   t    -0.391783712259251127

 

, ,t    3.0   ( )x   t    -0.0221309348718498125  

t ( )x   t    -0.378671062576175720

 

, ,t    3.5   ( )x   t    -0.201387204502363665   d 

t ( )x   t    -0.328638149145211168

 

, ,t    4.0   ( )x   t    -0.352239987217594197  

t ( )x   t    -0.273734610869820816

 

, ,t    4.5   ( )x   t    -0.465273035475648744  

t ( )x   t    -0.177343468464130876

 

, ,t    5.0   ( )x   t    -0.534304572525855282  

t ( )x   t    -0.0935471311991692700

 

, ,

t    5.5

  ( )x   t    -0.555098037248683008

  d 

t  ( )x   t    0.00375143682108820300

 

, ,t    6.0   ( )x   t    -0.531269002740448637  

t ( )x   t    0.0958902932846419088

 

, ,t    6.5   ( )x   t    -0.465510744305213998  

t ( )x   t    0.160615788899196699

 

, ,t    7.0   ( )x   t    -0.367133657795731538  

t ( )x   t    0.230041566270258707

 

, ,t    7.5   ( )x   t    -0.245957893365722020  

( )x   t    0.253898456133835881

 

, ,t    8.0   ( )x   t    -0.112081117217420117  

t ( )x   t    0.272207638418829445

 

, ,t    8.5   ( )x   t    0.0209981009622273764  

t ( )x   t    0.262832740153134403

 

, ,t    9.0   ( )x   t    0.144895410738542646  

t ( )x   t    0.224607865387992462

 

, ,t    9.5   ( )x   t    0.248523161441303514  

t ( )x   t    0.189697050143371320

 

, ,t    10.0   ( )x   t    0.325628959586297674  

t ( )x   t    0.118663392834282552

 

, ,t    10.5   ( )x   t    0.372275182702799301  

t ( )x   t    0.0627933432392509816

 

, ,t    11.0   ( )x   t    0.385074491532969244  

t ( )x   t    -0.00501406632308102392

 

, ,t    11.5   ( )x   t    0.367374376110609302  

t ( )x   t    -0.0704866677429301232

Page 5: Aula Maple 2a Parte

7/23/2019 Aula Maple 2a Parte

http://slidepdf.com/reader/full/aula-maple-2a-parte 5/6

Page 6: Aula Maple 2a Parte

7/23/2019 Aula Maple 2a Parte

http://slidepdf.com/reader/full/aula-maple-2a-parte 6/6

 :=sys_ode   ,d 

t ( )y   t    ( )x   t   

t ( )x   t      ( )x   t 

> dsolve([sys_ode]);

{ },( )x   t _C4 e( )t 

 ( )y   t    _C4 e( )t 

_C3

condições iniciais.

> ics := x(0)=1, y(1)=0;

 :=ics   ,( )x 0 1   ( )y 1 0

Solve the system of ODEs subject to the initial conditions ics.

> dsolve([sys_ode, ics]);

{ },( )x   t  e( )t 

 ( )y   t    e( )t    1

e

>

>

>>