{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 "" {TEXT -1 95 "# In this demo, we are go ing to learn how to solve a system of homogeneous equations by maple. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "# Example 1. The first example will show how to solve the second order homogeneous equation y\" + y' + y =0: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "# Define the differential equ ation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "diffeq:=diff(y(t) ,t$2)+diff(y(t),t)+y(t)=0;" }{TEXT -1 0 "" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "# Use dsolve to solve the differential eq uation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "sol:=dsolve(\",y (t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 131 "# Observe that the solu tion is a linear combination of the two fundamental solutions. We set \+ _C1= 1 and _C2=0 to extract the first " }}{PARA 0 "" 0 "" {TEXT -1 91 "# fundamental solution. Then set _C1=0 and _C2=1 to extract the other fundemantal solution." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "y 1:=rhs(subs(\{_C2=0,_C1=1\},sol));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "y2:=rhs(subs(\{_C2=1,_C1=0\},sol));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 110 "# Exam ple 2. For higher order equations, dsolve is not adequate. We are now \+ going to solve y'''' + y' + y =0:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "# First define the forth order differential equation:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "diffeq:=diff(y(t),t$4)+diff( y(t),t)+y(t)=0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "sol:=dso lve(\",y(t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 134 "# The summation we got above is over all the complex roots of _Z^4 + _Z + 1 = 0. So, to get the fundamental set of real solutions, we" }}{PARA 0 "" 0 "" {TEXT -1 43 "# need to solve _Z^4 + _Z + 1 = 0 first." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "ev:=fsolve(r^4+r+1=0,r,complex);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "# Then substitute each of the co mplex root into e^(rt):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " Y1:=evalc(exp(ev[1]*t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Y2:=evalc(exp(ev[2]*t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Y3:=evalc(exp(ev[3]*t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Y4:=evalc(exp(ev[4]*t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 134 "# We then observe that Y1 and Y2, Y3 and Y4 form two conjugate pa irs. To obtain the fundamental set of real solutions, we may take the " }}{PARA 0 "" 0 "" {TEXT -1 34 "# linear combination of Y1 and Y2:" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "y1:=(Y1+Y2)/2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "y2:=(Y2-Y1)/(2*I);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "# Or we may use Re and Im to extract the \+ real and imaginary parts of a complex expression." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 18 "y3:=evalc(Re(Y3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "y4:=evalc(Im(Y4));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 93 "# y1, y2, y3 and y4 then form a fundamental set of real s olutions to our 4th order equation. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "1 0 0" 8 }{VIEWOPTS 1 1 0 1 1 1803 }