solving three equations for 3 unknows

Hi Guys, I have the three following equations:
(2*c*w1)+b2 == 0.3205;
((2*c*b2)+ w1)*w1 == 214200;
(b2*w1)==1.2260e+05;
And I need to find the values of: c, w1 and b2.... is there a function for me to do it?
Thanks for your time.

 Risposta accettata

For your system, use vpasolve (link) to get numeric results. You may also need to use the double function if you want to use the results in other calculations.
syms c w1 b2
Eqs = [(2*c*w1)+b2 == 0.3205;
((2*c*b2)+ w1)*w1 == 214200;
(b2*w1)==1.2260e+05];
[c,w1,b2] = vpasolve(Eqs, [c,w1,b2])

4 Commenti

Thank you so much, it worked! However, I have other question, why the answer is like a vector? I mean, it is not supposed to be just one value per each unknown?
As always, my pleasure.
Each equaton is defined by the product of two of the variables, and in the second equation ‘w1’ is also squared.
It is a vector because all the variables are then defined as degree polynomials (the Symbolic Math Toolbox defines them as such with respect to the parameter ‘z’):
c =
(641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 1))/490400000 - root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 1)^2/245200
(641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 2))/490400000 - root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 2)^2/245200
(641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 3))/490400000 - root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 3)^2/245200
(641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 4))/490400000 - root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 4)^2/245200
w1 =
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 1)^3/122600 - (641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 1)^2)/245200000 + (1071*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 1))/613
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 2)^3/122600 - (641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 2)^2)/245200000 + (1071*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 2))/613
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 3)^3/122600 - (641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 3)^2)/245200000 + (1071*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 3))/613
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 4)^3/122600 - (641*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 4)^2)/245200000 + (1071*root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 4))/613
b2 =
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 1)
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 2)
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 3)
root(z^4 - (641*z^3)/2000 + 214200*z^2 - 15030760000, z, 4)
So there are 4 roots of each variable.
Thank you! everything is clear now :3
As always, my pleasure!

Accedi per commentare.

Più risposte (1)

Jon Wieser
Jon Wieser il 10 Giu 2019
try:
D=solve('(2*c*w1)+b2 = 0.3205','((2*c*b2)+ w1)*w1 = 214200','(b2*w1)=1.2260e+05;','c','w1','b2')

Categorie

Scopri di più su Mathematics in Centro assistenza e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by