フィルターのクリア

Matlab dsolve issue with simple equations

9 ビュー (過去 30 日間)
Ahmed Khamis
Ahmed Khamis 2023 年 9 月 19 日
回答済み: SAI SRUJAN 2023 年 10 月 9 日
I am trying to solve simple equations as:
syms e1(t) e2(t) f1(t) f2(t) R1 C1
Vc_dot=diff(e2);
cond=[Vc_dot(0)==0]
cond = 
eqns = [e1 == e2; f2 == C1*Vc_dot; f1 == f2]
eqns(t) = 
S=dsolve(eqns,cond)
Error using symengine
Invalid equation or initial condition.

Error in mupadengine/evalin_internal

Error in mupadengine/fevalHelper

Error in mupadengine/feval_internal

Error in dsolve>mupadDsolve (line 334)
T = feval_internal(symengine,'symobj::dsolve',sys,x,options);

Error in dsolve (line 203)
sol = mupadDsolve(args, options);
I am getting this error although equations are trivial
  1 件のコメント
Torsten
Torsten 2023 年 9 月 19 日
編集済み: Torsten 2023 年 9 月 19 日
"dsolve" accepts differential systems of equations, not differential-algebraic systems as in your case.
And I'm not sure what you expect as solution.

サインインしてコメントする。

回答 (1 件)

SAI SRUJAN
SAI SRUJAN 2023 年 10 月 9 日
Hi Ahmed Khamis,
I can understand that you are facing an issue using the "dsolve" MATLAB function.
You encountered this error as "dsolve" only accepts differential system of equations. Line 4 of your code is causing the error as the equations are not all differential system of equations.
You can follow the below given example to resolve the issue.
syms e(t) e1(t) e2(t) c
eqn1=[diff(e,t)==e*c];
S=dsolve(eqn1);
The above code will exceute as the "eqn1" contains only differential set of equations.
eqn2=[e1==e2 ,diff(e,t)==e*c];
S=dsolve(eqn2);
The above code snippet errors out as the all the equations in "eqn2" are not differential set of equations.
You can refer to the below documentation to understand more about "dsolve" function in MATLAB.

カテゴリ

Help Center および File ExchangeEquation Solving についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by