MATLAB Answers

How can I solve this complex 4 equation with 4 unknowns variables

10 views (last 30 days)
Quy Long Vu
Quy Long Vu on 30 Dec 2020
Edited: Ameer Hamza on 30 Dec 2020
syms K1 K2 K3 K4
equ1 = K2+K4-36
equ2 = K2*K4+K3+K1-486
equ3 = K2+2*K2*K3+2*K1*K4-2*K4-2916
equ4 = K1-2*K3+2*K1*K3-6563
sol=solve(equ1,equ2,equ3,equ4)
K1 = sol.K1
but I got
>> K1=sol.K1
K1 =
(6635*root(z^6 - 108*z^5 + 4859*z^4 - 116568*z^3 +.....

Answers (1)

Ameer Hamza
Ameer Hamza on 30 Dec 2020
Edited: Ameer Hamza on 30 Dec 2020
You can specify 'MaxDegree' as input to solve()
syms K1 K2 K3 K4
equ1 = K2+K4-36
equ2 = K2*K4+K3+K1-486
equ3 = K2+2*K2*K3+2*K1*K4-2*K4-2916
equ4 = K1-2*K3+2*K1*K3-6563
sol=solve(equ1,equ2,equ3,equ4, 'MaxDegree', 6)
K1 = sol.K1
Result
>> K1
K1 =
(2251793*((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2))/23184 + (6635*(((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^2)/322 + (3239*(((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^3)/2898 + (5*(((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^4)/161 + (((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^5/2898 - 1728705/644
- (2251793*((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2))/23184 + (6635*(((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^2)/322 - (3239*(((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^3)/2898 + (5*(((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^4)/161 - (((12*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(9*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^5/2898 - 1728705/644
(2251793*(-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2))/23184 + (6635*((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^2)/322 + (3239*((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^3)/2898 + (5*((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^4)/161 + ((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^5/2898 - 1728705/644
- (2251793*(-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2))/23184 + (6635*((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^2)/322 - (3239*((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^3)/2898 + (5*((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^4)/161 - ((-(470473 + 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) - 3^(1/2)*470473i)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^5/2898 - 1728705/644
(2251793*(-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2))/23184 + (6635*((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^2)/322 + (3239*((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^3)/2898 + (5*((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^4)/161 + ((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 - 18)^5/2898 - 1728705/644
- (2251793*(-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2))/23184 + (6635*((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^2)/322 - (3239*((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^3)/2898 + (5*((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^4)/161 - ((-(3^(1/2)*470473i - 3^(1/2)*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3)*36i - 24*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3) + 36*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(2/3) + 470473)/(18*((108^(1/2)*120546270933059^(1/2)*1i)/108 + 228168323/216)^(1/3)))^(1/2)/2 + 18)^5/2898 - 1728705/644
To get it in numberical form, either use vpa() or double()
>> vpa(K1)
ans =
374.90306346676693378668932343552 + 3.320301240707478069479452380102e-38i
9.7750016530464191047142952511176 - 2.2754173733098891735072421247934e-38i
52.331577184285458943207620674043 + 25.417891017425983813684689555552i
52.331577184285458943207620674043 - 25.417891017425983813684689555552i
1.0793902558078646110905699826374 - 57.279958948896626822025419852734i
1.0793902558078646110905699826374 + 57.279958948896626822025419852734i
>> double(K1)
ans =
1.0e+02 *
3.749030634667669 + 0.000000000000000i
0.097750016530464 + 0.000000000000000i
0.523315771842855 + 0.254178910174260i
0.523315771842855 - 0.254178910174260i
0.010793902558079 + 0.572799589488966i
0.010793902558079 - 0.572799589488966i

Community Treasure Hunt

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

Start Hunting!