필터 지우기
필터 지우기

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 CenterFile Exchange에서 Equation Solving에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by