% Example 1

syms s i1 i2 v
eqn1 = -v +7*i1 + 2*s*(i1 - i2) == 0;
eqn2 = 2*s*(i2 - i1) + 13*i2 + i2/(s*1e-6) == 0;
[i1,i2] = solve([eqn1,eqn2],[i1,i2]);
vc = i2*(1/(s*1e-6));
G = vc/v

%
%
%
%
%
%
%
%
%
% Student Example 1

syms s i1 i2 i3 ib i
eqn1 = i1 == -i;
eqn2 = 3*(i2 - i1) + (1/(2*s))*(i2 - ib) + 6*(i2 - i3) == 0;
eqn3 = 6*(i3 - i2) + 4*s*i3 == 0;
eqn4 = (1/(2*s))*(ib - i2) + 3*s*ib == 0;
[i1,i2,i3,ib] = solve([eqn1,eqn2,eqn3,eqn4],[i1,i2,i3,ib]);
G=ib/i

%
%
%
%
%
%
%
%
%
%
% Example 2

syms s v v1 v2
eqn1 = v1/25 + (v1 - v)/(0.01*s) == 0;
eqn2 = (v2 - v)/(1/(0.1*10^-3*s)) + v2/15 == 0;
[v1,v2] = solve([eqn1,eqn2],[v1,v2]);
G=v1/v

%
%
%
%
%
%
%
%
%
%
%
%
%
% Student Example 2

syms s v v1 v2 v3
eqn1 = v1 == v;
eqn2 = (v2 - v1)/6 + (v2 - v3)/10 + v2/(1/((2e-6)*s)) == 0;
eqn3 = (v3 - v1)/(4*s) + (v3 - v2)/10 + v3/(5*s) == 0;
[v1,v2,v3] = solve([eqn1,eqn2,eqn3],[v1,v2,v3]);
G=vpa(v3/v, 3)

%
%
%
%
%
%
%
%
%
%
%
% Student Example 3

syms s i i1 i2
eqn1 = 25*i1 + 0.001*s*i1 + 35*i2 + (1/((0.5e-6)*s))*i2 == 0;
eqn2 = i2 - i1 == i;
[i1,i2] = solve([eqn1,eqn2],[i1,i2]);
vc = i2*(1/((0.5e-6)*s));
G=vpa(vc/i,3)