Programming help
Programming help
(OP)
I have a equation with multiple answers but I just want one solution. E.g a quadratic equation and I only want the positive result. How can I do that??
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: Programming help
Other option is obtain the solution with in a regionm contained by equation.
RE: Programming help
biggest:max(ans1,ans2)
would sort of work.
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Programming help
y=23·x+42·x²-32
solve for x
x=-23/84+((5905+168·y)^(1/2))/84
and -23/84-((5905+168·y)^(1/2))/84
with y=456, x evaluates to a vector with elements 3.146 and -3.693. max(x)=3.146
RE: Programming help
It works fine and your suggestions are also good..
Thanks