Group Abstract Group Abstract

Message Boards Message Boards

How do I find all the zero's in a Conditional Expression for the given exp?

Posted 12 years ago

Hi all,

I am doing an assignment for school and I need to find the minima's and maxima's of 4 different functions. This is the case when their derivatives are equal to 0. The problem is that mathematica finds it very hard to find these zero's with the Solve function.

I also need to implement this in a machine so it has to be programmable. This means that I need a expression that gives the zero's for p = ... with all the constants in a ConditionalExpression. I can't give values to the constants yet since they are different for every segment/part. One of the formulas looks like this:

Xlinedp[p_] := dx -djep (-(1/4) Sqrt[3] dq ( 1 - Cos[a0 + da p]) Cos[dq p + q0] + 1/2 da Cos[a0 + da p] Cos[dq p + q0] - 1/4 Sqrt[3] da Sin[a0 + da p] Sin[dq p + q0] - 1/2 dq Sin[a0 + da p] Sin[dq p + q0])

p is the only variable since the rest of the constants are given for each part/segment. [0 > p <= 1] Is there anyway to solve this? Or is this formula just too hard for mathematica? I added the file I am working with, the constants are disabled and just implemented to test from time to time.

I hope anyone can help me or tell me I am working on an impossible solution

Cheers,

Wayne

Attachments:
POSTED BY: Wayne Roest
4 Replies
Posted 12 years ago

If you need a "symbolic solution" then I understand. Put this

Reduce[dx - djep (-(1/4) Sqrt[3] dq (1 - Cos[a0 + da p]) Cos[dq p + q0] + 1/2 da Cos[a0 + da p] Cos[dq p + q0] - 
      1/4 Sqrt[3] da Sin[a0 + da p] Sin[dq p + q0] - 1/2 dq Sin[a0 + da p] Sin[dq p + q0]) == 0, p]

on the fastest machine with the most memory you can buy and wait to see if it ever finishes.

Adding constraints on some or all values will sometimes speed the process up and sometimes greatly slow the process down. If you know some information about the system that would allow you to significantly simplify the problem then that might help a great deal, but trying to decide what would or would not be helpful can be very challenging.

The reason you are getting different answers is probably because you are using slightly different code than I did. That is why I always show exactly what all my input and output are from a single fresh run of any problem.

As an example, there was a question posed in the last few days about why there was a completely different result when all that was done was to change the name of a variable. Mathematica isn't like the old days with FORTRAN. There are literally thousands and often tens of thousands of lines of code and half a dozen completely different algorithms hiding behind a name as simple as Reduce and there is often nearly zero connection between what tiny change you make and how it will interpret the question. But you almost certainly could not justify writing your own code in FORTRAN to answer your question.

It is only a guess on my part, but I expect that if you do get the complete symbolic solution to this problem that the result will be far too complex to be of any use to you. I certainly may be wrong and there may be a simple two-line answer to your problem, but I doubt it.

Without specifying the values of the variables, with or without constraints on the variable ranges, I believe Reduce is probably your only viable option.

Throw the problem at the fast machine, wait a day and see if you get an answer. If not then give it a month and see if you get lucky. If you don't get it in a month then I would guess it would be very unlikely to be worth waiting a year. Unfortunately I don't believe there is any way to know whether it is making significant progress while you are waiting.

I hope it works

POSTED BY: Bill Simpson
Posted 12 years ago
POSTED BY: Wayne Roest
Posted 12 years ago
POSTED BY: Bill Simpson
Posted 12 years ago

I am using mathematica 8.0.4 by the way.

POSTED BY: Wayne Roest
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard