1
$\begingroup$

I have an equation which is not analytically solvable,
thus I need to solve it numerically.
But, this equation has some free parameters which I want to replace them with some numbers after solving the equation

.
Let me ask a very simplified version of the question,
then I can solve the original one by the help of this simplified version.

I have an equation with the form of $a\space x^5+b\space sin(x)+3=0 $.
Now, I want to plot the root of this equation in the a-b coordinate system.

In another word,
I want to fix the root and see how it behaves by changing our free parameters, $a$ and $b$.

$\endgroup$
2
$\begingroup$

You can try ContourPlot3D:

ContourPlot3D[a x^5 + b Sin[x] + 3 == 0, 
  {a, -1, 1}, {b, -1, 1}, {x, -2 Pi, 2 Pi}, 
  AxesLabel->{"a","b","x"}]

enter image description here

Alternatively, use ContourPlot to show combinations of a and b that make a given x the root and vary x interactively using Manipulate:

Manipulate[ContourPlot[a x^5 + b Sin[x] + 3 == 0, {a, -1, 1}, {b, -1, 1},  
     FrameLabel -> {"a", "b"}], 
  {{x, Pi/2}, -2 Pi, 2 Pi, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you so much for your help. How can I transform this plot into two-dimensional a-b coordinate system for constant x? $\endgroup$ – Mehrdad Jun 19 at 0:31
  • $\begingroup$ @Mehrdad, please see the updated version. $\endgroup$ – kglr Jun 19 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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