{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "#This procedure uses the numerical method to solve the differential equation in #demo2.mws . " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "# We firist define the initial val ued problem:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "diffeq:=dif f(y(x),x)=x+sin(y(x));" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "inits:=y(0)=1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "# Then we use dsolve, but include the option \"numeric\":" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "sol:=dsolve(\{diffeq, inits \}, y(x), numeric);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "# The appr oximation value of the solution at x=1:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "sol(1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "#If yo u want to have a picture of the solution, then do:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "with(plots):odeplot(sol,[x,y(x)],-1..1);" } {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "11 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }