ASPETE (School of Pedagogical and Technological Education)
Course: Pedagogical Applications of Computers
Electronic worksheet on Oscillation synthesis 
Teacher: Dr Korres Konstantinos
Student/Students:

HYPOTHESES SPACE

ACTIVITY ON OSCILLATIONS

A body is performing a simple harmonic oscillation x(t) = A sin(w t), with width A = 10 cm and frequency w = (π/2). 
a) Calculate the position of the body 1, 2 and 3 sec from the starting time point the oscillation (the starting position regarded as 0).
b) Create the table of positions for the time points t = 0, (1/3), (2/3), 1, (4/3), (5/3),2, (7/3), (8/3), 3, (10/3), (11/3),4sec
c) Plot the graph of the position of the body in the time interval [0, T sec] where T = the smallest period.    

Note: In order to define any function or run any program or command in Mathematica, press SHIFT + ENTER or ENTER in the Num Pad.

x[t_] := A*Sin[w*t]
A = 10
w = Pi/2

a) In order to calculate the body's position for t = 1 sec, t = 2 sec and t = 3 sec we are calculating the values of the function x(t) for t = 1, t = 2 and t = 3.

x[1]

x[2]

x[3]

b) In order to create the table of positions for the time points t =0, (1/3), (2/3), 1, (4/3), (5/3),2, (7/3), (8/3), 3, (10/3), (11/3),4 sec we are using the command Table[ {t, x [t] }, {t, 0, 4, 1/3} ]

TableForm[Table[{t, x[t]}, {t, 0, 4, 1/3}], 
      TableHeadings -> {None, {"t", "x(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

c) In order to plot the graph of positions for the time interval [0, T sec], firsty we are calculating T = ((2  π)/w)

T = 2*Pi/w

c1) EITHER we are ploting the points (t, x(t) ) for t =0, (1/3), (2/3), 1, (4/3), (5/3),2, (7/3), (8/3), 3, (10/3), (11/3),4 sec  from the former table using the command ListPlot[Table[ {t, x [t] }, {t, 0, 4, 1/3} ] ]

ListPlot[Table[{t, x[t]}, {t, 0, 2*Pi/w, 1/3}], AspectRatio -> 1, 
      Ticks -> {Range[0, 2*Pi/w, 1/3], Range[-A, A, 1]}, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

Taking more points ListPlot[Table[ {t, x [t] }, {t, 0, 4, 0.1} ] ]   or ListPlot[Table[ {t, x [t] }, {t, 0, 4, 0.01} ] ]

ListPlot[Table[{t, x[t]}, {t, 0, 4, 0.1}], AspectRatio -> 1, 
      Ticks -> {Range[0, 2*Pi/w, 1/3], Range[-A, A, 1]}, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

ListPlot[Table[{t, x[t]}, {t, 0, 4, 0.01}], AspectRatio -> 1, 
      Ticks -> {Range[0, 2*Pi/w, 1/3], Range[-A, A, 1]}, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

c2) OR we are ploting the graph of the function x(t) for t ∈[0, 4] with the command Plot[x [t], {t, 0, 4} ] ]

Plot[{x[t]}, {t, 0, 2*Pi/w}, AspectRatio -> 1, 
      Ticks -> {Range[0, 2*Pi/w, 1/3], Range[-A, A, 1]}, 
      PlotStyle -> {{RGBColor[1, 0, 0], Thickness[0.01]}}, 
      AxesLabel -> {"t", "x(t)"}]

EXERCISE:
Using the commands and programs presented above, study the following oscillation: 
A body is performing a simple harmonic oscillation, with width A = 5 cm and frequency w = (π/4). 
a) Calculate the position of the body 1, 3 and 7 sec from the starting time point the oscillation (the starting position regarded as 0).
b) Create the table of positions for the time points t = 0, (T/4), (T/2), ((3  T)/4), T, ((5  T)/4), ((3  T)/2), ((7  T)/4), 2T sec, where T = the smallest period.    
c) Plot the graph of the position of the body in the time interval [0, 2T sec] .

SETTING THE PROBLEM (OSCILLATION SYNTHESIS)

A body's movement when it is performing a simple harmonic oscillation while the basis on which it moves is also performing a simple harmonic oscillation, is called composite oscillation and its study is called oscillation synthesis.
The basis' oscillation is not neccesarily performed in the body's oscillation direction. The body's movement is generally complex. The direction, the frequency, the width and its phase depend on the relevant characteristics of the individual oscillations.

Let us define the two oscillations:
x1(t) = A1 sin(w1 t)
x2(t) = A2 sin(w2 t + f)
where A1, A2 are the widths of the oscillations respectively, w1, w2 are the frequencies of the oscillations and f is the difference in the phase of the two oscillations.  

Note: In order to define any function or run any program or command in Mathematica, press SHIFT + ENTER or ENTER in the Num Pad.

x1[t_] := A1*Sin[w1*t]
x2[t_] := A2*Sin[w2*t + f]

