# Solve returns empty set for set of equations

I am trying to solve following system of equations, but i am not getting the desired solution:

{uc[t] -> u[t] - ul[t] - y[t]}


I am trying to solve from following set of equations, but Mathematica answers with the empty set {}. Am I having a problem with my syntax?

KEquations = {ic[t] - il[t] == 0,
il[t] - ir[t] == 0,
-u[t] + uc[t] + ul[t] + y[t] == 0};

solution1 = Solve[KEquations, uc[t]]


KEquations = {ic[t] - il[t] == 0,
il[t] - ir[t] == 0, -u[t] + uc[t] + ul[t] + y[t] == 0};


You have three equations, you need to tell Mathematica which three variables you want

solution1 = Solve[KEquations, {uc[t], ic[t], il[t]}][[1]]

(* {uc[t] -> u[t] - ul[t] - y[t], ic[t] -> ir[t], il[t] -> ir[t]} *)


Alternatively, specify the variables to be eliminated

solution1 = Solve[KEquations, uc[t], {ic[t], il[t]}][[1]]

(* {uc[t] -> u[t] - ul[t] - y[t]} *)


Or

solution1 = Solve[Eliminate[KEquations, {ic[t], il[t]}], uc[t]][[1]]

(* {uc[t] -> u[t] - ul[t] - y[t]} *)


For some reason that I don't understand, if you give too few variables to Solve for the output is {} as you've found out. Just give three variables, e.g.

Solve[KEquations, {uc[t],ic[t],ir[t]}]

{{uc[t] -> u[t] - ul[t] - y[t], ic[t] -> il[t], ir[t] -> il[t]}}

• Isn't there another way of doing it @KraZug? Dec 15, 2017 at 20:25
• You can just leave the second option empty: Solve[KEquations], but it may not give you the substitution you want. There is probably some other way, but I don't know it. Dec 15, 2017 at 21:18