Solving equation with mathematica

In summary, the conversation discusses solving the equation a/x=Cosh[b/x] using NSolve and Maple. The expert suggests using FindRoot instead of NSolve and points out that the equation does not have any real roots. They also mention the use of FindInstance and specifying a complex number for the initial value in FindRoot to find complex roots.
  • #1
yashar
31
0
hi
i want to solve this equation
a/x=Cosh[b/x]

i set a=1 and b=5
and use NSolve code but mathematica say it can not solve it. but with maple i get real and imaginary parts.
1-is there another method to solve this equation numerically?
2-can this equation be solve for arbitrary a and b?

thanks
 
Last edited:
Physics news on Phys.org
  • #2
NSolve is only for polynomial equations. Use FindRoot instead.
 
  • #3
it gives me x=25.16 which is incorrect!
 
  • #4
If you rewrite the expression so that COSH(5/x) - 1/x = 0 = f(x) and plot, you will see that f(x) is asymptotic with the x axis. Therefore, there is no x value for which f(x) = 0
 
  • #5
Plotting it it seems that it does not have any real roots. So I think Maple is wrong, there are no real roots.

PS. SteamKing got it faster!
 
  • #6
I just found a new function: FindInstance. You can use it to find complex roots. Also, apparently you can specify a complex number for your initial value in FindRoot and it will search for a complex root, which I didn't know before.
 

1. How do I input an equation into Mathematica?

To input an equation into Mathematica, you can either type it directly into the input line using traditional mathematical notation, or use the "Insert" menu to select symbols and functions to build your equation. You can also copy and paste equations from other sources.

2. How do I solve an equation using Mathematica?

To solve an equation using Mathematica, use the "Solve" function. For example, if you have the equation 2x + 4 = 10, you can type "Solve[2x + 4 == 10, x]" into the input line and press enter. Mathematica will then give you the solution, x = 3.

3. Can Mathematica solve all types of equations?

While Mathematica is a powerful tool for solving equations, it may not be able to solve all types of equations. It is particularly useful for solving polynomial equations and systems of linear equations. It may struggle with more complex equations involving trigonometric functions or special functions.

4. How do I plot the solutions to an equation using Mathematica?

To plot the solutions to an equation using Mathematica, you can use the "ContourPlot" or "Plot3D" functions. These will graphically show the solutions to equations in two or three dimensions, respectively. You can also use the "Manipulate" function to create interactive plots of equations.

5. Can I save my equations and solutions in Mathematica?

Yes, you can save your equations and solutions in Mathematica by using the "Save" function. This will create a file with the extension ".nb" which can be opened and edited in Mathematica. You can also export your equations and solutions in various formats, such as PDF or HTML, for sharing with others.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
111
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
240
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top