Valovanje na struni

Animacija stoječega valovanja na vpeti struni.

L=1;

Manipulate[
Animate[a1=If[osnovna,Plot[Sin[(Pi/L)*x]*Cos[c*(Pi/L)*t],{x,0,L},PlotStyle->{Blue}],Graphics[]];
a2=If[osnovna2,Plot[Sin[2*(Pi/L)*x]*Cos[2*c*(Pi/L)*t],{x,0,L},PlotStyle->{Green}],Graphics[]];
a3=If[osnovna3,Plot[Sin[3*(Pi/L)*x]*Cos[3*c*(Pi/L)*t],{x,0,L},PlotStyle->{Red}],Graphics[]];
Show[Plot[0,{x,0,L}],a1,a2,a3,PlotRange->{{-0.1,1.1},{-1.5,1.5}},AxesStyle->Arrowheads[{0.04}]],
{{t,0,"Čas (t)"},0,100,AnimationRate->1,AnimationRunning->False}],
{{osnovna,True,"Osnovna frekvenca"},{True,False}},
{{osnovna2,False,"2*Osnovna frekvenca"},{True,False}},
{{osnovna3,False,"3*Osnovna frekvenca"},{True,False}},
{{c,0.5,"Hitrost valovanja"},Table[j*0.1,{j,1,10}]}
]

Animacija  potujočega vala na vpeti struni.

f[x_]=If[Abs[x-10]>1,0,1-Abs[10-x]];

liharazsiritev[x_]=If[x>0,f[x-Floor[x,20]],-f[-x-Floor[-x,20]]];

periodicnaliha[x_]=liharazsiritev[x-Floor[x+20,40]];

Manipulate[
Animate[Plot[1/2(periodicnaliha[x-c*t]+periodicnaliha[x+c*t]),{x,0,20},PlotRange->{-2,2},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]],{{t,0,"Čas (t)"},0,100,AnimationRate->1,AnimationRunning->False}],
{{c,3,"Hitrost valovanja"},Table[j,{j,1,5}]}
]

Animacija valovanja na vpeti struni pri začetnem pogoju f(x)=(sin^2)(x).

f[x_]:=Sin[x]^2

liharazsiritev[x_]=If[x>0,f[x-Floor[x,Pi]],-f[-x-Floor[-x,Pi]]];

periodicnaliha[x_]=liharazsiritev[x-Floor[x+Pi,2Pi]];

c=1;

g[x_,t_]=1/2(periodicnaliha[x-c*t]+periodicnaliha[x+c*t]);

Animate[Plot[g[x,t],{x,0,Pi},PlotRange->{-1.5,1.5},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]],{{t,0,"Čas (t)"},0,100,AnimationRate->1,AnimationRunning->False}]

Animacija valovanja na vpeti struni pri začetnem pogoju f(x) = |x - 1| - 1.

f[x_]=Abs[x-1]-1;

liharazsiritev[x_]=If[x>0,f[x-Floor[x,2]],-f[-x-Floor[-x,2]]];

periodicnaliha[x_]=liharazsiritev[x-Floor[x+2,4]];

c=1;

g[x_,t_]=1/2(periodicnaliha[x-c*t]+periodicnaliha[x+c*t]);

Animate[Plot[g[x,t],{x,0,2},PlotRange->{-1.2,1.2},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]],{{t,0,"Čas (t)"},0,100,AnimationRate->1,AnimationRunning->False}]

Animacija stoječega valovanja na struni, ki je na desnem koncu prosta.

L=1;

Manipulate[
Animate[a1=If[osnovna,Plot[Sin[1/2(Pi/L)*x]*Cos[1/2c*(Pi/L)*t],{x,0,L},PlotStyle->{Blue}],Graphics[]];
a2=If[osnovna2,Plot[Sin[3/2*(Pi/L)*x]*Cos[3/2*c*(Pi/L)*t],{x,0,L},PlotStyle->{Green}],Graphics[]];
a3=If[osnovna3,Plot[Sin[5/2*(Pi/L)*x]*Cos[5/2*c*(Pi/L)*t],{x,0,L},PlotStyle->{Red}],Graphics[]];
Show[Plot[0,{x,0,L}],a1,a2,a3,PlotRange->{{-0.1,1.1},{-1.5,1.5}},AxesStyle->Arrowheads[{0.04}]],
{{t,0,"Čas (t)"},0,100,AnimationRate->1,AnimationRunning->False}],
{{osnovna,True,"Osnovna frekvenca"},{True,False}},
{{osnovna2,False,"2*Osnovna frekvenca"},{True,False}},
{{osnovna3,False,"3*Osnovna frekvenca"},{True,False}},
{{c,0.5,"Hitrost valovanja"},Table[j*0.1,{j,1,10}]}
]

Animacija  potujočega vala na struni, ki je v desnem krajišču prosta.

f[x_]=If[Abs[x-10]>1,0,1-Abs[10-x]];

g[x_]=If[Abs[x-30]>1,0,1-Abs[30-x]];

h[x_]=If[x<20,f[x],g[x]];

Plot[h[x],{x,0,40}];

liharazsiritev[x_]=If[x>0,h[x-Floor[x,40]],-h[-x-Floor[-x,40]]];

periodicnaliha[x_]=liharazsiritev[x-Floor[x+40,80]];

Manipulate[
Animate[Plot[1/2(periodicnaliha[x-c*t]+periodicnaliha[x+c*t]),{x,0,20},PlotRange->{-2,2},PlotStyle->Blue,AxesStyle->Arrowheads[{0.04}]],{{t,0,"Čas (t)"},0,100,AnimationRate->1,AnimationRunning->False}],
{{c,3,"Hitrost valovanja"},Table[j,{j,1,5}]}
]