Here is my problem:
I want to achieve a loop and assign the outcomes of Solve to variables for future use. But the equations in Solve may have no solutions. Under this circumstance, I want to assign 0 to my variable. But I don't know how to achieve it.
For example:
solution = Solve[15 - 0.005 Qi^2 - (Qi Qj)/500 == 0 && 10 - (3 Qi Qj)/2000 + 0.00025 Qj^2 == 0, {Qi, Qj}, Reals]
x1 = solution[[1, 1, 2]]
x2 = solution[[1, 2, 2]]
The outcomes of Solve under this pair of parameters are empty. So I want to assign 0 to x1,x2 but I don't know why.
Thanks!