{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 }{PSTYLE " Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 128 0 128 1 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 11 0 128 128 1 2 1 2 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 13 "cuploscc.mws " }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 26 "coupled oscillator s 7/8/96" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 63 "This 'c' version will do two coupled oscillators between walls" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 "It also \+ teases out the normal modes (x2/x1 at each mode freq)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "restart: with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "L:= m1* v1^2/2 +m2 *v2^2/2- k1* x1^2 / 2 -kc*(x2-x1)^2/2-k1*x2^2/2 ;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 33 "d1:=diff(L,v1 ); d2:=diff(L,v2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "p1:=subs(v1=v1(t),d1); p2:=s ubs(v2=v2(t),d2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "First do the derivatives, then tell it you have a function of t." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "d1:=diff(p1,t)-di ff(L,x1)=0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 77 "Same thing for derivative with respect to x1. First the derivative wrt to x1," }}{PARA 0 "" 0 "" {TEXT -1 40 "then tell it th at x1 is a function of t." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 28 "d2:=diff(p2,t)-diff(L,x2)=0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "f1:=subs(x1=x1(t),x2=x2(t),v1(t)=di ff(x1(t),t),d1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "f2:=sub s(x1=x1(t),x2=x2(t),v2(t)=diff(x2(t),t),d2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "h1:=subs(v1(t)=diff(x1(t),t),f1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "h2:=subs(v1(t)=diff(x1(t),t),f2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "z:=lhs(h1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "Solve for the simple harmonic oscillator \+ equation." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "sol:=dsolve(\{h1,x1(0) =0,D(x1)(0)=1,h2,x2(0)=0,D(x2)(0)=0\},\{x1(t),x2(t)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "sb:=\{m1=1,m2=1,k1=1,kc=1/10\};" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "sol1:=subs(sb,sol);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "q1:=simplify(evalf(rhs(sol1[ 1])));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "q2:=simplify(eval f(rhs(sol1[2])));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "plot( \{q1,q2\},t=0..50,title=`coupled oscillators`);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 44 "hx:=subs(diff(x1(t),t,t)=-omega^2*x1(t),h1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "x21:=solve(hx,x2(t));" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "hy:=subs(diff(x2(t),t,t)=-o mega^2*x2(t),h2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "x22:=s olve(hy,x2(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "eqn2:= r *x1(t) = x22;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "ratio1:=so lve(eqn2,r);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "This puts us in p osition to substitute frequencies and find the mode configurations!" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "so lfreq:=solve(x22=x21,omega);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "frq1:=solfreq[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " frq2:=solfreq[3];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "omega1 :=evalf(subs(sb,frq1));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " omega2:=evalf(subs(sb,frq2));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "mode2x2_over_x1:=subs(sb,omega=omega2,ratio1);" }}}{EXCHG {PARA 0 "" 0 "" {MPLTEXT 0 21 116 "In mode 2, the masses move together, and \+ the center spring is not compressed or expanded. The amplitude ratio i s 1:1" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "mode1x2_over_x1:=s ubs(sb,omega=omega1,ratio1);" }}}{EXCHG {PARA 0 "" 0 "" {MPLTEXT 0 21 128 "In mode 1, the masses move oppositely, compressing the spring, an d operating at a higher frequency. The amplitude ratio is -1:1." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "The 'tran sfer time' from one oscillator to the other should be argued from " }} {PARA 0 "" 0 "" {TEXT -1 109 "'beats', where the plot looks just the s ame. Want 1/4 of the 'period' of the difference frequency, (f1-f2)/2 " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "Mario n problem 12-5, different masses, same k" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "solm:=solve((-m*x+2* k)*(-M*x+2*k) = k^2,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " A_B_ratio:=(-m*x+2*k)/k;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "rat1:=subs(x=solm[1],A_B_ratio);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rs:=simplify(rat1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "subs(M=10*m,rs);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "37 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }