Euler's Method in a Direction Field
Some Pictures
> | restart:with(DEtools): |
> | with(plots): |
Warning, the name changecoords has been redefined
> | DirField2:=dfieldplot(diff(y(x),x)=cos(x),y(x),x=0..2*Pi,y=-1.4..1.4,color=BLUE,arrows=MEDIUM,axes=BOXED): |
> | Soln2:=plot(sin(x),x=0..2*Pi,y=-1.4..1.4,color=red,thickness=2): |
> | Step1:=plot([0.7854*t,0.7854*t,t=0..1],color=green,thickness=2): |
> | Step2:=plot([0.7854+0.7854*t,0.7854+0.5554*t,t=0..1],color=magenta,thickness=2): |
> | Step3:=plot([1.5708+0.7854*t,1.3408+0*t,t=0..1],color=green,thickness=2): |
> | Step4:=plot([2.3562+0.7854*t,1.3408-0.5554*t,t=0..1],color=magenta,thickness=2): |
> | Step5:=plot([3.1416+0.7854*t,0.7854-0.7854*t,t=0..1],color=green,thickness=2): |
> | Step6:=plot([3.927+0.7854*t,0-0.5554*t,t=0..1],color=magenta,thickness=2): |
> | Step7:=plot([4.7124+0.7854*t,-0.5554+0*t,t=0..1],color=green,thickness=2): |
> | Step8:=plot([5.4978+0.7854*t,-0.5554+0.5554*t,t=0..1],color=magenta,thickness=2): |
> | display(DirField2,Soln2,Step1,Step2,Step3,Step4,Step5,Step6,Step7,Step8); |
> | DirField3:=dfieldplot(diff(y(x),x)=cos(x),y(x),x=0.7854..3.1416,y=0.78..1.4,color=BLUE,arrows=MEDIUM,axes=BOXED): |
> | display(DirField3,Step2,Step3,Step4); |
> | DirField4:=dfieldplot(diff(y(x),x)=cos(x),y(x),x=1.5708..2.3562,y=1.3..1.4,color=BLUE,arrows=MEDIUM,axes=BOXED): |
> | display(DirField4,Step3); |
> |