Superposition of Standing Waves

Manipulate[
coeff={c1,c2,c3,c4,c5,c6,c7,c8,c9,c10};
fun[xp_,tp_]=Sum[coeff[[j]] Cos[j π tp] Sin[j π xp],{j,10}];

Plot[fun[x,t],{x,0,1},PlotStyle->{Thickness[0.007],Red},Frame->True,FrameLabel->{Style["x",16,Italic],Style[Row[{"ψ(",Style["x",Italic],","Style["t",Italic],")"}],16]},
AspectRatio->.75,PlotRange->{{0,1},{-1.2,1.2}},FrameTicks->{{None,{-0.5,0.5}},{{0,.5,1},None}},FrameTicksStyle->Directive[Gray,16],ImageSize->{400,300},PerformanceGoal->"Quality"],

Style["coefficients",Bold],
{{c1,0,"(Subscript[c, 1])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c2,0,"(Subscript[c, 2])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c3,0,"(Subscript[c, 3])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c4,0,"(Subscript[c, 4])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c5,0,"(Subscript[c, 5])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c6,0,"(Subscript[c, 6])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c7,0,"(Subscript[c, 7])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c8,0,"(Subscript[c, 8])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c9,0,"(Subscript[c, 9])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{c10,0,"(Subscript[c, 10])"},0,.3,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
{{t,0.,"time"},0.,5.,.01,ImageSize->Tiny},

TrackedSymbols->True,ControlPlacement->Left,SaveDefinitions->True,
AutorunSequencing->{1,3,5,7,9}]

CAPTION

This Demonstration shows a linear superposition of 10 standing waves, of the form ψ(x,t)=(∑_(n=1)^10)(Subscript[c, n])cos(n π (Subscript[ω, 0])t)sin(((n π x)/L)) . The box is of unit length and each standing wave has its endpoints fixed at x=0 and x=L. The coefficients (Subscript[c, 1]), (Subscript[c, 2]), … , (Subscript[c, 10]) can be selected.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Superposition of Standing Waves" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/SuperpositionOfStandingWaves/

Contributed by: Porscha McRobbie and Eitan Geva

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »