sine

Posted by doug
summary: 

The 3 complex planes in a quaternion can be tuned to different frequencies and amplitudes.

description: 

The simple harmonic oscillator is in yellow, its velocity in blue, and acceleration in red. The scalar value for the a low velocity system is equal to one while the scalar acceleration is zero. The differences between both frequencies and amplitudes change the relative lengths of the blue and red lines, velocity and acceleration respectively. In this example, the frequency decreases while the amplitude increase going from x to y to z.

command: 
q_graph -out sho-xyz_and_v_and_a -dir sho -box 10 -command 't_function -mqs 2 -mqs 1 -t_function polynomial -t_function one -x_function cos -x_function polynomial -y_function cos -y_function polynomial -z_function cos -z_function polynomial 1 2 1 2 1 3 2 1 0 1 6 8 -shift "-11 5 0 0" -pi 8 -n_steps 1600' -color yellow -command 't_function -mqs 2 -mqs 1 -t_function one -t_function one -x_function sin -x_function polynomial -y_function sin -y_function polynomial -z_function sin -z_function polynomial -shift "0 5 0 0" -pi 8 -n_steps 1600 -- 1 2 1 2 1 3 2 1 0 -2 -6 -4' -color blue -command 't_function -mqs 2 -mqs 1 -t_function zero -t_function zero -x_function cos -x_function polynomial -y_function cos -y_function polynomial -z_function cos -z_function polynomial -shift "0 5 0 0" -pi 8 -n_steps 1600 -- 1 2 1 2 1 3 2 1 0 -4 -6 -2' -color red
math
equation: 

(t, x, y, z) = (t, cos(2 t + 3), 6 cos(t + 2), 8 cos(t/2 + 1))
(\gamma, \gamma \beta_x, \gamma \beta_y, \gamma \beta_z) = (1, -2 sin(2 t + 3), -6 sin(t + 2), -4 sin(t/2 + 1))
(a_t, a_x, a_y, a_z) = (0, -4 cos(2 t + 3), -6 cos(t + 2), -2 cos(t/2 + 1))

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
sine
cosine
Programming Tag: 
command line quaternions
t_function
Tags:
Posted by doug
summary: 

The first term of the 4-acceleration is frozen at 0, an observations whose implications I do not understand.

description: 

The oscillator is in yellow, its first time derivative in blue, and second time derivative in red. I understand why the velocity has a fixed scalar value equal to 1, that is what gamma is for low velocities. Acceleration in special relativity must be handled with care. The math is easy: tack the derivative of a constant, and zero will result. The implications of that math are not clear to me.

command: 
q_graph -out sho-x_and_v_and_a -dir sho -box 10 -command 't_function -mqs 2 -mqs 1 -t_function polynomial -t_function one -x_function cos -x_function polynomial -y_function zero -y_function zero -z_function zero -z_function zero 1 2 1 2 1 3 0 0 0 1 0 0 -shift "-11 5 0 0" -pi 8 -n_steps 1600' -color yellow -command 't_function -mqs 2 -mqs 1 -t_function one -t_function one -x_function sin -x_function polynomial -y_function zero -y_function zero -z_function zero -z_function zero -shift "0 5 0 0" -pi 8 -n_steps 1600 -- 1 2 1 2 1 3 0 0 0 -2 0 0' -color blue -command 't_function -mqs 2 -mqs 1 -t_function zero -t_function zero -x_function cos -x_function polynomial -y_function zero -y_function zero -z_function zero -z_function zero -shift "0 5 0 0" -pi 8 -n_steps 1600 -- 1 2 1 2 1 3 0 0 0 -4 0 0' -color red
math
equation: 

