Message Boards Message Boards

0
|
3781 Views
|
9 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Solve this equation?

Anonymous User
Anonymous User
Posted 7 years ago

I can't figure out how to constrain a solution I'm getting from Mathematica into a more specific solution I'm seeking. There's a variable I want to eliminate from the solution, but my attempts haven't succeeded.

Mathematica confirms that the equation is true when answer == -1/(4p):

In[114]:= myTransformParameterized[p] == 
  factor myFunction[answer, s ] /. {answer -> -1/(4 p)}

Out[114]= True

But when I try to obtain this solution automatically, I can't quite get it:

In[115]:= PowerExpand[
 FullSimplify[
  Solve[
   myTransformParameterized[p] == factor myFunction[answer, s],
   answer
   ],
   s \[Element] Reals && p > 0 && answer \[Element] Reals
  ]
 ]

Out[115]= {{answer -> 
   ConditionalExpression[(-(s^2/(4 p)) + 2 \[Pi] C[1])/s^2, 
    C[1] \[Element] Integers]}}

There's an s in the automatic solution, and I'd like to eliminate it, but I don't know how.

I'm attaching a Notebook that completely demonstrates my issue.

Thanks.

Attachments:
POSTED BY: Anonymous User
9 Replies
Anonymous User
Anonymous User
Posted 7 years ago

Here, the difference between equation 1 and equation 2 makes a difference I never would have predicted:

In[1]:= $Assumptions = x \[Element] Reals && p \[Element] Reals;

In[2]:= equation1 := E^{I answer x} == E^{I p x};

In[3]:= equation2 := E^{I answer x} == E^{-I p x};

In[4]:= Solve[Eliminate[equation1, x], answer]

Out[4]= {{}}

In[5]:= Solve[Eliminate[equation2, x], answer]

During evaluation of In[5]:= Eliminate::ifun: Inverse functions are being used by Eliminate, so some solutions may not be found; use Reduce for complete solution information.

Out[5]= {{answer -> -p}}

In[6]:= Reduce[Eliminate[equation1, x], answer]

Out[6]= True

In[7]:= Reduce[Eliminate[equation2, x], answer]

During evaluation of In[7]:= Eliminate::ifun: Inverse functions are being used by Eliminate, so some solutions may not be found; use Reduce for complete solution information.

Out[7]= answer == -p || p == 0 || x == 0
POSTED BY: Anonymous User

Getting a result of {{}} means that Eliminate found every equation in its "intermediate result" to depend on x, hence removed them all, hence the equations provided are, after elimination, vacuously true. Again, because this involved transcendental rather than algebraic equations in x, I would not ascribe much meaning to this outcome.

POSTED BY: Daniel Lichtblau
Anonymous User
Anonymous User
Posted 7 years ago
In[1]:= E^{I answer x^2} == E^{-I x^2/(4 p)};

In[2]:= Eliminate[%, x]

During evaluation of In[2]:= Eliminate::ifun: Inverse functions are being used by Eliminate, so some solutions may not be found; use Reduce for complete solution information.

Out[2]= 4 answer p Log[E^((I x^2)/(4 p))] == -((I x^2)/(4 p))

In[3]:= PowerExpand[%]

Out[3]= I answer x^2 == -((I x^2)/(4 p))

In[4]:= SolveAlways[%, x]

Out[4]= {{answer -> -(1/(4 p))}}

The "Eliminate" doesn't actually eliminate x, but the answer depends on that step, for some reason that eludes me.

POSTED BY: Anonymous User

Elimination involving transcendental functions of the variable of interest is not always going to work. There are some tricks in Eliminate code for this, based on algebraicization using inverse functions, but that will not always work.

POSTED BY: Daniel Lichtblau
Anonymous User
Anonymous User
Posted 7 years ago

Thanks.

POSTED BY: Anonymous User

You have a desired equation. Turn it into an expression which we'll set to zero. You want it to happen independently of p so also set the derivative with respect to p to zero. This is a bit noisy inside Solve. We can further refine and a nice solution set emerges.

e1 = 
  myTransformParameterized[p] - factor myFunction[answer, s];
e1Dp = D[e1, p];
soln = 
 FullSimplify[Solve[{{e1, e1Dp} == 0}, {answer, s}], 
  Assumptions -> p > 0]

During evaluation of In[40]:= Solve::incnst: Inconsistent or redundant transcendental equation. After reduction, the bad equation is (I Sqrt[2] Sqrt[-I p])/p^2+4 (-((I Sqrt[-I p])/(2 Sqrt[2] p^2))-(Sqrt[-I p] s^2)/(4 Sqrt[2] p^3)) == 0.

During evaluation of In[40]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.

During evaluation of In[40]:= Solve::svars: Equations may not give solutions for all "solve" variables.

Out[40]= {{s -> 0}, {answer -> -(1/(4 p)), 
  s -> 0}, {answer -> -(1/(4 p)), s -> 0}}
POSTED BY: Daniel Lichtblau
Anonymous User
Anonymous User
Posted 7 years ago

Thank you. I'm getting good use out of this program, and this is just my first week using it.

POSTED BY: Anonymous User
Posted 7 years ago

Try this:

pro[E^x_] := x;

pro[E^(-((I s^2)/(4 p)))]

Solve[% == I answer s^2, answer]

{{answer -> -(1/(4 p))}}

POSTED BY: Z-X Z
Anonymous User
Anonymous User
Posted 7 years ago

Thank you. That is a good pattern-matching solution I had overlooked. However, it succeeds by easing the burden on Solve, but I'm trying to get a better handle on using Solve on more difficult problems (i.e., involving complex exponentials / branch-cuts). I'm still curious how I could properly call Solve to do it, without my passing Solve a simplified problem, as your solution does. I'm sure Solve (or Reduce) can do the whole thing, as the answer I received from Solve appears essentially correct (but it contains more information than I'm seeking).

POSTED BY: Anonymous User
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