Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Matlab give me too long answers

jaifree04jaifree04 Member Posts: 2
%Here is the problem:
clear all;
format short
eqn1='4=(V1/8)+((V1-V2)/(2-1*j*4))+((V1-V3)/(1*j*10))';
eqn2='0=(V2/(1*j*6))+((V2-V1)/(2-1*j*4))+((V2-V3)/1)';
eqn3='-2=(V3/(-1*j*2))+((V3-V2)/1)+((V3-V1)/(1*j*10))';
answer=solve (eqn1,eqn2,eqn3,'V1','V2','V3');
V1=vpa (sym (answer. V1)), V2=vpa (sym (answer. V2)), V3=vpa (sym (answer. V3))

%Here are the matlab answer
V1 =(8.0*j*(- 98.0*j^2 + 43.0*j + 9.0))/(- 29.0*j^3 + 33.0*j^2 + 20.0*j + 2.0)
V2 =-(12.0*j^2*(10.0*j^2 + 7.0*j - 14.0))/(- 29.0*j^3 + 33.0*j^2 + 20.0*j + 2.0)
V3 =-(2.0*j*(60.0*j^3 + 37.0*j^2 + 3.0*j + 4.0))/(- 29.0*j^3 + 33.0*j^2 + 20.0*j + 2.0)
But I want the aswer in this form: C=a+bi
V1 =15.6478 - 2.8792i
V2 =3.8798 + 3.4230i
V3 = 2.0131 + 1.0529i

Sign In or Register to comment.