Use Matlab to simplify equation

I was trying to simplify the following equation into the format of Vout equals something. The V1 and V2 are expected to be removed in the final answer. I tried the following code below but it doesn't work. May I ask if I can use matlab to do this or I have to do it by hand? If I have to do it by hand, may I ask if I can have some kind of help by matlab with some of the procedures?
syms C2 R5 R4 R6 C1 R1 R2 R3 V1 V2 Vin Vout f Vref
equ1 = (V2 - V1) * f * C2 * 2 * pi == (V1 - Vout)/R1;
equ2 = (Vin - V1) * f * C2 * 2 * pi == (V1 - Vref)/R6 + (V1 - V2)/R4 + (V1 - Vin)/R5;
equ3 = (Vout - V1)/R2 == (V1 - Vin)/R3;
simplify([equ1,equ2,equ3])
ans = 
vpasolve([equ1,equ2,equ3],Vout)
ans = Empty sym: 0-by-1

Answers (1)

You have three equations and two variables to eliminate. Solve any two of the equations for the two variables, and substitute the results back into the equations.
Caution: this process cannot promise that the third equation will be consistent with the first two.
syms C2 R5 R4 R6 C1 R1 R2 R3 V1 V2 Vin Vout f Vref
equ1 = (V2 - V1) * f * C2 * 2 * pi == (V1 - Vout)/R1;
equ2 = (Vin - V1) * f * C2 * 2 * pi == (V1 - Vref)/R6 + (V1 - V2)/R4 + (V1 - Vin)/R5;
equ3 = (Vout - V1)/R2 == (V1 - Vin)/R3;
sol = solve([equ1, equ2], [V1, V2]);
out = subs([equ1; equ2; equ3], sol)
out = 

Asked:

on 14 Oct 2022

Answered:

on 14 Oct 2022

Community Treasure Hunt

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

Start Hunting!