systems of equations, with constraints
Mostra commenti meno recenti
Hello everyone! could you please help me with solving systems of equations in matlab.
In the given eqns, I have 4 unknowns and 3 eqns, which gives the infinite number of solutions. But in the code, it should choose the solution or solutions that will be constrained within the limits: y -> (+/-15); z -> (+/-20); k -> (+/-5), (k in degrees)
My systems of eqns:
-0.00293*x-0.0024*y+0.00015*z=0
0.0018*x+0.0005*y-0.00096*z=0
-0.0105*x+0.0021*y+1.4584*sin(k)=0
Thank you in advance!!!
1 Commento
Torsten
il 10 Apr 2023
x = y = z = k = 0.
If this does not work for you, please explain further.
Risposta accettata
Più risposte (1)
Jon
il 10 Apr 2023
1 voto
If you have the optimization toolbox, you could use lsqnonlin, where your f(x) is the system of equations you show above, and your lower and upper bounds are the bounds you describe on y, z and k.
As you note, there will, in general be an infinite number of solutions. This may even be the case with your bounds. If so, the best you can do is obtain individual solutions that satisfy the equations, but obviously not all of them, unless you have a lot of time :)
4 Commenti
Jon
il 10 Apr 2023
You could also use fmincon, with the first two equations replaced with linear equality constraints
Jon
il 10 Apr 2023
I assumed that k was also an "unknown". Following your suggestion, I guess you could pick arbitrary values of k within the allowable range -5<= k <= 5 and then solve for x,y and z as a linear program.
Categorie
Scopri di più su Choose a Solver in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!