SETTING THE HYPOTHESES , THE VARIABLES' VALUES AND THE RELATIONS BETWEEN VARIABLES (1st PROBLEM: DIFFERENT WIDTHS, SAME FREQUENCIES)

HYPOTHESIS: 
The two oscillations have the SAME direction, the SAME frequencies, take place around the SAME point, DO NOT HAVE DIFFERENCE in their phases,
BUT have DIFFERENT widths.

x1[t_] := A1*Sin[w1*t]
x2[t_] := A2*Sin[w2*t + f]
f = 0;
w1 = w2;

SETTING THE VARIABLES' VALUES: 
SET values for the oscillations' widths and frequencies: (EACH ONE of you can set the values he / she prefers)

w1 = w2 = Pi/2

A1=5

A2 = 8

SETTING THE HYPOTHESES , THE VARIABLES' VALUES AND THE RELATIONS BETWEEN VARIABLES (2nd PROBLEM: SAME WIDTHS, DIFFERENT FREQUENCIES)

HYPOTHESIS: 
The two oscillations have the SAME direction, the SAME width, take place around the SAME point, DO NOT HAVE DIFFERENCE in their phases,
BUT have DIFFERENT frequencies.

x1[t_] := A1*Sin[w1*t]
x2[t_] := A2*Sin[w2*t + f]
f = 0;
A1 = A2;

SETTING THE VARIABLES' VALUES: 
SET values for the oscillations' widths and frequencies: (EACH ONE of you can set the values he / she prefers)

A1 = A2 = 20

w1 = Pi/3

w2 = Pi/4

EXPERIMENTS' SPACE

ACTIVITY ON OSCILLATIONS' SYNTHESIS (EXPERIMENTAL SOLUTION) (1st PROBLEM: DIFFERENT WIDTHS, SAME FREQUENCIES)

The position of the body that performs the composite oscillation can be calculated as:
x(t) = x1(t) + x2(t)

x[t_] := x1[t] + x2[t]

1) Firsty we are calculating the periods of the two oscillations T1 = ((2  π)/w1), T2 = ((2  π)/w2)

T1 = N[2*Pi/w1]
T2 = N[2*Pi/w2]

2) We are calculating the values of x1(t), t = 0 (0.5) T1+T2 and we are plotting the corresponding points (t, x1(t)), t = 0 (0.5) T1+T2

TableForm[Table[{t, N[x1[t]]}, {t, 0, T1 + T2, 0.5}], 
      TableHeadings -> {None, {"t", "x1(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

ListPlot[Table[{t, N[x1[t]]}, {t, 0, T1 + T2, 0.5}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x1(t)"}]

3) We are calculating the values of x2(t), t = 0 (0.5) T1+T2 and we are plotting the corresponding points (t, x2(t)), t = 0 (0.5) T1+T2

TableForm[Table[{t, N[x2[t]]}, {t, 0, T1 + T2, 0.5}], 
      TableHeadings -> {None, {"t", "x2(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

ListPlot[Table[{t, N[x2[t]]}, {t, 0, T1 + T2, 0.5}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x2(t)"}]

4) We are calculating the values of x(t), t = 0 (0.5) T1+T2 and we are plotting the corresponding points (t, x(t)), t = 0 (0.5) T1+T2

TableForm[Table[{t, N[x[t]]}, {t, 0, T1 + T2, 0.5}], 
      TableHeadings -> {None, {"t", "x(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

ListPlot[Table[{t, N[x[t]]}, {t, 0, T1 + T2, 0.5}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

5) We are plotting the points (t, x(t)), t = 0 (0.1) 4(T1+T2)

ListPlot[Table[{t, N[x[t]]}, {t, 0, 4*(T1 + T2), 0.1}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

6) We are plotting the points (t, x(t)), (t, x1(t)) and (t, x2(t))    for t ∈ [0, T1+T2]

Plot[{x[t], x1[t], x2[t]}, {t, 0, T1 + T2}, AspectRatio -> 1, 
      PlotStyle -> {{RGBColor[1, 0, 0], 
            Thickness[0.01]}, {RGBColor[0, 1, 0], 
            Thickness[0.01]}, {RGBColor[0, 0, 1], Thickness[0.01]}}, 
      AxesLabel -> {"t", "x(t), x1(t), x2(t)"}]

Questions:
1) a)  Does the composite oscillation have constant frequency?


b) What is / are the value / s of the frequency?

2) a)  Does the composite oscillation have constant width?


b) What is / are the value / s of the width?

3)  Does the composite oscillation have constant period?


b) What is / are the value / s of the period?

EXERCISE:
Using the commands and programs presented above, study the same problem for another set of frequencies w1 = w2 and widths A1, A2. 
Are the results on the former three questions similar?

ACTIVITY ON OSCILLATIONS' SYNTHESIS (EXPERIMENTAL SOLUTION) (2nd PROBLEM: SAME WIDTHS, DIFFERENT FREQUENCIES)

The position of the body that performs the composite oscillation can be calculated as:
x(t) = x1(t) + x2(t)

x[t_] := x1[t] + x2[t]

1) Firsty we are calculating the periods of the two oscillations T1 = ((2  π)/w1), T2 = ((2  π)/w2)

T1 = N[2*Pi/w1]
T2 = N[2*Pi/w2]

2) We are calculating the values of x(t), t = 0 (0.2) T1+T2 and we are plotting the corresponding points (t, x(t)), t = 0 (0.2) T1+T2

TableForm[Table[{t, N[x[t]]}, {t, 0, T1 + T2, 0.2}], 
      TableHeadings -> {None, {"t", "x(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

ListPlot[Table[{t, N[x[t]]}, {t, 0, T1 + T2, 0.2}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

3) We are plotting the points (t, x(t)), t = 0 (0.1) 6(T1+T2)

ListPlot[Table[{t, N[x[t]]}, {t, 0, 6*(T1 + T2), 0.1}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "x(t)"}]

4) We are plotting the points (t, x(t)), (t, x1(t)) and (t, x2(t))    for t ∈ [0, T1+T2]

Plot[{x[t], x1[t], x2[t]}, {t, 0, T1 + T2}, AspectRatio -> 1, 
      PlotStyle -> {{RGBColor[1, 0, 0], 
            Thickness[0.015]}, {RGBColor[0, 1, 0], 
            Thickness[0.015]}, {RGBColor[0, 0, 1], Thickness[0.015]}}, 
      AxesLabel -> {"t", "x(t), x1(t), x2(t)"}]

Questions:
1) a)  Does the composite oscillation have constant frequency?


b) What is / are the value / s of the frequency?

2) a)  Does the composite oscillation have constant width?


b) What is / are the value / s of the width?

