SHO

Clear["Global`*"]

T=(1/2)m1 (v1^2)+(1/2)m2 (v2^2);
T//Expand//Factor

V=(1/2)k (((x1-x2))^2);
V //Expand

D[T,v1]

D[T,v2]

D[-V,x1] //Expand

D[-V,x2] //Expand

Tmat={{m1,0},{0,m2}};
Tmat //MatrixForm

Vmat={{k,-k},{-k,k}};
Vmat //MatrixForm

rule={m1->m,m2->m};

mat= Vmat-Tmat ω2 /.rule;
mat//MatrixForm

sol=Solve[Det[mat] ==0,ω2]

eq1=mat .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol[[1]],{a,b}] //Last

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol[[2]],{a,b}]

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat.Transpose[eVecs] /.rule//Simplify //MatrixForm

Look at motion

mode1=ev1 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[1]]

mode2=ev2 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[2]]

values={k->1,m->1};

mode1  /.values

mode1 +{-1,1}

Plot[mode1 +{-1,1}/.values //Re,{t,0,10}]

Plot[mode2 +{-1,1}/.values //Re,{t,0,10}]

doPlot[a_:1/2]:=Plot[a (mode1 +{-1,1}/.values)+(1-a)(mode2 +{-1,1}/.values)
 //Re,{t,0,10}]

doPlot[1/2]

Normal Coordinates:

nRule={x1,x2}->Transpose[eVecs].{n1,n2}  //Thread

V

V /.rule /.nRule //Simplify

nRule2={v1,v2}->Transpose[eVecs].{nv1,nv2}  //Thread

Vmat2={{0,0},{0,2k}};
Vmat2 //MatrixForm

T

T /.rule /.nRule2 //Expand

Tmat2={{m,0},{0,m}};
Tmat2 //MatrixForm

mat2= Vmat2-Tmat2 ω2;
mat2//MatrixForm

sol2=Solve[Det[mat2] ==0,ω2]

eq1=mat2 .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol2[[1]],{a,b}] //Last

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol2[[2]],{a,b}]

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat2.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat2.Transpose[eVecs] //Simplify //MatrixForm

SHO
Repeat with m2→∞, or m1→0

Clear["Global`*"]

T=(1/2)m1 (v1^2)+(1/2)m2 (v2^2);
T//Expand//Factor

V=(1/2)k (((x1-x2))^2);
V //Expand

D[T,v1]

D[T,v2]

D[-V,x1] //Expand

D[-V,x2] //Expand

Tmat={{m1,0},{0,m2}};
Tmat //MatrixForm

Vmat={{k,-k},{-k,k}};
Vmat //MatrixForm

(* rule={m1->m,m2->m};  *)
rule={}

mat= Vmat-Tmat ω2 /.rule;
mat//MatrixForm

sol=Solve[Det[mat] ==0,ω2]

eq1=mat .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol[[1]],{a,b}] //Last

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol[[2]],{a,b}]  /.m1->0 //PowerExpand

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat.Transpose[eVecs] /.rule/.{m1->0}//Simplify //MatrixForm

Look at limits

ev2

sol

sol= Map[ Limit[#,m2->Infinity]& , sol,{3}]

Look at motion

mode1=ev1 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[1]]

mode2=ev2 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[2]]

values={k->1,m1->1};

mode1  /.values

mode1 +{-1,1}

Plot[mode1 +{-1,1}/.values //Re,{t,0,10}]

Plot[mode2 +{-1,1}/.values //Re,{t,0,10}]

doPlot[a_:1/2]:=Plot[a (mode1 +{-1,1}/.values)+(1-a)(mode2 +{-1,1}/.values)
 //Re,{t,0,10}]

doPlot[1]

doPlot[0]

doPlot[1/2]

doPlot[1/4]

Normal Coordinates:

nRule={x1,x2}->Transpose[eVecs].{n1,n2}  //Thread

V

V /.rule /.nRule //Simplify

nRule2={v1,v2}->Transpose[eVecs].{nv1,nv2}  //Thread

Vmat2={{0,0},{0,2k}};
Vmat2 //MatrixForm

T

T /.rule /.nRule2 //Expand

Tmat2={{m1,0},{0,m2}};
Tmat2 //MatrixForm

mat2= Vmat2-Tmat2 ω2;
mat2//MatrixForm

sol2=Solve[Det[mat2] ==0,ω2]

eq1=mat2 .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol2[[1]],{a,b}] //Last

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol2[[2]],{a,b}]

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat2.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat2.Transpose[eVecs] //Simplify //MatrixForm

Problem #Taylor: p418

Clear["Global`*"]

T=(1/2)m1 (v1^2)+(1/2)m2 (v2^2);
T//Expand//Factor

V=(1/2)k1 (x1^2)+(1/2)k2 (((x1-x2))^2)+(1/2)k3 (x2^2);
V //Expand //Factor

Tmat={{m1,0},{0,m2}};
Tmat //MatrixForm

Vmat={{k1+k2,-k2},{-k2,k2+k3}};

Vmat //MatrixForm

rule={m1->m,m2->m,k1->k,k2->k,k3->k};

Tmat=Tmat /.rule;
Tmat //MatrixForm

Vmat=Vmat /.rule;
Vmat //MatrixForm

mat= Vmat-Tmat ω2;
mat//MatrixForm

sol=Solve[Det[mat] ==0,ω2]

eq1=mat .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol[[1]],{a,b}] //Last

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol[[2]],{a,b}]

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat.Transpose[eVecs] //Simplify //MatrixForm

