how to solve this equation?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Swatantra Mahato
2021-4-7
编辑:Swatantra Mahato
2021-4-7
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!