Simplify the V/I equation

11 Ansichten (letzte 30 Tage)
Napath
Napath am 26 Mär. 2025
Kommentiert: Walter Roberson am 27 Mär. 2025
I want to determine V/I (voltage/current) symbolically from the equation using solve function, but the answer that I got from it is just V not V/I.
This is my code:
clear Vx Vy Vcm Cin Ca Cfb Ccm s x y gm Zin solx soly
syms Vx Vy Vo Cin Ca Cfb Ccm s x y gm Zin Vcm
eqns = [2*((Cin*(Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1))/(Ca*(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1)) - (y*((2*Ca)/Cfb + 1))/(2*Ca*s) - Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)))*s*Ccm+2*x*s*Cin==(-((Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*(Cfb/(2*Ccm) + 1))/(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1))*(2/Zin+2*s*Cin+2*s*Ccm)];
S = solve(eqns);
sol = [S]
sol = 
x is V (voltage) and y is I (current). You can see that it still have variable y in the answer. I want y to be at left hand side. Is there any way to do it?
  6 Kommentare
Sam Chak
Sam Chak am 26 Mär. 2025
If the equation eqn is correctly described, we should observe the following form:
.
This implies that the two terms can be separated into:
.
However, I do not see this form in your equation. Moreover, the transfer function should be properly derived from the governing differential equations. However, this important step has been overlooked, and you immediately introduce the algebraic equation, eqn.
syms Vx Vy Vo Cin Ca Cfb Ccm s x y gm Zin Vcm
eqn = [2*((Cin*(Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1))/(Ca*(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1)) - (y*((2*Ca)/Cfb + 1))/(2*Ca*s) - Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)))*s*Ccm+2*x*s*Cin==(-((Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*(Cfb/(2*Ccm) + 1))/(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1))*(2/Zin+2*s*Cin+2*s*Ccm)]
eqn = 
% ySol = isolate(eqn, y)
Walter Roberson
Walter Roberson am 26 Mär. 2025
syms Vx Vy Vo Cin Ca Cfb Ccm s x y gm Zin Vcm
eqns = [2*((Cin*(Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1))/(Ca*(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1)) - (y*((2*Ca)/Cfb + 1))/(2*Ca*s) - Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)))*s*Ccm+2*x*s*Cin==(-((Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*(Cfb/(2*Ccm) + 1))/(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1))*(2/Zin+2*s*Cin+2*s*Ccm)];
size(eqns)
ans = 1×2
1 1
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
You have a scalar equation. When you solve() a system of equations and do not specify which variable to solve for, it uses symvar() to choose one of the variables out of the set. Most likely it will solve for x in this situation, which might not be what you want.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Mär. 2025
Use the usual trick of substition of variables. If x/y = z then it follows that x = y*z so substitute in y*z for x and solve for z
syms Vx Vy Vo Cin Ca Cfb Ccm s x y gm Zin Vcm
syms Z
eqns = [2*((Cin*(Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1))/(Ca*(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1)) - (y*((2*Ca)/Cfb + 1))/(2*Ca*s) - Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)))*s*Ccm+2*x*s*Cin==(-((Vcm*((2*Ca)/Cfb - ((2*Ca)/Cfb + 1)*(Cin/Ca + 1)) + (y*((2*Ca)/Cfb + 1))/(2*Ca*s))*(Cfb/(2*Ccm) + 1))/(((2*Ca)/Cfb + 1)*(Cfb/(2*Ccm) + 1) + 1))*(2/Zin+2*s*Cin+2*s*Ccm)];
eqns1 = subs(eqns, x, y*Z);
S = solve(eqns1, Z)
S = 
eqn2 = x/y == simplify(S)
eqn2 = 
  2 Kommentare
Torsten
Torsten am 27 Mär. 2025
The right-hand side of eqn2 still depends on y.
Walter Roberson
Walter Roberson am 27 Mär. 2025
If the right hand side is not intended to depend on y, then the equations are incorrect.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by