How to solve three equations for four unknowns?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
NUPUR THAKUR
le 19 Mar 2018
Commenté : Walter Roberson
le 19 Mar 2018
My four equations are as follows:
x1_temp(t) == exp(-t*theta1_temp)*u1(t);
x2_temp(t)= y-gamma;
x2_temp(t) == exp(-t*theta2_temp)*(theta1_temp*x1_temp(t) + 1160917147506309/70368744177664)
Here, the unknowns are theta1_temp, theta2_temp, x1_temp(t), x2_temp(t). Other all are known. Please suggest a way to solve this problem. Thanks in advance for the help.
0 commentaires
Réponse acceptée
Walter Roberson
le 19 Mar 2018
You can only solve for three out of the four variables.
syms x1t t t1t u1 x2t y gamma t2t
eq = [ x1t == exp(-t*t1t)*u1, x2t==y-gamma, x2t == exp(-t*t2t)*(t1t*x1t+1160917147506309/70368744177664)]
sol = solve(eq, [t1t, t2t, x2t], 'returnconditions',true)
You will find that the result is parameterized in two variables, and that the "conditions" returned is mostly that the two variables are each integer. What that is saying is that there are an infinite number of solutions that differ by multiples of 2*pi*1i
If you are willing to restrict to real values, then add the word "real" at the end of the syms line. sol would then have exactly one set of solutions.
Note that asking to solve for [t1t, t2t, x1t] will not return back any values.
If you ask to solve for [t1t, x1t, x2t] assuming real values, then you will get back three solution sets. The solutions will involve different branches of the Lambert W function. After you have substituted in the known values and have substituted in t and u1, you might find that some of the solutions turn out to be complex valued.
2 commentaires
Walter Roberson
le 19 Mar 2018
Make the fourth variable any value you want; each different value for it generates a new value for the other some of the other variables.
When there are more variables to solve for than there are equations, then typically there are an infinite number of solutions if there are any solutions at all. Sometimes if there are known constraints then they might give enough extra information to lead to a solution.
For example if there was the extra constraint that all of the variables had to be real valued, then hypothetically it could turn out that there is only a single value of x1t that permitted all of the variables to be simultaneously real valued. (That is not the case here, but in some situations you can prove that whatever system of equations you are working on only has a single solution that lets everything be real valued.)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!