필터 지우기
필터 지우기

How can I equate coefficients of the like powers from rhs and lhs in an equation to obtain a system of ODEs?

조회 수: 1 (최근 30일)
Hi everyone, I have a long equation EQ12.
Is there a way of getting this from Symbolic Math Toolbox? I have tried to play around with coeffs but no luck. Thank you in advance for any help. Cheers.
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 7월 17일
See coeffs() . You might want to use the 'all' option to make it easier to match up.
But have you considered using odeFunction ? I recommend following the workflow given in the first example there.

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

답변 (1개)

Devineni Aslesha
Devineni Aslesha 2020년 7월 20일
Hi Silvia,
You can use the coeffs function to equate like powers of t and obtain the corresponding ODEs.
eqn = lhs(EQ12)-rhs(EQ12) == 0
c = coeffs(eqn,t)
Here, c is a 1*6 symbol in which c(1,1) = "- diff(F[0](z), z, z) + diff(F[0](z), z) + F[0](z)^2" which is the coefficient of t. Similarly, you have coefficients for other powers of t. Now, you can use the equation c(1,1) == 0 for further calculations.
For more information, refer the following links
  댓글 수: 1
Silvia Ceccacci
Silvia Ceccacci 2020년 7월 22일
Hi Aslesha,
I have tried wht you suggested, but it doesn't seem to tidy up the equations.
EQ12 = collect(EQ11,t);
EQ13 = lhs(EQ12)-rhs(EQ12) == 0;
coef = coeffs(EQ13,t);
coef_t = coef(1,1) == 0
So basically it has put all the term on the lhs but not given me the system of ODEs by equating the powers of t. Thank you for your help. Silvia

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by