how to solve this equation?

조회 수: 1 (최근 30일)
Lu gy
Lu gy 2021년 4월 4일
댓글: Lu gy 2021년 4월 11일
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

채택된 답변

Swatantra Mahato
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
  댓글 수: 1
Lu gy
Lu gy 2021년 4월 11일
Hi
Thank you very much for providing me with the ideas to solve the problem !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by