0% found this document useful (0 votes)
53 views5 pages

0.01 n2 Cos (π t) + 0.0031831 n1 Sin (π t) 0.01 n1 Cos (π t) - 0.0314159 n2 Sin (π t)

The document defines variables and equations to model an oscillating system and plots the position (x) and momentum (p) at different times. Variables are defined for constants like pi, mass, and timestep. Equations are given for angular frequency, position as a function of time, and momentum. Plots of x vs p are generated at 8 times to show the oscillation over time.

Uploaded by

am
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views5 pages

0.01 n2 Cos (π t) + 0.0031831 n1 Sin (π t) 0.01 n1 Cos (π t) - 0.0314159 n2 Sin (π t)

The document defines variables and equations to model an oscillating system and plots the position (x) and momentum (p) at different times. Variables are defined for constants like pi, mass, and timestep. Equations are given for angular frequency, position as a function of time, and momentum. Plots of x vs p are generated at 8 times to show the oscillation over time.

Uploaded by

am
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

In[11]:=

k = Pi ^ 2;
m = 1;
dp = 0.01;
dx = 0.01;
p0 = dp * n1;
x0 = dx * n2;
= Sqrt[k / m];
x = x0 * Cos[ * t] + 1 Sqrt[m * k] * p0 * Sin[ * t]
p = m * D[x, t]

Out[18]=

0.01 n2 Cos[ t] + 0.0031831 n1 Sin[ t]

Out[19]=

0.01 n1 Cos[ t] - 0.0314159 n2 Sin[ t]

In[66]:=

plot1 = ListPlot[Table[{x, p}, {n1, 50}, {n2, 50}] /. {t 0},


PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5];
plot2 = ListPlotTable[{x, p}, {n1, 50}, {n2, 50}] /. t 1 4,
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5;
plot3 = ListPlotTable[{x, p}, {n1, 50}, {n2, 50}] /. t 1 2,
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5;
plot4 = ListPlotTable[{x, p}, {n1, 50}, {n2, 50}] /. t 3 4,
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5;
plot5 = ListPlot[Table[{x, p}, {n1, 50}, {n2, 50}] /. {t 1},
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5];
plot6 = ListPlotTable[{x, p}, {n1, 50}, {n2, 50}] /. t 1 + 1 4,
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5;
plot7 = ListPlotTable[{x, p}, {n1, 50}, {n2, 50}] /. t 1 + 1 2,
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5;
plot8 = ListPlotTable[{x, p}, {n1, 50}, {n2, 50}] /. t 1 + 3 4,
PlotRange {{- 0.6, 0.6}, {- 1.5, 1.5}}, PlotStyle Blue, AspectRatio 1.5;
In[82]:=

GraphicsGrid[{{plot1, plot2}}, ImageSize Large]


GraphicsGrid[{{plot3, plot4}}, ImageSize Large]
GraphicsGrid[{{plot5, plot6}}, ImageSize Large]
GraphicsGrid[{{plot7, plot8}}, ImageSize Large]

blatt39c.nb

1.5

1.5

1.0

1.0

0.5

0.5

Out[82]=

-0.6

-0.4

0.2

-0.2

0.4

0.6

-0.6

-0.4

0.2

-0.2

-0.5

-0.5

-1.0

-1.0

-1.5

-1.5

0.4

0.6

blatt39c.nb

1.5

1.5

1.0

1.0

0.5

0.5

Out[83]=

-0.6

-0.4

0.2

-0.2

0.4

0.6

-0.6

-0.4

0.2

-0.2

-0.5

-0.5

-1.0

-1.0

-1.5

-1.5

0.4

0.6

blatt39c.nb

1.5

1.5

1.0

1.0

0.5

0.5

Out[84]=

-0.6

-0.4

0.2

-0.2

0.4

0.6

-0.6

-0.4

0.2

-0.2

-0.5

-0.5

-1.0

-1.0

-1.5

-1.5

0.4

0.6

blatt39c.nb

1.5

1.5

1.0

1.0

0.5

0.5

Out[85]=

-0.6

-0.4

0.2

-0.2

0.4

0.6

-0.6

-0.4

0.2

-0.2

-0.5

-0.5

-1.0

-1.0

-1.5

-1.5

0.4

0.6

You might also like