Complex equation solver with real variables

1 view (last 30 days)
I need to solve a system of equations for an engineering class. The class effectively demands that an iterative solution be reached, so i intend to solove it in Matlab. The governing equations are as follows: W1(exp(iB2)-1)+Z1(exp(i30)-1)=5-6.5i W2(exp(iB3)-1)+Z2(exp(i87)-1)=10.5-3i Z1 and Z2 are to be set to 2 and -2, respectively, while I figure out the script, but will be later solved for iteratively. W1, W2 and Z1, Z2 are going to be used as complex vectors. B2 and B3 are real angles in degrees (I didn't bother to solve for degrees in the above equation.) This is my Script as of now: % Free choices Z1 = 2.0 Z2 = -2
syms B2 B3 W1 W2 assume(B2, 'real') assume(B3, 'real') % 3pp Analytical Equation, using Z1 = 2 and Z2 = -2 as free choices S = vpasolve(W1*(exp(i*B2*pi/180)-1)+Z1*(exp(i*30*pi/180)-1) == 5-i*6.5, W2*(exp(i*B3*pi/180)-1)+Z2*(exp(i*87*pi/180)-1) == 10.5-i*3)
% Outputs Driver and Coupler also Beta angles S.W1 S.W2 S.B2 S.B3
I need it to output W1 and W2, and I need B2 and B3 to be real numbers. How can I get Matlab to solve this properly?

Answers (0)

Community Treasure Hunt

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

Start Hunting!