General::obspkg :
VectorFieldPlots' ¡s now obsolete. The legacy versión being loaded may conflict with current Mathematica functionality. See the Compatibility Guide for updating ¡nformation. »
l . v [ x ] = hx^]dt
J o
s.a.
x(0) = 9 x(2) = 11
ini3):= e q l = EulerEquations[7x''[zf]^,
x[í], t
Oul[3)= - 14 x " [ t ] = 02 I UnldlPracl.nb
in|(,i:= A n i m a t e [ S h o w [ P l o t [ 9 +1,
{(,
- 0 . 5 , 2.5), PlotRange -> (8, 1 2 } ] ,Oiilf5|=
1 2 r
: - 0 . 5 2.0 . . . . 2.5'
2. v[x] = Í5x^ + 2íjú?í Jo
s.a.
x(0) = O x ( l ) = 2
in[6i:= eq2 = E u l e r E q u a t i o n s [ 5 x ' M ^ + 2t,
x[t], t
Oul[61= - 1 0 X ' ' [ t ] O
in(7i:= DSolve[{eq2, x [ 0 ] ~ O, x [ l ] == 2}, x M , ^]
in(8):= Animate[Show[Plot[21,
.{t, -
0.2, 1.5), PlotRange. { - 0.2, 2.5}]!,G r a p h i c s [ ( R G B C o l o r [ 0 , 1, 0], I ) i s k [ { 4 2 ^}, {0.07, 0.15}]}]],'{zí,^ O, 1, O.Ol}]
Oull8}=
3.v[x] = - —
Jo 2
s.a.
x(0) = 20
x(40) = O
in[9]:= eq3 - E u l e r E q u a t i o n s
x\tf
Oull9)= X " [ t ] ~ O
in[io]:= BSolve[{eq3, x [ 0 ] ~ 20, x [ 4 0 ] ~ 0}, x M , t\
40 - t
Oul[10]=
| | x [ t ]
4 I UnldlPrsci.nb
nM:.i Anímate Show Plot 20 - (/f, O, 40], PlotRange -4 {O, 20)
í. ' . • . - ,
G r a p h i c s [ R G B C o l o r [ 0 , 1, 0], D i s k {ií,;20:^ - } , , . . M ) ,.{t,.0,JLMM "2^
20
( ) i i l ( 1 2 |
30 40
rio
-(2 XX +x^]clí
4. v[x] =
s.a.
x(0) = 10 x(10) = 100
inii3):= eq4 = EulerEquations[-2x[¿] x ' M - x ' M ^ , x[zí],
t
oui|i3i= 2 x ' ' [ t ] Oin|i4i:= DSolve[{eq4, x [ 0 ] ~ 10, x[10] 100),
x[t\, t]
inii5).= A n i m a t e [ S h o w [ P l o t [ 1 0 + 9 zí, {2í, O
• G r a p M c s [ { R G B C o l o r [ 0 , ^ l , 0], B i s k [ { 4 10 + 91}, {0.3, 3}]-}]],= [í, O, 10, O'.05}]'
:llíí'
Oul[15]=
/-2
J o
s.a.
x(0) = 1 x(2) = 4
in(i6i:= eq5 = EulerEquations[4 x'[tf + 12íx'[t] - 5 zf, x[t], t
Oul|15)= - 4 (3 + 2 X " [ t ] ) O
inii7):= DSolve[{eq5, x [ 0 ] ~ 1,
x\^]
4},;x[t]; t]: :
Oul|17)=
x [ t ]
^ -
(4
+ 12 t - 3
4 ^
mu 8]:= E x p a n d [ % ]
31=
6 UnidlPracl.nb
ln|19|- = A n i m a t e Show Plot - - / + 3t+l,{t, -O.S^l'.S}, PlotRange -> (tf," 5 } ', G r a p h i c s
R G B C o l o r [ 0 , 1, 0], Disk[|zf, - j ; z ? H - 3 T + l j , . i Q . M , , , a . 2 ^ ^ ^
o
- 0 . 5 0.0 0.5 .0 1.5 2.0 2.5
6. v[x] = X + X X + X +
—
1 x^ dts.a.
x ( l ) = 5
in(20):= eq6 = EulerEquations
x[í]
+ x-[/] x ' W + x'[zí])4- - x-'['z(['?, xfífv íL 2
Ou.|20)= 1 - X ' ' [ t ] O
in(2ii:= DSolve[{eq6, x [ 0 ] ~ 2, x [ l ] — 5}, x ^ ,
t]
1
2
in[22]:= E x p a n d [ % ]
Ouif21l=
| | x [ t ] ^ -
(4 + 5
t + t^)
5 t
r r r l , 5 .
in|23i:= A n i m a t e Show Plot - t + - t + 2,{í, - 0 . 2 , 1 . 2 } , PlotRange ^ (O, 6} , G r a p h i c s
• • •2 2 • - • ^ ' . ; . • • ! ; ! • • • >
rr 1 O 5 ^ ^^-n
R G B C o l o r [ 0 , 1, 0], Disk[|r, -t^+:-t + 2j, {0.04^ 0.2}jjjj,jz;¿^0^^ 1;. O-Ol)
Oull23)=
- 0 . 2
7.v[x] = r2 Jo
12X/ + X
x(0) = 2 x(2) = 8
in[24i:= eq? = E u l e r E q u a t i o n s [ l 2 tx[t]+x'[t]-, x[í], t oui|24]= 12 t - 2 x " [ t ] o
t^}"-8 I UnidlPrachnb
ln|2e 261- AnimateíShowÍPlotí^ - í + 2, ( ^ . - 2 , 3}, PlotRange -> {-1,.12^1,
G r a p M c s [ { R G B C o i o r [ 0 , 1, 0], msk[[t, t^-í + l), {OU, 0.5}])]], [t, O, 2,^0.01)
11
1 2 r
8.v[x] = 2 x - 6 í x + l U W /
x(0) = 4 x(4) = 12
ini27i:= cqS = E u l e r E q u a t i o n s [ 2 x ' [ i f ] ^ - 6tx[t] + 111, x[t], t Oul[271= - 6 t - 4 x " [ t ] = 0
ini28i:= DSolve[(eq8, x [ 0 ] — 4, x [ 4 ] - 12}, x[t],t]^_
1
4
in(29i:= S i m p l i f y [ % ]Oulf28I= | x [ t ] ->
i
( l 6 + 24
t - t ^ )II
Oulf291= x [ t ] ->4 + 6 t
ii.poi!= Áílimate Show Plot — ^+é-í+4, {zf, - . 0 . 5 , 5.5),-PtotRaiig6-^if^íi,.l^t!Gtaphi(2s 4 • > ^ J
1 L
|RGBColoa-[0, 1 , 0 ] , D i s k [ | ^ , — -^ + 6t-^4p {O;.!, 0 ! 5) j j j j ; ^- Q ; 4 ; ; 0 ; 0 1 }
Oul[30]=
^1
9. v[x] = (i-- - 2 x i - + 10 tx) dt Jo
s.a.
x(0) = 1
x ( l ) = 2
in(3i):= eq9 = EulerEquations[x'[í]^ - 2 x ^ x}\t\ lO^íx^p]^ x . M , /j o u i i 3 i ] = 10 t - 2 yi" [ t ] O
in(32]:= DSolve[{eq9, x[ 0 ] ~ 1, x [ l ] 2 ) , x M ,
1
outi32]=
| | x [ t ] - (6 + t + 5 t ^
ini33]:= S i m p l i f y [ % ]
10 I UnidlPracl.nb
u^iMY- A n i m a t e Sjiow P l o t r5 1 y r- t^:-b.^^-í^% {íy-O.S, 1.5}, Pl.otRange^(>-^Qí5,.2A>^vOr^pOiics
'-6 6
; :RGBColor[0;ar'0]> D i s k
6 6 ^
Oul(3<)|=
1 — ->í
2.5
•
2.0
-1.5
1 n.
0.5
1 1
- 0 . 5
- 0 . 5
0.5 1.0 1.5
1 0 . v [ x ] = (jc + 4í^x)dt • Jo
s.a.
• x(0) = 1
x(2) = 4
in[35):= eqlO = EulerEquatioRsíx'^[í]^ + 4'Px[t]^x[t], t Oull351= 4 - 2 [ t ] ==0
in[36i:= DSolve[{eqlO, x [ 0 ] ~ 1, x [ 2 ] ~ 4}, x[t], i] 1
Out(36]= X [ t ] 1 0 - t + t
10 ^
in(37]:= E x p a n d [%]
Oull37]= X [ t ] - ^ 1 +
inia8|:= Anímate Show P l o t [ — f - — R - 0 . 5 , 2.5}, PlotRange { - 1 , 5}J, G r a p h i c s r 1 1 1
-R G B C o l o r [ 0 , 1, 0 ] , D i s k {t, ^ é - ^ 7 + i [ , {0.09, 0.2} ] , {¿, 0, 2, 0.01}
Oul(38|=
! _ J 1
- 0 . 5 0.5 1.0 1.5 2.0 2.5
^1
11. v[x] = ( - 1 6 xW^ + 144x[í] + 11 x[í] x'[^] - 4 x ' W ' ) dt Jo
s.a.
x(0) = 8 x ( l ) = 8.6
in[39i:= c q l l = E u l e r E q u a t i o n s [ - 1 6 x[t]^ + 144 x[t] + 11 x[t] x'[í] - 4 x'[tf, x[t], t Out|39)- 8 (18 - 4 X [ t ] + X " [ t ] ) .::= O ' ' "
in(4oi.= D S o l Y e [ { e q l l , x [ 0 ] 8, x [ l ] ~ 8.6}, x[t], t\
ou.i40]=
| | x [ t ]
(3
. 00007 +
4.5
e^*" + 0.4999-26 e*^)
}^"-ini4i):= E x p a n d [96]12 I UnidlPracl.nb
I..I421:-- A n i m a t e
Sliow[PIot[4.5 + 3(e~^^ + 0. 5 í 3 2 V R - 0 - 5 , 1.5), P i o t R a n g e - ^ {6.5, 9}], Graphics
^. • R G B C o I o r [ 0 , 1, 0], Diskfjz;, 4.5 + 3 e"^^ + 0.5 e^'^, {0.0^, 0 . 1 ) ] } J 1 , 0.01}
Out(421=
i 9.n
; /
« . 5
: /
8.0^
7 ^ / .J
7.0
1 , , , , 1 j 1 1 1 1 t 1 1 1 1 1 1 1 1
- 0 . 5 0.0 0.5
12. v[x] = X- + 4xx-x-]dt
s.a.
Jo
x(0) = 4
X - = 1
int43i:= e q l 2 = E u l e r E q u a t i o n s [ x ' ' M ^ + 4 x[t]x'[t] - xltf, x[t], t üut|43j=
- 2 ( x [ t ] + x " [ t ] )
== oln(441:= DSolVC | e q l 2 , x [ 0 ] - 4, x ^ ~ l } , x[t], t
in[45j:= A n i m a t e Sh(n^'[IU'ot[4 G3os[<l + S i n M , {% -0..5,-2:s), BóíRiangB.^-^{^0.Sy'5}],.©i?apMcs[
{ R G B C o l o r [ 0 , 1, 0], D i s k f e 4 C o s M + SiníM}, {0.09V0:2>]}]], { ? ; ^ 0 , - ; ^
Out|451=
- 0 . 5
1 3 . v M =
5n r-rí
s.a.
Jo
x(0) = 7
f57T\
•7T
1 -^^ 2 x ^ - 2 4 x - 4 x x - - x " ^ di
inH6}:= e q l 3 - EulerEquations
lx{tf -
24 - 4 x M x'[zí] - - x ' M ^ , x W , ^2
Ouil461= - 24 + 4 x [ t ] + x " [ t ] ~ . O
Inl47]:= DSolVe eql3, x[0] — 7, x — ~ 8 L x M , t
L 4 1 J
14 I UnldlPracl.nb
G4-ap:hics[{RGBColor[0, 1, 0 ] , :|)i§Jk[{;í;. 6,-f Co§[:2/]^+,2 ^ j n p 41), ¿^^^ |4
O, — , o . o n
A )
Oiit|481=
rlf 1 \
Jo V 2 J
s.a.
x(0) = 1 ; - . x ( l ) = 2 ^ • ^ ^ ' ' - ^
in|49i:= e q l 4 = E u l e r E q u a t i o n s -Sx[ty + 16x[t] - x[t] x'[t]-~ x'[ty, x^t], t
OutI49]= 16 - 16 X [ t ] + [ t ] ::::: O . ; . r ! • ^ / in[5oi:= DSoive[{eql4, x [ 0 ] ~ 1, ~ 2}, x[zf],
N5ij:= Anímate Show Plot
-4 4 [ e - ' ^ ' + [t, - 0 . 5 , 1.5), P l o t R a n g e ^ { - 0 . 5 , 2.5]
: 1 G r a p h i c s [ | R G B C o l o r [ 0 , 1, 0], D i s k
{í, O, 1, 0.01}
-4 4 {e-'^''-(e^') + ñ,'{0.05, 0.1]
Oul[51J=
-O.5L
Ejemplo 1. La función de consumo del país depende tanto de la propensión marginal a consumir de la nación c(t) y su tasa de cambio con el tiempo c(t) tales que C(t)=7.5c^-15c+6(c) ^. Supongamos que el objetivo del gobierno es aumentar al máximo el consumo total en el horizonte temporal de [0,4], Buscar y analizar la trayectoria en el tiempo óptimo de la propensión marginal a consumir.
Solución:
El problema de optimización del gobierno es
máx j^'C{t)dt
s.a x(to)=xo x ( t i ) = x i
16 .UríldlPracl.nb
S.a X(0)=2 . :
•• ' x(4j=5 . • '
.n(52i:= ;egl5 = E u l e r E q u a t i o n s [ ( 7 . 5 c[tf- - 15 c[t] +-;6 c'[zí]^],, c¡t], t
o.M,5.,= - 1 5 . + 1 5 . c [ t ] - 1 2 . c ' ' [ t ] - 0 • •
10(531:^ 7V[DSolve[{eql5, c[0] ~ 2, c[4] = r 5}, c[t], í]]
o u , 5 . 3 , - {{c[t] ^ 2 . 7 1 8 2 8 - ' - " ^ ° 3 t (0.954433 + l . x . 2 . 7 l 8 Z 8 ' ; " ^ ° 3 ^ + ^ 0 . 0 4 5 5 6 7 x 2.71.
i n i . ' . 4 i - S i m p l i f y [ % ]
2 . 2 3 6 0 7 1
)}}
o,..,.s4,= { { c [ t ] - ^ l . + 0 . 9 5 4 4 3 3 e - ' - " ^ ° 3 t ^ Q _ Q 4 5 5 g 7 ^ i . i i 8 Q 3 t ^ ^
ini5í.):= A n i m a t e [ S h o w [ P l o t [ l + 0.954433 re"^-^^^"^' + 0.045567<e^-^^^°^', [t, - 0 . 5 , 4.5},
PlotRange {O, 5.5}], G r a p h i c s [ { R G B C o l o r [ 0 , 1, 0 ] , D i s k '
{i, 1 +0.954433 <e-^-"^°2' +0.045567 <e'-"^°^'}, {0.^05, O . i ] ] } ] ] , {t, O, 4, 0.01}
r ^
Oiit(f)5)=
Ejemplo 2. Encontrar la trayectoria de producción óptima x(t) en el periodo [0,1] para una empresa cuya función de costos está dada por. .
, c(x,x)=x^+x^
E l precio del producto se mantiene fijo e igual a $4.00 y la tasa de descuento es igual a
máx j^(px-c)(e~P^¿^t
s.a x(toJ=xo
x ( t i ) = x i
máx f^{ix-x^-x^]e-^-^^dt
s.a
x
(0)=0
x ( l
) = 1 0
ini56):= e q l 6 = EulerEquations[(4 x[t] - x^tf - x[tf) e'^'^\ outi56)=
0 . - 2
e"^-^'( -
2
+ x [ t ] ) -0.2
e-^-^' x ' [ t ] +2
e'^-^'x"[i] == Oin(67,:= DSolve[{eql6, x [ 0 ] O, x[l] =^ 10), x[t], t]
ou„57j= { { x [ t ] ^-0-9512491
(_5_5445 ^ 2.
^0.9512491 +35445
^2:0025 f ini58]= S i m p l i f y [ % ]ou.i58]= { { x [ t ] 2. - 5 . 5 4 4 5 ^ - 0 - ^ 5 i 2 4 9
t
^3_5445
^ i . 0 5 i 2 5 t
in[59i:= A n i m a t e [ S h o w [ P l o t [ 2 - 5.5445 ^-0-9512491 ^ 3 5445 ^1.05125/^
{t, - 0 . 2 , 1.5), P l o t R a n g e - > { - 0 . 5 , 10.5}], G r a p l i i c s [ ( R G B C o l o r [ 0 , 1 , 0 ] ;
Disk[{í, 2 - 5 . 5 4 4 5 + 3 . 5 4 4 5 {0.04,'0.4)]}]], {í. O, 1,
1
Oul[59]=
18 I UnidlPracl.nb
I(x.x}=^x-|-
C(x.x)=2x2+|-Determine la trayectoria de la producción a lo largo del presente año, de tal fornia que se maximice el valor presente de los beneficios de la firma.-Asuma una tasa de descuento (p) es
igual a ^, y que la producción al final d e l año es x ( l ) = ^ .
máx V[xJ = j f ( I ( x , x ) - C ( x . x))e-^' d\.==¿(x-x^ -Ix^e-^-^' di
s.a x(0)=0
x ( i ) = i _ ;
in(6oi:= e q l 7 =: EulerEquatíons[(xM - x[tf - 2 x ' [ t f ) e~^-^^, x[i\, t\
ou„6o,= 0 . + s - ° - ^ ^ ( l - 2 x [ t ] ) - 2 . £ - ° - S f x ' [ t ] + 4<g-°-^^x"[t] ==0 ' i n ( 6 i i : = D S o l v e [ { e q l 7 , x'[0] O, x ' [ l ] == 0.5), x M ,
o u . , 6 i i = { { x [ t ] - ^ ( e-°-5^ ( - 0 . 6 4 3 6 0 8 + 0.5.(e°-^^ + 0.143608<e^;^^) in|ó2i:= S i m p l i f y [ % ] , :
^ 0,5 - 0 . 6 4 3 6 0 8 e-°-^V+0.'1436.08 ,<e':^.]
ini63i:= A n i m a t e [ s h o w [ p i o t [ 0 . 5 - 0.643608 <e~°-="^ + 0.143608 e',
[t, - 0 . 1 , 1.2), PlotRange { - 0 . 1 , 0.6)], G r a p M c s [ { R G B C o l o r [ 0 , 1, 0 ] ,
Disk[{2f, 0 . 5 - 0 . 6 4 3 6 0 8 +0.143608(2^}, {0.04, 0.04)]}]],, {/, O, 1, 0:01)
Oul[63)=
V
-Ejemplo 4. Los ingresos (B) de largo plazo de una firmia dependen del stock de capital de la siguiente forma
B(k)=50k-k 2
Para incrementar el stock de capital, la firma incurre en costos que dependen de manera cuadrática de la inversión realizada (I). Asumiendo que la depreciación es igual a cero, la inversión equivale a la variación del stock de capital (I=k), con lo cual la función de costos sería igual a;
C(k)-kVlOOk
De este modo, la función de beneficios queda determinada por;
•7r(k.k)=B-C-501^-k ^-k^-lOOk
A) Encuentre la senda del stock de capital que maximice el valor presente de los beneficios descontados a tasa de 10 porciento (p=0.1). Considere un stock inicial de capital de 10 unidades y un horizonte de planeación de 5 años en donde al final del periodo el stock de capital se haya duplicado.
20 I UnldlPracl.nb
ln(6bl: = Oiit|6:)lr
ln((,r,|:::
Otj||66)=
ln(li/¡:=
Outf67J=
ln(B8):=
s.a^^ k(0)=10 •: = T . : . ¡ , : . ^ , . - ' • k(5)=20: . - ... . ^\. ^.
B)" Realice el diagramade fase,=en el espacio, inversión-capital: (¡TK)-, a paitir; de.la-.ecuación de euler y mencionando que tipo de estabilidad presenta e interprete
Clear[/c] / .v!:: j • '
-e q l 8 = Eul-erEquat¡ons[(50/cM-/4'^]^-/c'M^-100/<:'M)-e-''-^^ k[f], t
0. + 4 0 . e-°-^ - 2 e-°-^ k [ t ] - 0.2 e""-^ k ' [ t ] + 2 e-°-^ k " [ t ] == O
DSolve[{eql8, k\0\r 10, A'[5] r z 20), /cM, /]
{{k[t] ^-0-9512491 10.0004 + 20. ^0-951249 1 ^ 0.000448383 ^2-0025t>
Simpíify[%]
{{k[t] ^ 20. - 10.0004^-°-95i249i^0.000448383c'-Q^'^sij
A i i i m a t e [ S h o w [ P l o t [ 2 0 - 10.0004 c^-0-95i249/ + 0,0 0 0.4^8383 ás^-^^^^^'^
{U - i , 6), PlotRange {O, 2 2 } ] , G r a p h i c s "
{ R G B C o I o r [ 0 , 1, 0 ] , Disk[{zf, 20 - 10.0004 (e-°-^=^'-^^'+ 0.0,00448383 Í?^-^
(0.15, 0.5}]}]], {i. O, 5, 0.01}"
.05125 C
> -y'
20
Oiil(fi81=
in(69i:= p l = ContourPlot[{0.1 i + k- 20, ¿ } j {i, - 5 , 15},
in(70):= p2 = ParametricPiot
{9.5129187 ^-o-95i249^ 0.000471363 e^-""^^'-^', 20 - 10.0004 Í,-0-951249/ ^ 0.000448383 «j^-''^^^^'),
R O, 5), PlotStyle {Tliickness[0.009L R G B C o l o r [ 0 , 0, 1 ] ] ] ;
in[7i):= p3 = VectorFielclPlof[{0.1 i + k- 20, /),
{/, - 5 , 15}, [k, 5, 2 5 ] , ScaleFunction - 4 (1 & ) , AspectRatio 1 ] ;
ln(72|:= ShO\v[pl, p2, p 3 ]
k
/ / / / / / I I
- ^ ^ / / / / í f l í t
^ - ^ / / / I í / / / / /
r / / / / / / / / / / /
Oull72)=
\
\ \
\
\
5 10 15
' " [ 7 3 1 : -
k[t_]
= 2 0 - 10.0004e-0-95]249.t^Q_QQQ44g333^].05i25toui|73)= 2 0 - 1 0 . 0 0 0 4 e " ° - ^ ^ ^ 2 ^ ^ + 0 . 0 0 0 4 4 8 3 8 3 e^-"^^^^ in[74]:=
Inv[tJ
= D [ 2 0 - 1 0 . 0 0 0 4 e-0-95í249t ^ 0 . 0 0 0 4 4 8 3 8 3 c^^-05i25t_ ^ oui(74i= 9 . 5 1 2 8 7 fí-0-3^^249t + 0 . 0 0 0 4 7 1 3 6 3 í2'-05'25tln[75]:= B[kJ = 5 0 R
-oui|75j= 5 0 k - R^
N 7 6 i : =
c[kj =
k2+ lOOk
ouii76j=lOOk + k^
ln(77i:= k[{l, 2, 3. 4, 5 } ]
oui[77]= {16.1385. 18.5117, 1 9 . 4 3 4 2 , 1 9 . 8 0 7 4 , 20.} '
ln[781:= B[%]
ou.[78]= {546.475, 5 8 2 . 9 0 1 , 5 9 4 . 0 2 2 , 5 9 8 . 0 3 7 , 600.}
in|79i:=
Inv[(l,
2, 3, 4, 5 } ]out|79)= {3.67577, 1.42314, 0 . 5 5 9 2 4 9 . 0 , 2 4 3 3 4 1 , 0 . 1 7 2 1 7 9 } ln|80]:= C [ % ]