Commit e5671c2970a8edd76fc71e1a4b3b4c6848fd4fa4
1 parent
2ae9831cf2
Exists in
master
add RAM sim
Showing 1 changed file with 22 additions and 0 deletions Side-by-side Diff
ram/ram.py
| 1 | +from sympy import * | |
| 2 | +from sympy.simplify.fu import * | |
| 3 | + | |
| 4 | +init_printing() | |
| 5 | + | |
| 6 | +#constants | |
| 7 | +E0, W, t, m, b= symbols('E0, Omega, t, m, beta', real=True, imaginary=False) | |
| 8 | + | |
| 9 | +#AM+PM | |
| 10 | +E_ampm = E0*(1+m*cos(W*t))*exp(I*(W*t+b*sin(W*t))) | |
| 11 | +I_ampm = abs(E_ampm)**2 | |
| 12 | +I_ampm = expand(TR8(expand(expand_complex(I_ampm)))) | |
| 13 | + | |
| 14 | +#AM | |
| 15 | +E_am = E0*(1+m*cos(W*t))*exp(I*(W*t)) | |
| 16 | +I_am = abs(E_am)**2 | |
| 17 | +I_am = expand(TR8(expand(expand_complex(I_am)))) | |
| 18 | + | |
| 19 | +#PM | |
| 20 | +E_pm = E0*exp(I*(W*t+b*sin(W*t))) | |
| 21 | +I_pm = abs(E_pm)**2 | |
| 22 | +I_pm = expand(TR8(expand(expand_complex(I_pm)))) |