Changes

Jump to navigation Jump to search

DPL94 math

775 bytes added, 12:25, 20 March 2014
no edit summary
== Ramp code ==
<source lang="python">
import matplotlib.pyplot as plt
import numpy as np
from math import atan2
 
phi = 2.0
kex = 3.0
 
def calc(w1_arr, Omega_arr, p, k):
val_arr = []
for w1 in w1_arr:
for Omega in Omega_arr:
theta = atan2(w1 , Omega)
val = w1**2/(w1**2+Omega**2) * (p*k/(k**2 + w1**2 + Omega**2))
#val = (p*k/(k**2 + w1**2 + Omega**2))
val_arr.append([w1, Omega, theta, val])
return np.array(val_arr)
 
w1 = np.arange(0., 20, 1)
Omega = np.array([5])
data = calc(w1, Omega, phi, kex)
 
plt.figure(1)
plt.plot(data[:,2], data[:,3], '.')
 
Omega = np.arange(0., 20, 1)
w1 = np.array([5])
data = calc(w1, Omega, phi, kex)
 
plt.figure(2)
plt.plot(data[:,2], data[:,3], '.')
 
plt.show()
</source>
 
== Equation ==
<math>

Navigation menu