> restart:with(plots):with(DEtools):
> phase:=proc(f,r)
local a,b,bn,bs,U;
a:=op([1,1],plot(args));
bn:=-`-`(op([2,1..2],r));
bs:=[a[1,1],seq(`if`(
(a[i-1,2]-0.0001*bn*signum(a[i-1,2]))*(a[i,2]-0.0001*bn*signum(a[i,2]))<0, i="2..nops(a)),a[-1,1]];">abs(x[2,1])<0.04, i="`if`(a[1,2]<0,2,1)..nops(b)-1,2)," i="`if`(a[1,2]<0,1,2)..nops(b)-1,2)]);" width="0.02,head_length=" view="[b[1]..b[-1],-1..1],color=">[x,0],b[2..-2]),symbol=circle,symbolsize=19),
plots[textplot](map(x->[x/bn,-0.07,sprintf("%.2f",x)],bs[2..-2])),
axes=none)
end:
System Dinamik dengan a>0
> phase(0.5*x ,x=-2..2);
> DEplot(diff(x(t),t)=0.5*x(t) ,x(t),
t=0..10,[[x(0)=1],[x(0)=0.2],[x(0)=-1.1],[x(0)=-0.9]],x=-4..5,stepsize=.05,color=sin(t), linecolor=sin(t));
System Dinamik dengan a<0
> phase(-0.6*y,y=-2..2);
> DEplot(diff(x(t),t)=-0.6*x(t) ,x(t),
t=0..10,[[x(0)=5],[x(0)=0.2],[x(0)=-1.1],[x(0)=-5]],x=-4..5,stepsize=.05,color=sin(t), linecolor=sin(t));
Sistem dinamik persamaan logistik dengan a>0
> phase(y*(1-y),y=-1..2);
> DEplot(diff(x(t),t)=x(t)*(1-x(t)) ,x(t),
t=0..10,[[x(0)=5],[x(0)=0.2],[x(0)=1.1],[x(0)=-0.01]],x=-4..5,stepsize=.05,color=sin(t), linecolor=sin(t));
Sistem dinamik persamaan logistik dengan a <0
> phase(-0.5*y*(1-y),y=-2..2);
> DEplot(diff(x(t),t)=-0.5*x(t)*(1-x(t)) ,x(t),
t=0..10,[[x(0)=5],[x(0)=0.2],[x(0)=1.1],[x(0)=-1.1]],x=-2..4,stepsize=.05,color=sin(t), linecolor=sin(t));
Sistem dinamik persamaan Pemanenan dengan h < 1/4
> phase(x*(1-x)-0.2,x=-1..2);
> DEplot(diff(x(t),t)=x(t)*(1-x(t))-0.2 ,x(t),
t=0..10,[[x(0)=5],[x(0)=0.2],[x(0)=0.5],[x(0)=1.1]],x=-2..2,stepsize=.05,color=sin(t), linecolor=sin(t),);
Sistem dinamik persamaan Pemanenan dengan h = 1/4
> phase(y*(1-y)-0.25,y=-1..1);
> solve(y*(1-y)-0.25,y);
> DEplot(diff(x(t),t)=x(t)*(1-x(t))-1/4 ,x(t),
t=0..10,[[x(0)=1],[x(0)=0.40],[x(0)=0.5],[x(0)=1.1]],x=-1..2,stepsize=.05,color=sin(t), linecolor=sin(t));
Sistem dinamik persamaan Pemanenan dengan h > 1/4
> phase(y*(1-y)-0.27,y=-1..1);
> DEplot(diff(x(t),t)=x(t)*(1-x(t))-0.27 ,x(t),
t=0..20,[[x(0)=1],[x(0)=0.40],[x(0)=0.5],[x(0)=1.1]],x=-1..2,stepsize=.05,color=sin(t), linecolor=sin(t),arrows=LARGE);
Selasa, 14 Oktober 2008
Bahan Praktikum I Sistem Dinamik
Pada praktikum ini kita akan memperlihatkan sistem dinamik 1D. Visualisasi dari sistem dinamik tersebut diprogramkan dengan Maple sebagai berikut:
> restart:with(plots):
> phase:=proc(f,r)
local a,b,bn,bs,U;
a:=op([1,1],plot(args));
bn:=-`-`(op([2,1..2],r));
bs:=[a[1,1],seq(`if`(
(a[i-1,2]-0.0001*bn*signum(a[i-1,2]))*(a[i,2]-0.0001*bn*signum(a[i,2]))<0,
`if`(a[i-1,2]*a[i,2]<0, (a[i-1,1]*a[i,2]-a[i-1,2]*a[i,1])/(a[i,2]-a[i-1,2]),
fsolve(f,subsop([2,1]=a[i,2]-0.02*bn,[2,2]=a[i,2]+0.02*bn,r))),NULL),
i=2..nops(a)),a[-1,1]];
b:=bs/bn;
U:=remove(x->abs(x[2,1])<0.04,
[seq([[b[i]+0.01,0],[b[i+1]-b[i]-0.02,0]],i=`if`(a[1,2]<0,2,1)..nops(b)-1,2),
seq([[b[i+1]-0.01,0],[b[i]-b[i+1]+0.02,0]],i=`if`(a[1,2]<0,1,2)..nops(b)-1,2)]);
plots[display](plots[arrow](
U,width=0.02,head_length=0.04,view=[b[1]..b[-1],-1..1],color=blue),
plots[pointplot](map(x->[x,0],b[2..-2]),symbol=circle,symbolsize=19),
plots[textplot](map(x->[x/bn,-0.07,sprintf("%.2f",x)],bs[2..-2])),
axes=none)
end:
> phase(-x,x=-8..8);
Tugas diberikan pada saat praktikum.
> restart:with(plots):
> phase:=proc(f,r)
local a,b,bn,bs,U;
a:=op([1,1],plot(args));
bn:=-`-`(op([2,1..2],r));
bs:=[a[1,1],seq(`if`(
(a[i-1,2]-0.0001*bn*signum(a[i-1,2]))*(a[i,2]-0.0001*bn*signum(a[i,2]))<0,
`if`(a[i-1,2]*a[i,2]<0, (a[i-1,1]*a[i,2]-a[i-1,2]*a[i,1])/(a[i,2]-a[i-1,2]),
fsolve(f,subsop([2,1]=a[i,2]-0.02*bn,[2,2]=a[i,2]+0.02*bn,r))),NULL),
i=2..nops(a)),a[-1,1]];
b:=bs/bn;
U:=remove(x->abs(x[2,1])<0.04,
[seq([[b[i]+0.01,0],[b[i+1]-b[i]-0.02,0]],i=`if`(a[1,2]<0,2,1)..nops(b)-1,2),
seq([[b[i+1]-0.01,0],[b[i]-b[i+1]+0.02,0]],i=`if`(a[1,2]<0,1,2)..nops(b)-1,2)]);
plots[display](plots[arrow](
U,width=0.02,head_length=0.04,view=[b[1]..b[-1],-1..1],color=blue),
plots[pointplot](map(x->[x,0],b[2..-2]),symbol=circle,symbolsize=19),
plots[textplot](map(x->[x/bn,-0.07,sprintf("%.2f",x)],bs[2..-2])),
axes=none)
end:
> phase(-x,x=-8..8);
Tugas diberikan pada saat praktikum.
Minggu, 05 Oktober 2008
SELAMAT IDUL FITRI 1429 H
Langganan:
Postingan (Atom)