Monday, May 28, 2012

Freemat: complex number

Purpose: using FreeMat to do the complex number question, and using it to do the AC circuit calculation.

1 Let A1=3+2j, A2= -1+4j, B= 2-2j, Determin C=(A1*B)/A2

c =-1.0588 -2.2353j



2.change the rectangular to polar form.
abs(complex number) will get it sqrt(R^2+X^2), and angle(complex number) will get the angle of it by radius.

c=2.47 ∠ -115.35°


3.redo item 1 and 2 for D=(A1+B)*A2

d= -5+20j
  = 20.62 ∠ 104.04°


4. do the lecture part
(8 + j8)I1 + j2I2 = j50
j2I1 + (4 − j4)I2 = − j20 − j10



I1=2.0588+2.9412j
   = 3.59 ∠ 55.01°
I2=5-3.5294j
   = 6.12 ∠ -35.22°

Impedance and AC analysis I

Purpose: analyze impedance the inductor and capacitor in a AC circuit.

Background: Introduce  that a real inductor model must include a series resistance to account for the resistance of the many turns of wire and thus appears as series.

Zl.real = RL+ jωL
 Vin/Iin= Zreal=sqrt(RL^2+ jωL^2)


steps:
step 1. RL=3.4Ω
step 2.
Rext=68.5Ω
DMM reading: 4.54V

Vin= 4.5V
I in,rms=87.3mA
f=20kHz

-make computations to get inductor value.
Z=V/I=4.5/87.3m= 51.546Ω
Z=sqrt(Rext^2+RL^2+(jωL)^2)
ω=20k*2π=1.257*10^5
Z=sqrt((68.5+3.4)^2+(jωL)^2), 51.55^2=71.9^2-(1.257*10^5)^2*L^2
L^2=1.59*10^-7, L=4.0*10^-4H=0.4mH
L=0.4mH

step 3. Investigating a series RLC circuit

make the inductor and capacitor's impedance cancel up.
X= ωL-1/ωC
ωL=1/ωC.
C=1/(ω^2*L)= 1/((1.257*10^5)^2*0.4m)=158nF
The capacitot we use in the circuit is 151nF

The frequence we get max frequence is 12.7kHz
Vpp.ch1=21.2
Vpp.ch2=19.5
Δt=19.46μs
ΔΦ=19.46μ*2*12.7k*360=88.971

Vin(V) Iin(mA) Zin
5kHz 5.78 29.3 197.2696
10Khz 5.22 65.1 80.18433
12.7kHz 4.95 73.5 67.34694
30kHz 5.56 23.8 233.6134
50kHz 7.62 1.7 4482.353

Follow-up question.
1.ans: when in maximum current, the ωL=1/ωC and make the Zeq be the minimum. Therefore, I=V/R and make the current be the maximum.
2.
3.ans:The circuit will me more capacitive(ωL<1/ωC)
4.ans:The circuit will me more inductive(ωL>1/ωC)




AC signals #1

Background: This exercise will focus on measuring the phase difference between AC sinusoidal singals at the same frequency

ΔΦ=tx*ω*(180/π)




Part A.
;2.Vrms= 0.3536V
;3. DMM measured RMS Vrms=0.318
6. f= 1000Hz, C=100nF
theory(100nF)Zcap=  1/2*pi*1000Hz*100nF=1591.55Ω
real(102nF)Zcap= 1/2*pi*1000Hz*102nF=1560.34Ω

8.
a) Vcap,pak=pk=0.852V
b) Vcap,rms=0.256V
d) tx=105.41 μs
e) Φ=105.41μ*2π*1000*180/π=37.9476°
f) CH1 lead.

Part B
increase f from 1kHz to 10kHz
2. Zcap=156.034Ω

3
a)Vcap,pk-pk=0.154
b)Vcap.rms=0.033
d)tx=237.8μs
e)Φ=237.8μ*2π*1000*180/π=85.608°

Part C
change resistance to 10kΩ, and return the f to 1kHz
a)Vcap,pk-pk=0.166
b)Vcap.rms=0.049
d)tx=221.62μs
e)Φ=221.62μ*2π*1000*180/π=79.78°
f)Rbox=3700Ω
g)Vcap.rms=0.119
h)tx=189.19μs
i)Φ=189.19μ*2π*1000*180/π=68.11°

Part D
2 in low frequency range is the capacitor voltage amplitude greatest
3.in high frequency range is the capacitor voltage amplitude smallest
 Vcap=Vs*Zcap/(Zcap+Zres), so the Zcap increase, the Vcap will increase.
 Zcap=1/(ωC), so the ω decrease the Zcap will increase.
4. high pass filter, the CH2 amplitude is less than CH1.
5. ΔΦ=tx*ω*(180/π)=tx*2*f*180, so the frequence increase the Φ will increase.
6.

Practical integrator op amp

