blob: a7dd4d0dcb4213153622b6e28edf736595754cbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
clear
//
//Initialisation
R=10**4 //Resistance in Ohm
f=10**3 //Frequency in Hertz
C=3*10**-8 //Capacitance in Farad
V=10 //Voltage
//Calculation
Xc=1/(2*%pi*f*C) //Reactance
a=((10**4)**2)+(5.3*10**3)**2
I=sqrt((V**2)/a) //Current in Amp
Vr=I*R //Voltage
Vc=Xc*I //Voltage
phi=atan(Vc/Vr) //Phase Angle in radians
//Result
printf("\n (a) Current, I = %d uA",round(I*10**6))
printf("\n (b V = %.2f V",-phi*180/%pi)
|