Message Boards Message Boards

0
|
5652 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Absolute value within Solve function

Posted 11 years ago
Hi,

Is there a way to make mathematica use only POSITIVE (absolute) value when reporting value in Solve function

Clear["Global`*"]

kenz1=50;
Nenz2=34000;
kenz2=100;

Solve[{Nenz2*kenz2==Nenz1*kenz1},{Nenz1}]

This equation gives Nenz1 -> 68000, but when I change Nenz2 to -34000 for example, equation gives Nenz1 -> -68000.... but is it possible to make Solve report the value of NEnz1 POSITIVE regardless of sign of Nenz1 (without modifying kenz values, of course), that is the answer should be Nenz1 -> 68000 in both cases (Nenz2=34000 or Nenz2=-34000)

Does anyone know a solution, if it exists at all. The equation is simplified, in real there are hundreds of variables.

Best regards,

Indrek
POSTED BY: Indrek Morell
Solve and NSolve will probably not be able to handle hundreds of varibles.  FindRoot might be able to do your problem.
FindRoot[{x^2 == 3, y ==  Abs[x]}, {{x, -2}, {y, 1}}]
{x -> -1.73205, y -> 1.73205}
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract