필터 지우기
필터 지우기

collecting "like terms" in an equation using symbolic toolbox

조회 수: 3 (최근 30일)
Arsalan
Arsalan 2012년 11월 19일
if I have a equation of such
syms gamma vg gn Va N0 deltN Ntr eps S0 deltS taop beta B k Sinj phi0 deltPhi phi_inj
equation =((gamma*vg*gn/Va)*((N0+deltN)-Ntr)/(1+eps*(S0+deltS))-1/taop)*(S0+deltS) + beta*B/Va*(N0+deltN)^2 + 2*k*sqrt(Sinj*(S0+deltS))*cos((phi0+deltPhi)-phi_inj);
How am I able to transform this equation using the symbolic toolbox, such that my final result will be in terms of deltS, deltN and deltPhi.
I have already used
equation=collect(equation, deltS); equation=collect(equation, deltN); equation=collect(equation, deltPhi);
but I still get factors such as deltX(deltY, deltZ). but I only want a linear equation such
deltX wont be a function of either deltY or deltZ,
Thanks

채택된 답변

Arsalan
Arsalan 2012년 11월 21일
My apologizes for using the term linear equation (it should of been used there). I just want the symbolic toolbox to give me factors of such:
deltN*()+deltS()+deltPhi()
where with the factors of deltN I do not want any terms of deltS or deltPhi with the factors of deltS I do not want any terms of deltN or deltPhi with the factors of deltPhi I do not want any terms of deltS or deltN
Thanks, Arsalan
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 11월 21일
That isn't possible. Your first term has deltN in the numerator and deltS in the denominator. Those terms are not separable.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 11월 19일
It is not possible to extract a linear equation in those variables. For example the term beta*B/Va*(N0+deltN)^2 includes deltN^2 which is non-linear.
I do not understand your reference to deltX, deltY, deltZ? Those do not appear in your equation.

Community Treasure Hunt

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

Start Hunting!

Translated by