3)  Does the composite oscillation have constant period?


b) What is / are the value / s of the period?

EXERCISE:
Using the commands and programs presented above, study the same problem for another set of values of widths A1 = A2 and frequencies w1, w2. 
Are the results on the former three questions similar?

PREDICTIONS' SPACE

ACTIVITY ON OSCILLATION SYNTHESIS (ANALYTICAL SOLUTION) (2nd PROBLEM: SAME WIDTHS, DIFFERENT FREQUENCIES)

We are studying the synthesis of the two oscillations:  x1(t) = A1 sin(w1 t),  x2(t) = A2 sin(w2 t + f), f = 0, A1 = A2 = A.
The posistion of the body that performs the composite oscillation can be calculated as: x(t) = x1(t) + x2(t)

1) We can observe that analytically:
y(t) = x1(t) + x2(t) = A sin(w1 t) + A sin(w2 t) = A  ( sin(w1 t) + sin(w2 t) ) =  2 A cos ((w1  -  w2)/2) t sin ((w1  +  w2)/2) t 
If the two frequencies slightly differ, the factor  A' = 2 A cos ((w1  -  w2)/2) t changes in a slower pace than sin ((w1  +  w2)/2) t that changes with frequency w' = ((w1  +  w2)/2).
That means that  y(t) = A' sin (w' t), where w' = ((w1  +  w2)/2) and A' = 2 A cos ((w1  -  w2)/2) t .

A = A1
y[t_] := 2*A*Cos[((w1 - w2)/2)*t]*Sin[((w1 + w2)/2)*t]

2) We are calculating the values of y(t), t = 0 (0.2) T1+T2 and we are plotting the corresponding points (t, x(t)), t = 0 (0.2) T1+T2

TableForm[Table[{t, N[y[t]]}, {t, 0, T1 + T2, 0.2}], 
      TableHeadings -> {None, {"t", "y(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

ListPlot[Table[{t, N[y[t]]}, {t, 0, T1 + T2, 0.2}], 
      AspectRatio -> 1, 
      PlotStyle -> {AbsolutePointSize[5], RGBColor[1, 0, 0]}, 
      AxesLabel -> {"t", "y(t)"}]

CREDIBILITY OF THE RESULTS (2nd PROBLEM: SAME WIDTHS, DIFFERENT FREQUENCIES)

We have studied both the experimental  x(t) and the analytical y(t) solutions of the oscillation synthesis.
We are forming the table of the difference x(t) - y(t), for t = 0 (0.2) T1+T2.

TableForm[Table[{t, N[x[t] - y[t]]}, {t, 0, T1 + T2, 0.2}], 
      TableHeadings -> {None, {"t", "x[t]-y(t)"}}, 
      TableAlignments -> Center, TableDirections -> Row]

Questions:
1) Does the analytical solution of the composite oscillation differ from the experimental solution?

2) If there are differences between the analytical and the experimental solution of the composite oscillation, where do you think they can be  attributed?

EXERCISE:
Using the commands and programs presented above, study the same problem for another set of values A1 = A2 and frequencies w1, w2. 
Are the results on the former two questions similar?