Message Boards Message Boards

GROUPS:

No output in solving system of trigonometric equations

Posted 24 days ago
405 Views
|
10 Replies
|
5 Total Likes
|

Hello everybody, I hope you are doing all well today. I'm new to Mathematica, I have a system of equations that I want to solve using Mathematica:

$\begin{equation} \begin{cases} sin(x)cos( \epsilon y)cosh(\epsilon z) + sin(\epsilon x)cos(y)cosh(z) - sin(x(1 + \epsilon)) = 0 \\ sin(x)sin(\epsilon y)sinh(\epsilon z) + sin(\epsilon x)sin(y)sinh(z) = 0 \end{cases} \end{equation}$

I'm only interested in {x, y, z} values in the domain [0, 2*Pi]
$\epsilon$ is a parameter that can take any value between 1.8 to 3. I tried solving the problem first by setting $\epsilon = 2$, I used methods like Solve and Nsolve, but it didn't work. it took too much time to execute without any result. after a long day I found out about Reduce function, i used it and it works it gave me the full answer. but that's only for the case of $\epsilon = 2$. When I change $\epsilon$ to 2.5 it didn't gave me any answer. I left it to run to about 10 hours or more without any result.
This is my fifth day with this problem, and I'm still stuck.

can anyone provide me with any advices. I really appreciate your help. Thank you so much

This is my code for the case of $\epsilon = 2$

Reduce[{
 Sin[x]*Cos[2.5*y]*Cosh[2.5*z] + Sin[2.5*x]*Cos[y]*Cosh[z] - 
    Sin[3.5*x] == 0,
  Sin[x]*Sin[2.5*y]*Sinh[2.5*z] + Sin[2.5*x]*Sin[y]*Sinh[z] == 0, 
  0 <= x <= 2*Pi, 0 <= y <= Pi, 0<= z <= 2*Pi}, {x, w, y}, Reals]
10 Replies

Have you any reason to think that there exist nontrivial solution to your equations? This plot may suggest that the only solution may be x==0, except for periodicity:

eqs = Rationalize[{Sin[x]*Cos[2.5*y]*Cosh[2.5*z] + 
      Sin[2.5*x]*Cos[y]*Cosh[z] - Sin[3.5*x] == 0, 
    Sin[x]*Sin[2.5*y]*Sinh[2.5*z] + Sin[2.5*x]*Sin[y]*Sinh[z] == 0, 
    0 <= x <= 2*Pi, 0 <= y <= Pi, 0 <= z <= 2*Pi}];
RegionPlot3D[Evaluate@And @@ eqs,
 {x, 0, Pi/100}, {y, 0, Pi}, {z, 0, 2 Pi}]

This is confirmed by solving with specific values for y,z, for example

Reduce[And @@ eqs && y == Pi/10 && z == Pi/11,
 {x, y, z}]

Hello Gianluca Gorni, Thank you for your help.
Yeah, I have a reason to think that there are multiple solutions to my equations ignoring periodicity.
The source of the two equations is This one:

$sin(x)cos(\epsilon k) + sin(\epsilon x)cos(k) - sin((1 + \epsilon)x) == 0$

Where k is a real variable.

In this case the solution is simple, below are the two graphs representing the solutions for the case of $\epsilon = 2.5$

Now I want a general solution assuming k is imaginary
Taking k to be imaginary ( $ k = y + i z $) and doing a little bit of math to separate the real part from the imaginary part of the equation, the previous equation becomes :
$sin(x)cos(\epsilon y)cosh(\epsilon z) + sin(\epsilon x)cos(y)cosh(z) - sin((1+\epsilon)x) + j ( sin(x)sin(\epsilon y)sinh(\epsilon z) + sin(\epsilon x)sin(y)sinh(z)) == 0$

Which gives me a system of two equations to solve.

$\begin{equation} \begin{cases} sin(x)cos(\epsilon y)cosh(\epsilon z) + sin(\epsilon x)cos(y)cosh(z) - sin((1+\epsilon)x) = 0 \\ sin(x)sin(\epsilon y)sinh(\epsilon z) + sin(\epsilon x)sin(y)sinh(z) = 0 \end{cases}\,. \end{equation}$

