This experiment train us to use the freemat to do the circuits.
;There have some useful way to us the freemat.
make the vector([1 2]) or matrix([1 2: 3 4])
array operation(.* , ./ , .^)
create a arithmetic sequence [start value: difference: end value] such as [0:0.01:2*pi]
using the that sequence as x axis and y function to plot the graph
x=0:(pi/10):pi*2
y=sin(x)
plot(x,y)
In the end of the lab, we use the matrix to solve the current, voltage, and power of the circuits
use the KCL to get the i3=i1+i2
then KVL to get V1=i1R1+i3R3, V2=-i2R2-i3R3
put the value from KCL i3=i1+i2 into KVL
we can get the
V1=i1R1+(i1+i2)R3=(R1+R3)i1+R3i2
V2=-i2R2-i3R3= -i2R2-(i1+i2)R3= -R3i1 -(R2+R3)i2
put the constant value in the question
v=[15:7]
R=[30 10:-10 -15]
i1,i2 = 0.8429A, -1.0286A
so i3= -0.186A
No comments:
Post a Comment