Jump to content

Circuit Theory/1Source Excitement/Example 10/codeDiff

From Wikibooks, open books for an open world
R = 10;
L = .01;
w = 377;
Im = 120*2^.5;
omega = 2*pi/3;
Vm = Im*sqrt((w^2*L^2*R)^2 + (w*L*R^2)^2)/(R^2+w^2*L^2);
alpha = omega + atan(R/(w*L));
syms t A C;
Vs = Vm * cos(w*t+alpha) + A*exp(-t/(L/R)) + C;
leftSide = int(Vs,t);
vpa(leftSide, 3)
t=0;
teq = subs(leftSide);
vpa(teq,3)
Ieval = subs(Vs) - Im*cos(omega)*10;
vpa(Ieval,3)
S = solve(Ieval,teq,A,C);
S = [S.A S.C];
vpa(S(1),3)
vpa(S(2),3)