how to solve this equation?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
clc
clear
syms Th1 Th2 Th3 Th4 Rs Ld Lq kexi Ts
eq1 = (-Ts*Rs + 2*Lq)/(Ts*Rs + 2*Lq);
eq2 = (Ts)/(Ts*Rs + 2*Lq);
eq3 = -(Ts*Ld)/(Ts*Rs + 2*Lq);
eq4 = -(Ts*kexi)/(Ts*Rs + 2*Lq);
d = solve(eq1==Th1,eq2==Th2,eq2==Th3,eq2==Th4,Rs,Ld,Lq,kexi);
d.Rs
d.kexi
d.Ld
d.Lq
ans =
command:
Empty sym: 0-by-1
ans =
Empty sym: 0-by-1
ans =
Empty sym: 0-by-1
ans =
Empty sym: 0-by-1
0 commentaires
Réponse acceptée
Swatantra Mahato
le 7 Avr 2021
Modifié(e) : Swatantra Mahato
le 7 Avr 2021
Hi
I am assuming you want to solve the equation
d = solve(eq1==Th1,eq2==Th2,eq2==Th3,eq2==Th4,Rs,Ld,Lq,kexi);
You can try using the "solve" function in the Symbolic Math Toolbox with the Parameter "ReturnConditions" set to true as below:
d = solve([eq1==Th1,eq2==Th2,eq2==Th3,eq2==Th4],[Rs,Ld,Lq,kexi],'ReturnConditions',true);
which gives
>> d
d =
struct with fields:
Rs: [3×1 sym]
Ld: [3×1 sym]
Lq: [3×1 sym]
kexi: [3×1 sym]
parameters: [1×4 sym]
conditions: [3×1 sym]
where the parameters used in the solutions and the conditions under which the respective solutions are valid are stored in the struct "d" under the fields "parameters" and "conditions" respectively.
I noticed that
d = solve([eq1==Th1,eq2==Th2,eq3==Th3,eq4==Th4],[Rs,Ld,Lq,kexi]);
seems to give a unique solution if that was what you wanted to actually solve.
You can refer the documentation for "solve" for more information:
Hope this helps
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric 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!