Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Matlab and Excel Asignment

Question 1a: Circuit


Analysis in Excel
Known information
V1=4
V2=-6

V=I*R
Equation

R1=5
R2=15
R3=10
R4=8
R5=12
I=V/R

R=V/I

I1(R1+R2)-I2R2=4
I2(R2+R3+R4)-I1R2-I3R4=0
I3(R4+R5)-I2R4=6

A*X=B
20
-15
0

-15
33
-8

0 I1
-8 I2
20 I3

Find the inverse of A using the MINIVERSE function


A'=
0.080323 0.040431 0.016173
0.040431 0.053908 0.021563
0.016173 0.021563 0.058625
Multiply A'with B using the MMULT function
A'*B= 0.224259
0.032345
-0.28706
check if A*X=B
A*X=
4
0
-6

1b. Circuit Analysis in Matlab


Question 2a.polynomial equations in Excel
4.905(t1)^2+343(t1)-857.5

4
0
-6

p= [4.905 343 -857.5]


r=roots(p)
r=
-72.3451
2.4165
2b. Solving Polynomial equations using Function in Matlab
fzero function
x=fzero(@fun,x0)
function f=polyfun1(x)
f=4.905*t^2+343*t-857.5;
x0=2;
x=fzero(@fun,x0)
syms t
solve(4.905*t^2+343*t-857.5);
double (ans)
ans =
2.4165
-72.3451

You might also like