%% IT39/c. feladat megoldása
syms ia ib ic id ua ub uc ud m n I0 U1 U2 U3 U4 U5
eq1 = -I0+(U1-U2)/R == 0;
eq2 = ia+(U2-U1)/R+(U2-U4)/R == 0;
eq3 = -ia + ic + U3/R + (U3-U5)/R == 0;
eq4 = ib + (U4-U2)/R + (U4)/R ==0;
eq5 = ua == n*ub;
eq6 = ib == -n*ia;
eq7 = uc == m*ud;
eq8 = id == -n*ic;
eq9 = id - ib + (U5-U3)/R ==0;
eq10= U5 == ud;
eq11= U3 == uc;
eq12= U4 == ud + ub;
eq13= U2 == uc + ua;
sol = solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13],[ua,ub,ia,ib,uc,ud,ic,id,U1,U2,U3,U4,U5])
% sol.ua
pretty(sol.U1/I0)
pretty(collect(sol.U1/I0,{n, R}))
