Shrinathji Institute of Technology & Engineering, Nathdwara

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

SHRINATHJI INSTITUTE OF TECHNOLOGY & ENGINEERING, NATHDWARA

Number of Experiment
SYSTEM PROGRAMMING LAB
DEPARTMENT OF ELECTRICAL Code: 5EE9A No.: 4
Pg No.1/4

EXPRIMENT NO.4

(i) Solving three linear equations (by array division method)

4x-2y+6z=8
2x+8y+2z=4
6x+10y+3z=0

Solution: >> A=[4 -2 6;2 8 2;6 10 3];


>> B=[8;4;0];
>> X=A\B
X = -1.8049
0.2927
2.6341
(ii) Element by element operation
>> A=[2 6 3;5 8 4]

A=2 6 3
5 8 4

>> B=[1 4 10;3 2 7]

B =1 4 10
3 2 7
>> A.*B

ans = 2 24 30
15 16 28
>> C=A./B

C = 2.0000 1.5000 0.3000


1.6667 4.0000 0.5714
SHRINATHJI INSTITUTE OF TECHNOLOGY & ENGINEERING, NATHDWARA
Number of Experiment
SYSTEM PROGRAMMING LAB
DEPARTMENT OF ELECTRICAL Code: 5EE9A No.: 4
Pg No.2/4

>> B.^3

ans = 1 64 1000
27 8 343
>> A*B
??? Error using ==> mtimes
Inner matrix dimensions must agree.

>> x=[1:8]

x= 1 2 3 4 5 6 7 8

>> y=x.^2-4*x

y = -3 -4 -3 0 5 12 21 32

>> z=[1:2:15]

z =1 3 5 7 9 11 13 15

>> y=(z.^3+5*z)./(4*z.^2-10)

y =-1.0000 1.6154 1.6667 2.0323 2.4650 2.9241 3.3964 3.8764

(iii) The electric resistive network shown below consists of resistors and
voltage sources. Determine the current in each resistor using the mesh current
method which is based on Kirchhoff’s voltage law.
R1=18, R2=10, R3=16, R4=6, R5=15, R6=8, R7=12, R8=14.
V1=20V, V2=12V, V3= 40V.
SHRINATHJI INSTITUTE OF TECHNOLOGY & ENGINEERING, NATHDWARA
Number of Experiment
SYSTEM PROGRAMMING LAB
DEPARTMENT OF ELECTRICAL Code: 5EE9A No.: 4
Pg No.3/4

circuit

Solution: >> V1=20; V2=12;V3=40;


SHRINATHJI INSTITUTE OF TECHNOLOGY & ENGINEERING, NATHDWARA
Number of Experiment
SYSTEM PROGRAMMING LAB
DEPARTMENT OF ELECTRICAL Code: 5EE9A No.: 4
Pg No.4/4

>> R1=18;R2=10;R3=16;R4=6;

>> R5=15;R6=8;R7=12;R8=14;

>> A=[-(R1+R2+R3) R2 R3 0;R2 -(R2+R4+R5+R7) R4 R7;R3 R4 -(R3+R4+R6) R6; 0 R7 R6 -


(R6+R7+R8)]

A = -44 10 16 0

10 -43 6 12

16 6 -30 8

0 12 8 -34

>> B=[-V1;0;V2;-V3]

B = -20

12

-40

>> I=A\B

I = 0.8411

0.7206

0.6127

1.5750

The current in register R2 is I1-I2= 0.1205 A

The current in register R3 is I1-I3= 0.2284 A

The current in register R4 is I2-I3= 0.1079 A

The current in register R6 is I4-I3= 0.9623 A

The current in register R7 is I4-I2= 0.8544 A

RESULT: We have solve following linear equation and circuit solved by MATLAB

You might also like