0
$\begingroup$

I have an equation that uses three variables that I have defined as follows: b[l_, m_, lt_] := 0.025 * (((1 - m)*l)^(-1/2))*((1 - m)*lt) - 5.

After this definition, I am attempting to solve this equation using NSolve --> NSolve[{b[l, m, lt] = 0}, {l, m, lt}, Reals].

This results in an error of NSolve: 3 is not a valid variable with an additional output of NSolve[{0, False}, {l, 3, lt}, Reals]. However, this is not a massive deal since the problem definition I am working with requires 0<=m<=1, which negates the issue of NSolve not working when m=3. The issue that I am running into is I cannot find a way in which to have the parameters of NSolve reflect the bounds that I want to place on m.

For instance, NSolve[{b[l, 0 <= m <= 1, lt] = 0}, {l, m, lt}, Reals] and NSolve[{b[l, m, lt] = 0, 0 <= m <= 1}, {l, m, lt}, Reals] both give the exact same error and result, while NSolve[{b[l, m, lt] = 0}, {l, 0 <= m <= 1, lt}, Reals] just gives me empty brackets.

Any suggestions on what my parameters should be? Thank you so much!

$\endgroup$
1
  • 3
    $\begingroup$ better not use l as variable names, it looks like 1 which makes the code hard to read. Also, are you sure you want to write NSolve[{b[l, m, lt] = 0} instead of NSolve[{b[l, m, lt] == 0} ? $\endgroup$
    – Nasser
    Nov 6, 2021 at 4:48

2 Answers 2

1
$\begingroup$
Clear["Global`*"]

b[l_, m_, lt_] := 1/40*(((1 - m)*l)^(-1/2))*((1 - m)*lt) - 5

sol = Solve[{b[l, m, lt] == 0, 0 <= m <= 1}, {l, m, lt}, Reals] // 
  Simplify

enter image description here

Verifying,

Assuming[{l > 0, 0 <= m < 1}, b[l, m, lt] == 0 /. sol[[1]] // 
  Simplify]

(* True *)

To find 10 instances

inst = FindInstance[{b[l, m, lt] == 0, 0 <= m < 1, l > 0}, 
  {l, m, lt}, Reals, 10]

(* {{l -> 532, m -> 49/102, lt -> 400 Sqrt[13566/53]}, {l -> 638, m -> 0,
   lt -> 200 Sqrt[638]}, {l -> 663, m -> 89/102, 
  lt -> 10200 Sqrt[2]}, {l -> 816, m -> 55/102, 
  lt -> 40800 Sqrt[2/47]}, {l -> 769, m -> 0, 
  lt -> 200 Sqrt[769]}, {l -> 89, m -> 0, 
  lt -> 200 Sqrt[89]}, {l -> 530, m -> 4/51, 
  lt -> 200 Sqrt[27030/47]}, {l -> 532, m -> 0, 
  lt -> 400 Sqrt[133]}, {l -> 530, m -> 0, 
  lt -> 200 Sqrt[530]}, {l -> 898, m -> 49/102, 
  lt -> 400 Sqrt[22899/53]}} *)

Verifying,

And @@ (b[l, m, lt] == 0 /. inst)

(* True *)
$\endgroup$
0
$\begingroup$

ContourPlot3D shows all solutions {m,l,lt}

ContourPlot3D[0 == 1/40*(((1 - m)*l)^(-1/2))*((1 -m)*lt) - 5, {m, 0, 1 }, {l, 0 , 10}, {lt, 0, 1000}, AxesLabel -> {"m", "l", "lt"}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.