필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to generate a system of four equations in four unknows to be solved in a matrix?

조회 수: 1 (최근 30일)
Katie
Katie 2013년 3월 20일
마감: MATLAB Answer Bot 2021년 8월 20일
Create an m-file which generates the system of equations to be solved in matrix form and solves them using MATLAB. Comment your code so that it is clear what your vector of unknowns corresponds to in terms of vb and vc.
0=((v_b-v_a)./R_1)+((v_b-v_c)./R_5)+((v_b-v_d)./R_3)
0=((v_c-v_a)./R_2)+((v_c-v_b)./R_5)+((v_c-v_d)./R_4)
v_a=v_d+V_in
v_d=0
Assuming that V_in = 12 Volts, R_1=R_2=50W, R_3=R_4=100W, and R_5=1000W, create an mfile which generates the system of four equations in four unknowns to be solved in matrix form and solves them using MATLAB. Comment your code so that it is clear what your vector of unknowns corresponds to in terms of va , vb, vc and vd.

답변 (1개)

John Doe
John Doe 2013년 5월 2일
편집: John Doe 2013년 5월 2일
If you are familiar with solving linear equations on matrix form by hand, you start of the same way:
A*x = b, where b = the voltages, and A is the matrix of (inverse) resistances. Then the solution in Matlab is simply
x = A\b
Better late than never... I believe this should solve your problem:
V_in = 12;
R = [50 50 100 100 1000];
A = [-1/R(1) 1/R(1)+1/R(5)+1/R(3) -1/R(5) -1/R(3);
-1/R(2) -1/R(5) 1/R(2)+1/R(5)+1/R(4) -1/R(4);
-1 0 0 1;
0 0 0 1];
V = [0;0;-V_in;0];
x = A\V

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by