From e5671c2970a8edd76fc71e1a4b3b4c6848fd4fa4 Mon Sep 17 00:00:00 2001 From: bma Date: Mon, 23 Apr 2018 17:39:05 +0200 Subject: [PATCH] add RAM sim --- ram/ram.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ram/ram.py diff --git a/ram/ram.py b/ram/ram.py new file mode 100644 index 0000000..e188fdb --- /dev/null +++ b/ram/ram.py @@ -0,0 +1,22 @@ +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, W, t, m, b= symbols('E0, Omega, t, m, beta', real=True, imaginary=False) + +#AM+PM +E_ampm = E0*(1+m*cos(W*t))*exp(I*(W*t+b*sin(W*t))) +I_ampm = abs(E_ampm)**2 +I_ampm = expand(TR8(expand(expand_complex(I_ampm)))) + +#AM +E_am = E0*(1+m*cos(W*t))*exp(I*(W*t)) +I_am = abs(E_am)**2 +I_am = expand(TR8(expand(expand_complex(I_am)))) + +#PM +E_pm = E0*exp(I*(W*t+b*sin(W*t))) +I_pm = abs(E_pm)**2 +I_pm = expand(TR8(expand(expand_complex(I_pm)))) -- 2.16.4