So the solution to this system should give the same solution as the solution to the first equation when $z = 0$. When $z$ is different from zero that should give additional solutions

Attachment

Attachments:

You are right, the RegionPlot that I made was wrong. Maybe this is a better visualization of the set of solutions, first as the intersection of two surfaces, and then as a collection of lines:

eqs = Rationalize[{Sin[x]*Cos[2.5*y]*Cosh[2.5*z] +
      Sin[2.5*x]*Cos[y]*Cosh[z] - Sin[3.5*x] == 0,
    Sin[x]*Sin[2.5*y]*Sinh[2.5*z] +
      Sin[2.5*x]*Sin[y]*Sinh[z] == 0}];
ContourPlot3D[Evaluate[eqs],
 {x, 0, 2 Pi}, {y, 0, Pi}, {z, -2, 2},
 AxesLabel -> Automatic, Mesh -> None]
ContourPlot3D[Evaluate[eqs[[1]]],
 {x, 0, 2 Pi}, {y, 0, Pi}, {z, -2, 2},
 MeshFunctions -> Function @@ {{x, y, z}, eqs[[2, 1]]},
 Mesh -> {{0}}, BoundaryStyle -> None,
 ContourStyle -> None, AxesLabel -> Automatic]

Maybe an explicit analytical solution is too difficult.

Yeah, Thank you so much, this is now a better visualization.

Maybe as you said that "an explicit analytical solution is too difficult."

I'm not interested so much in finding an analytical solution, what I want is just a plot of the solutions. Can I instead of a 3D ContourPlot get just a 2D plot of the variables like {x, y} and {x, z}.

If anyone knows of other methods that I can use to find the solutions, That will be really helpfull.

I really appreciate your help, Thank you so much.

Here is close up of a loop of solutions:

ContourPlot3D[
 Evaluate[eqs[[1]]], {x, 3.75, 4.3}, {y, 1.25, 1.44}, {z, -.4, .4}, 
 MeshFunctions -> Function @@ {{x, y, z}, eqs[[2, 1]]}, Mesh -> {{0}},
  BoundaryStyle -> None, ContourStyle -> None, AxesLabel -> Automatic]

It does not seem to be planar.

Is there a way to extract the solutions from the ContourPlot.

Thank you so much.

Yes:

Cases[plot, _GraphicsComplex, All]

Thank you so much, I'm really grateful for your help.

I used your code to extract the data from the ContourPlot, and plot just the X values with respect to Y values below is the plot I got (What I did is like a projection onto the (x, y) plan )

enter image description here

It's close to what I want, but it's a little bit messy to understand. is the colored region repesent the allowed solutions while the blank region represent the forbidden ones?

And one last question, please, Could I instead of extracting all the cordinates from the plot, I extract just the cordinates of the boundries not the whole surface.

Hmm, the GraphicsComplex apparently stores the information on all the surfaces, not just the lines we are interested about. We can extract the lines with Normal:

plot = ContourPlot3D[Evaluate[eqs[[1]]],
   {x, 3.75, 4.3}, {y, 1.25, 1.44}, {z, -.4, .4},
   MeshFunctions -> Function @@ {{x, y, z},
      eqs[[2, 1]]}, Mesh -> {{0}}, BoundaryStyle -> None,
   ContourStyle -> None, AxesLabel -> Automatic];
lns = Cases[Cases[plot, _GraphicsComplex, All][[1]] // Normal,
    _Line, All][[{1, 4, 5}]];
Graphics3D[lns, AxesLabel -> {x, y, z}, Axes -> True]
sols = Cases[lns, {_Real, _, _}, All];
eqs /. Equal -> List /. Thread[{x, y, z} -> sols[[1]]]
Row[{Graphics[lns /. {x_Real, y_, z_} :> {x, y},
   Frame -> True, FrameLabel -> {x, y}],
  Graphics[lns /. {x_Real, y_, z_} :> {x, z},
   Frame -> True, FrameLabel -> {x, z}],
  Graphics[lns /. {x_Real, y_, z_} :> {y, z},
   Frame -> True, FrameLabel -> {y, z}]}]

The points along the lines are not very accurate solutions, but you can use them as starting points for iterative methods.

Okey, I understand.

I'm grateful for your help, Thank you.

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