Simplify the V/I equation

12 visualizaciones (últimos 30 días)
Napath
Napath el 26 de Mzo. de 2025
Comentada: Walter Roberson el 27 de Mzo. de 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 comentarios
Sam Chak
Sam Chak el 26 de Mzo. de 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 el 26 de Mzo. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 26 de Mzo. de 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 comentarios
Torsten
Torsten el 27 de Mzo. de 2025
The right-hand side of eqn2 still depends on y.
Walter Roberson
Walter Roberson el 27 de Mzo. de 2025
If the right hand side is not intended to depend on y, then the equations are incorrect.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by