何必手算?MATLAB求解線性方程組|Matlab符號計算


clc
close all
clear
syms i1 i2 i3 U12 U23 U31 R1 R2 R3 R12 R23 R31
equ = [i1+i2+i3==0;...
??R1*i1-R2*i2==U12;...
??R2*i2-R3*i3==U23]
f = solve(equ, [i1 i2 i3]);
i1 = simplify(subs(f.i1, U23, -U12-U31))
i2 = simplify(subs(f.i2, U31, -U23-U12))
i3 = simplify(subs(f.i3, U12, -U31-U23))
equ = [R12==(R1*R2+R2*R3+R3*R1)*1/R3;...
??R23==1/R1*(R1*R2+R2*R3+R3*R1);...
??R31==1/R2*(R1*R2+R2*R3+R3*R1)]
g = solve(equ, [R1 R2 R3]);
R1 = g.R1
R2 = g.R2
R3 = g.R3
標簽: