how to solve this equation?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Swatantra Mahato
il 7 Apr 2021
Modificato: Swatantra Mahato
il 7 Apr 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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Assumptions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!