# Solving system of equations in Mathematica

I am unable to solve this system of equations in Mathematica. Where the third equation takes value (on the right hand side) from 0.00001 to 0.001 in an interval of 0.00001. I have generated list of values for the third equation which has been named by b[[n]], where n=999. Now I want to solve these equations which will result in n number of sets of solutions (x, y, z). I have tried with the code

Solve[{-16 a^4 (x - y)^2 + 16 a^4 (x + 2 y)^2 == 0.00007,-16 a^4 (x - y)^2 + 16 a^4 (x - y + 2 z)^2 == 0.0024, 4 a^2 (x - y)== b[[n]]},{x,y,z}]


which is not yielding any result (here a=0.5). Is it possible to solve this kind of system of equations at a time. Any kind of suggestion will be highly appreciated.

• try the code b = {0.0001, 0.001}; Solve[{-16 a^4 (x - y)^2 + 16 a^4 (x + 2 y)^2 == 0.00007, -16 a^4 (x - y)^2 + 16 a^4 (x - y + 2 z)^2 == 0.0024, 4 a^2 (x - y) == b[[-1]]} /. a -> 0.5, {x, y, z}] – garej Mar 10 '16 at 13:45
• Have you assigned a value to the index n? – Daniel Lichtblau Mar 10 '16 at 16:17

## 2 Answers

To visualize the solution

assume = {Element[{a, b}, Reals]};

eqns = {
-16 a^4 (x - y)^2 + 16 a^4 (x + 2 y)^2 == 7/100000,
-16 a^4 (x - y)^2 + 16 a^4 (x - y + 2 z)^2 == 3/1250,
4 a^2 (x - y) == b, assume} // Flatten;

Clear[sol]

sol[a_, b_] = {x, y, z} /.
Solve[eqns, {x, y, z}, Reals] //

Simplify[#, assume] &;

Manipulate[
ParametricPlot3D[
Evaluate[sol[a, b]],
Evaluate[{b, Sequence @@ br}],
BoxRatios -> {1, 1, 1},
PlotLegends -> Automatic],
{{a, .5}, -1, 1, Appearance -> "Labeled"},
{{br, {-1, 1}, "b range"},
{{0.00001, 0.001}, {-1, 1}},
ControlType -> SetterBar}]


• +1 Evaluate[{b, Sequence @@ br}] is a really nice way to set different ranges for the parameter b. – Jack LaVigne Mar 12 '16 at 15:19

If you give Solve some information about the parameters a and b it will yield a general solution. When one writes a>0, Solve understands this to mean that a is a real number greater than zero.

sol = Solve[{-16 a^4 (x - y)^2 + 16 a^4 (x + 2 y)^2 ==
7/100000, -16 a^4 (x - y)^2 + 16 a^4 (x - y + 2 z)^2 == 24/10000,
4 a^2 (x - y) == b, a > 0, b > 0}, {x, y, z}]


The solution is a bit long to paste so I show the solution for x, y and z.

x is given by sol[[1, 1, 2, 1]]

y is given by sol[[1, 2, 2, 1]]

z has two solutions given by sol[[1, 3, 2, 1]] and sol[[2, 3, 2, 1]]