(t, x, y, z) = (t, cos(2 t + 3), 0, 0)
(\gamma, \gamma \beta_x, \gamma \beta_y, \gamma \beta_z) = (1, -2 sin(2 t + 3, 0, 0)
(a_t, a_x, a_y, a_z) = (0, -4 cos(2 t + 3, 0, 0)

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
sine
cosine
Programming Tag: 
command line quaternions
t_function
Tags:
Posted by doug
summary: 

The scalar term is equal to 1 for every velocity because the problem is classical.

description: 

When one take the time derivative of the oscillator, \frac{d t}{d t} = 1. I puzzled over that obvious result for days, since its meaning was not clear. Then I recalled in relativistic physics, one takes the derivative with respect to the interval tau, so \frac{d t}{d \tau} = \gamma. For tiny values of velocity, gamma will equal 1. What people often graph is the velocity parameterized by time. They don't wish to treat the 4-velocity like a 4-velocity. If you keep the books consistent, you can get fun surprises.

command: 
q_graph -out sho-x_and_v -dir sho -box 10 -command 't_function -mqs 2 -mqs 1 -t_function polynomial -t_function one -x_function cos -x_function polynomial -y_function zero -y_function zero -z_function zero -z_function zero 1 2 1 2 1 3 0 0 0 1 0 0 -shift "-11 5 0 0" -pi 8 -n_steps 1600' -color yellow -command 't_function -mqs 2 -mqs 1 -t_function one -t_function one -x_function sin -x_function polynomial -y_function zero -y_function zero -z_function zero -z_function zero -shift "0 5 0 0" -pi 8 -n_steps 1600 -- 1 2 1 2 1 3 0 0 0 -2 0 0' -color blue
math
equation: 

(t, x, y, z) = (t, cos( 2 t + 3), 0, 0)
(\gamma, \gamma \beta_x, \gamma \beta_y, \gamma \beta_z) = (1, -2 sin( 2 t + 3), 0, 0)

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
sine
cosine
Programming Tag: 
command line quaternions
t_function
Tags:
Posted by doug
summary: 

Each and every photon is identical to every other, but by coloring in those where t = 0, we can cheat and see the phase.

description: 

Part of the great mystery of quantum mechanics is that all particles are identical. There is no adding a tag or painting one red while the rest are yellow. As a programmer, we can cheat, do something not allowed in Nature, and mark all those where t = 0 in red. The shift is the same as before, but now we can spot its trail.

What is so tricky in quantum mechanics is not the vectors - those we can always point at with our fingers. Instead it is the scalars that provide the challenge, the unpointables. Each scalar is connected to three vectors to make 3 complex numbers, but the scalar can be shared by other events. The scalar become the thread within a pattern of events, and between separate patterns of events. It is wonderfully ironic that the simplest core component can be so confusing by playing many roles.

command: 
q_graph -out amp_shifted_marked -dir int14 -box 1.6 -command 't_function -t_func cos -x_func sin -y_func zero -z_func zero -n_steps 0 -pi 10 -n_t_cycles 1000 -n_t_step 0.0314 1 1 0 0 | q_add 0 0 -1.5 -.1 | q_add_n_m 0 0 0.003 0 1 1000' -color red -command 't_function -t_func cos -x_func sin -y_func zero -z_func zero -n_steps 1000 -pi 10 -n_t_cycles 1000 -n_t_step 0.0314 1 1 0 0 | q_add 0 0 -1.5 0 | q_add_n_m 0 0 0.003 0 1000 1000' -color yellow
math
equation: 

\phi = (cos(\omega t + \delta), sin(\omega t + \delta), k ~ \delta, 0) \, \textrm{with} \, \delta: 0 \to 10 \pi
\textrm{red} = (cos(\delta), sin(\delta), k ~ \delta, 0) \, \textrm{with} \, \delta: 0 \to 10 \pi

tags
Physics Tag: 
quantum mechanics
wave function
wave equation
phase
Math Tag: 
sine
cosine
Programming Tag: 
command line quaternions
t_function
q_add
q_add_n_m
Posted by doug
summary: 

The wave function of a wave looks simple, but simple can be deceptive.

description: 

The wave function of a wave equation in spacetime does not move in a bumpy wave through space. It moves along military straight lines (unless you choose different coordinates, which is perfectly valid). The movement starts with pair creation, an agreed apon parting of ways. Movement is slowest at the maximal separation. There is a rush to collide and destroy. Because the animation going in looks like the one going out, there is time reflection. Because there are always two points dancing toward or away from each other, there is a reflection in space. Much of the mystery in interference experiments of quantum mechanics centers around this symmetric spacetime function.

command: 
q_graph -out amp -dir int10 -box 1.6 -command 't_function -t_function cos -x_function sin -y_function zero -z_function zero -n_steps 199 -pi 4 -n_t_cycles 300 -n_t_step 0 1 1 0 0' -color yellow
math
equation: 

\phi = (cos(\omega t), sin(\omega t), 0, 0)

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
sine
cosine
Programming Tag: 
command line quaternions
t_function
Tags:
Posted by doug
summary: 

When the input never moves in space, the output of oscillating points is easier to understand.

description: 

Each of these sets of events starts out pointing in a different direction. Yet the x, y, and z values of the input is never altered. This is why you can spot the spatial origin, the point in the center of all the moving points. It would be simple enough to shift these arbitrary oscillators around precisely the origin to arbitrary oscillators around arbitrary points - just add in an arbitrary value as a last step.

Colored gum ball physics
command: 
q_graph -loop 0 -box 12 -dir vp -out sines_xyz_constant -command 'q_add_n -50 2 2 1 .05 0 0 0 2000 | q_sin' -color red -command 'q_add_n -50 -2.5 0 .5 .05 0 0 0 2000 | q_sin' -color blue -command 'q_add_n -50 0 1.9 -2.3 .05 0 0 0 2000 | q_sin' -color green -command 'q_add_n -50 2 .8 2.2 .05 0 0 0 2000 | q_sin' -color orange -command 'q_add_n -50 1.5 -1 -1.8 .05 0 0 0 2000 | q_sin' -color black -command 'q_add_n -50 -1.5 -2.4 0 .05 0 0 0 2000 | q_sin' -color aqua -command 'q_add_n -50 -1.8 1.5 1.6 .05 0 0 0 2000 | q_sin' -color purple
math
equation: 

\sin(t,\vec{R}) = (\sin(t) \cosh(|R|), \cos(t) \sinh(|R|) \frac{\vec{R}}{|R|})

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
trig functions
sine
Programming Tag: 
command line quaternions
q_add_n
q_sin
Posted by doug
summary: 

Over long periods of time with smaller changes in space, sine and cosine functions make spirals.

description: 

In classical physics, the amount of change in time measured in the same units as space vastly exceeds changes in space. In other words, relativistic velocities are low. In these animations, time changes by 100 while changes in space are only 20.

command: 
q_graph -loop 0 -box 10 -dir vp -out sin-cos-50t -command 'q_add_n -50 -10 -10 -10 .05 .01 .01 .01 2000' -color yellow -command 'q_add_n -50 -10 -10 -10 .005 .001 .001 .001 20000 | q_sin' -color red -command 'q_add_n -50 -10 -10 -10 .005 .001 .001 .001 20000 | q_cos' -color blue
math
equation: 

\begin{align*} \sin(t,\vec{R}) &= (\sin(t) \cosh(|R|), \cos(t) \sinh(|R|) \frac{\vec{R}}{|R|})\\ \cos(t,\vec{R}) &= (\cos(t) \cosh(|R|), \sin(t) \sinh(|R|) \frac{\vec{R}}{|R|}) \end{align*}

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
trig functions
sine
cosine
Programming Tag: 
command line quaternions
q_add_n
q_sin
q_cos
Posted by doug
summary: 

Quaternions ranging from (-5, -5, -5, -5) to (5, 5, 5, 5) were fed into a sine and cosine function, with these odd looking results.

description: 

The linear input is in yellow, the odd sine function is in red, the even cosine in blue. The cosine has only one apparent line diving into the origin because that line is a doublet. I thought I knew what cosines and sines looked like, but it feels like there is a frightening large amount of unknown diversity possible for these formerly familiar friends. The cause of the oddness maybe due to varying t, x, y, and z at the same time.

command: 
q_graph -loop 0 -box 10 -dir vp -out sin-cos -command 'q_add_n -10 -10 -10 -10 .01 .01 .01 .01 2000' -color yellow -command 'q_add_n -10 -10 -10 -10 .01 .01 .01 .01 2000 | q_sin' -color red -command 'q_add_n -10 -10 -10 -10 .01 .01 .01 .01 2000 | q_cos' -color blue
math
equation: 

\begin{align*} \sin(t,\vec{R}) &= (\sin(t) \cosh(|R|), \cos(t) \sinh(|R|) \frac{\vec{R}}{|R|})\\ \cos(t,\vec{R}) &= (\cos(t) \cosh(|R|), \sin(t) \sinh(|R|) \frac{\vec{R}}{|R|}) \end{align*}

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
trig functions
sine
cosine
Programming Tag: 
command line quaternions
q_add_n
q_sin
q_cos
Posted by doug
summary: 

When a position in space is fixed, the sine and cosine functions circle that point, the angle depending on the exact values of x, y, and z.

description: 

Sines and cosines have to do with circles. By fixing x, y, and z, the circle stays fixed. What direction the line in space points to is arbitrary.

The line in yellow is the input for the The length of the line in space is the amplitude.

command: 
q_graph -loop 0 -box 25 -dir vp -out sin-cos_xyz_constant -command 'q_add_n -50 1 2 1 .05 0 0 0 2000' -color yellow -command 'q_add_n -50 1 2 1 .05 0 0 0 2000 | q_sin' -color red -command 'q_add_n -50 2 1 2 .01 0 0 0 10000 | q_cos | q_x_scalar 2' -color blue
math
equation: 

\begin{align*} \sin(t,\vec{R}) &= (\sin(t) \cosh(|R|), \cos(t) \sinh(|R|) \frac{\vec{R}}{|R|})\\ \cos(t,\vec{R}) &= (\cos(t) \cosh(|R|), \sin(t) \sinh(|R|) \frac{\vec{R}}{|R|}) \end{align*}

tags
Physics Tag: 
simple harmonic oscillator
Math Tag: 
trig functions
sine
cosine
Programming Tag: 
command line quaternions
q_add_n
q_sin
q_cos