Look at motion

mode1=ev1 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[1]]

mode2=ev2 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[2]]

values={k->1,m->1};

mode1  /.values

mode1 +{-1,1}

Plot[mode1 +{-1,1}/.values //Re,{t,0,10}]

Plot[mode2 +{-1,1}/.values //Re,{t,0,10}]

doPlot[a_:1/2]:=Plot[a (mode1 +{-1,1}/.values)+(1-a)(mode2 +{-1,1}/.values)
 //Re,{t,0,10}]

doPlot[1]

doPlot[0]

doPlot[1/2]

doPlot[1/4]

Normal Coordinates:

nRule={x1,x2}->Transpose[eVecs].{n1,n2}  //Thread

V

V /.rule /.nRule //Simplify

nRule2={v1,v2}->Transpose[eVecs].{nv1,nv2}  //Thread

Vmat2={{k,0},{0,3k}};
Vmat2 //MatrixForm

T

T /.rule /.nRule2 //Expand

Tmat2={{m,0},{0,m}};
Tmat2 //MatrixForm

mat2= Vmat2-Tmat2 ω2;
mat2//MatrixForm

sol2=Solve[Det[mat2] ==0,ω2]

eq1=mat2 .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol2[[1]],{a,b}] //Last

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol2[[2]],{a,b}]

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat2.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat2.Transpose[eVecs] //Simplify //MatrixForm

Problem #Taylor: p418

Clear["Global`*"]

T=(1/2)(m1+m2) (L1^2)((dϕ1)^2)+(1/2)m2 (L2^2)((dϕ2)^2)+m2 L1 L2 dϕ1 dϕ2 ;
T//Expand//Factor

V=(1/2)(m1+m2) g L1 ((ϕ1)^2) +(1/2)m2 g L2 ((ϕ2)^2) ;
V //Expand //Factor

rules={m1->m,m2->m,L1->L,L2->L};

T /.rules //Factor

V /.rules //Factor

Tmat={{2,1},{1,1}};
Tmat //MatrixForm

Vmat={{2,0},{0,1}};

Vmat //MatrixForm

mat= Vmat-Tmat ω2;
mat//MatrixForm

sol=Solve[Det[mat] ==0,ω2]

eq1=mat .{a,b} ==0 //Thread

norm = a^2+b^2==1

eq2=Join[eq1,{norm}]

sol1=Solve[eq2 /.sol[[1]],{a,b}] //Last //FullSimplify

ev1={a,b} /.sol1

sol2=Solve[eq2 /.sol[[2]],{a,b}]  //FullSimplify

ev2={a,b} /.Last[sol2]

eVecs={ev1,ev2};
eVecs //MatrixForm

eVecs.Vmat.Transpose[eVecs] //Simplify //MatrixForm

eVecs.Tmat.Transpose[eVecs] //Simplify //MatrixForm

Look at motion

mode1=ev1 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[1]]

mode2=ev2 Exp[I ω t] /.{ω->Sqrt[ω2]} /.sol[[2]]

mode1

mode1 +{-1,1}

Plot[mode1 +{-1,1}//Re,{t,0,10}]

Plot[mode2 +{-1,1}//Re,{t,0,10}]

doPlot[a_:1/2]:=Plot[a (mode1 +{-1,1})+(1-a)(mode2 +{-1,1})
 //Re,{t,0,10}]

doPlot[1]

doPlot[0]

doPlot[1/2]

doPlot[1/4]