Purpose: in this experiment, we connect op amp with the first order circuit, and draw the graph with different waveforms.





Sketch the input and output waveforms fro 1kHz sin wave, trangle wave, and square wave input.
sine wave
square wave
trangle wave

Question
Note that 10MΩ resistor is not in the ideal integrator circuit. what is there for? (think about what would happen if a small DC component in the input waveform. waht would integrating this constant do after a short time?) what happens when it is removed?
A: If we remove the 10MΩ resistor, the Rf will become the value of capacitor. In the become of charge capacitor, the resistance of its is infinite, so the gain A will become infinite/Rin= infinite and get error. Inserting a 10MΩ resistor will make the gain =infinite*10M/(infinite+10M)= 10M, and it is an acceptance gain.




Experiment: Capacitor charging/discharging

Purpose: Learn the capacitor are components that storing the energy via the electric field, and we will consider charging and discharging a capacitor.

The circuit have the charge side with the voltage source connect in the begining. After the charging, switching to the discharging circuit.


Charging:
Vc(t)=Vo(1-e^(-t/RC))
Ic(t)=(Vo/R)*e^(-t/RC)
Discharging:
Vc(t)=Vo*e^(-t/RC)
Ic(t)=-Io*e^(-t/RC)


Problems:
QThe Vs is 9V, and we want charging interval of about 20s storing 2mJ in the capacitor, and then discharging the capacitor in 2s.
1.for the W=V^2*C/2, C=2W/V^2=5m/81=61.73μF
2a.We want Vc(t) charging to 99% of the Vo, when 1-e^(-5)=99.3%
so -5=-20/R*61.73μ, and R =64.8kΩ
2b.peak current= Vo/R= 9/64.8k=0.1389mA
and peak power =VcIc=9*0.1389=1.25mW
3a. -5=-2/R*61.73μ, R=6.48kΩ
3b. peak current= Io= Vo/R=9/6.48k=1.389mA
P=IV=1.389m*9=12.5mW

Measure data.
Rcharge = 65kΩ
Rdischarge = 6.47kΩ
C=63.6 uF
The maximum Voltage is different with the ideal data.

Charging
The V=8.476, 8.476=9*Rleak/(Rleak+65k), Rleak=1.23MΩ


Discharging 




Experiment: Op amp applications

Purpose: This time we use the AS35 which the amplifier change its gain from its temperture connect to the Lm741 circuit, and it has the change scale factor of 10mV/ ºC. We should build the circuit and measure the Vc, VF, and Vref to get the relation of these value. Then calculating temperture with the formula.

The Lm741 part is the difference circuit
so the vf=(1+R2/R1)vc -(R2/R1)*Vref
The formula covert ºF to ºC is ºF=1.8ºC+32
If we assume the 1+R2/R1=1.8, the R2/R1 will be 0.8.
Then make -(R2/R1)*Vref=0.32, so the Vref= -0.4V
The relation of vf, vc, and vref will be the formula of temperture covert.

Data measures:
R1=2.12kΩ
R2=1.75kΩ,  R1/R2=0.825.
Vref=-0.404V
Vc=0.237V
Vf=0.765V

Calculation:
Tf= (1.825*0.24+0..825*0.404)*100=76.58ºF
The room temperture is 23ºC= 73.4ºF
error %=(76.58-73.4)/73.4=4.33%

Experiment: Op amplifiers 1

Purpose:  In this experiment, we try to use the operational amplifiers to build the circuit and learn how to amplify the voltage in the circuit. The inverting amplifier circuit will give a A= -Vout/Vin.

Steps:
we assume the Vin= 1V and Vout= -10V, so A= -(-10)/1=10. In addition, we must make the input current less than 1mA, so the input resistor =1V/1mA= 1kΩ and output resistor= 10*1k=10kΩ.



The 5 volt power source to get 1v, we make the Rx=286Ω and Ry=57.6Ω


Nominal value Measured value  Rate
Ri 1kΩ 981 0.25
Rf 10kΩ 9830 0.25
Rx 288Ω 286 0.125
Ry 58Ω 58.7 1
V1 12V 12.15
V2 12V 12.14

Then measure the value of Vout,Vin, and Vrf

step5A:
Vin Vout(M) Gain(C) Vin(M) Iri(C) Vrf(M)
0 -0.32 null 0.02 0.0000204 0.34
0.25 -2.91 11.64 0.27 0.275 2.85
0.5 -5.31 10.62 0.52 0.53 5.33
0.75 -7.8 10.4 0.77 0.785 7.86
1 -9.97 9.97 0.99 1.01 10.02
step5B:
Iv1=1.51mA
Iv2=0.49mA

Pv1= 12.15*1.51m=18.35mw; Pv2= 12.14*0.49m=5.95mw
It satisfies the power supply constraint to supply no more than 30mW.