フィルターのクリア

Attempting to use Matlab to solve the system below:

2 ビュー (過去 30 日間)
Vishnu Pydah
Vishnu Pydah 2019 年 11 月 13 日
回答済み: Srimouli Rukmabhatla 2020 年 3 月 27 日
I am trying to solve the system below and I know for a fact that there are general solutions. For example, if I set the system == to 0 for both variables I get a family solutions. I know the solution is Kd <= 0 and 1/4(4 - Kd^2) <= Kp <= 1 thanks to Mathematica.
What is the issue here? Why is Matlab giving me a "Unable to find an explicit solution" error here?
syms Kp, Kd;
[Kd, Kp] = solve(real(Kd/2 - (Kd^2 + 4*Kp - 4)^(1/2)/2) <= 0, real(Kd/2 + (Kd^2 + 4*Kp - 4)^(1/2)/2) <= 0, vars);

回答 (1 件)

Srimouli Rukmabhatla
Srimouli Rukmabhatla 2020 年 3 月 27 日
Hi,
You can use the following script to return a real solution.
syms Kp Kd
[Kd, Kp] = solve((Kd/2 - (Kd^2 + 4*Kp - 4)^(1/2)/2) <= 0, (Kd/2 + (Kd^2 + 4*Kp - 4)^(1/2)/2) <= 0,Kp,Kd,'Real',true);
For more information you can refer to the following documentation of solve function https://www.mathworks.com/help/symbolic/troubleshoot-equation-solutions-from-solve-function.html.

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by