| > | with(plots):with(DEtools): |
Warning, the name changecoords has been redefined
Lakeflow
| > | de:=diff(q(t),t)=-1/2*q(t)+10+5*sin(2*t); |
| > | fplot:=dfieldplot(de,q(t),t=0..15,q=0..30,arrows=SLIM):display(fplot); |
![[Plot]](images/lecture2_2.gif)
| > | sol:=dsolve({de,q(0)=0},numeric,range=0..15); |
| > | display(fplot,odeplot(sol,color=blue,thickness=4)); |
![[Plot]](images/lecture2_4.gif)
| > |
Logistic Equation
| > | de:=diff(y(t),t)=r*(1-y(t)/K)*y(t); |
| > | r:=1/2;K:=3; |
| > | fplot:=dfieldplot(de,y(t),t=0..12,y=0..5,arrows=SLIM):display(fplot); |
![[Plot]](images/lecture2_8.gif)
| > | lines:=[]:vals:=0.1,0.2,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,10,100: |
| > | for i in vals do |
| > | sol:=dsolve({de,y(0)=i},numeric,range=0..12): |
| > | myline:=odeplot(sol,color=blue,thickness=2): |
| > | lines:=[op(lines),myline]: |
| > | end do: |
| > | display(lines,fplot); |
![[Plot]](images/lecture2_9.gif)