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

2 次查看(过去 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