Collect the coefficients of a symbolic expression for an Op Amp circuit function

조회 수: 1 (최근 30일)
Hello,
I have writen function for Op Amp Sallen-Key Circuit. All values including the 's' are used as symbolic expresion.
I would need to rearange the variables in order to have on the left side the V2/V1. I have been trying to use solve(V2,V1) but are not rearanged.
On the right side I would need the denominator to be on the form of . I have been trying with factor(G) but it gives denominator on the form of .
Is there any way to achieve the above.
Giannis

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 7월 29일
syms A Ga Gb G1 G2 C2 V1 V2 s
%Defining expression
expr = V2 == A*((G1*G2*V1 + C2*G2*V2*s)/(C2^2*s^2+G1*G2 + C2*G1*s + 2*C2*G2*s) - Gb*V2/(Ga+Gb))
expr = 
%Isolating V2 to LHS
expr = isolate(expr,V2)
expr = 
%Assuming that V2/V1 can isolated from the expression
%Dividing both sides of the expression by V1 to obtain V2/V1 on the left side
expr = expr/V1
expr = 
If you want to simplify the RHS, this approach works good enough -
%Get numerator and denominator of RHS in a rational form
[n,d] = numden(rhs(expr))
n = 
d = 
%Redefine the expression
expr = lhs(expr) == n/d
expr = 
If you want the coefficient of s^2 in the denominator to be 1, get its coefficient by using coeffs and divide d by the coefficient.
  댓글 수: 4

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by