Ask Your Question
1

Finding all the roots at once numerically

asked 2011-05-05 00:17:27 -0600

updated 2011-05-05 08:32:32 -0600

I want to calculate the roots of equations like

tanh(ax) = x

numerically. But the problem is sage gives option of finding just one root provided I give it the interval where the root may be found.

(tanh(1.5*x)==x).find_root(0.5,2)

But sometimes the interval is not so obvious and I need to know all the numerical roots at once (If the number of roots are finite that is). Is There a way to do that?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
3

answered 2011-05-05 08:25:53 -0600

updated 2011-05-05 14:32:09 -0600

Returning only one root in a given interval is not a limitation of Sage, per se. Without any sort of "insight" into the given function, the number of roots, whether there are an infinite number of roots, or the approximate locations of the roots are all impossible to determine.

In practice, one must have some understanding the behavior of the function in order to use numerical methods to find all roots.

In the given case $f(x) = \tanh(a \cdot x) - x$:

  • If $a \leq 1$, then the only root of $f(x)$ is $x = 0$.

  • If $a > 1$, then there are three distinct roots: $0$, $r$, and $-r$. It can be shown that $0 < r < 1$.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-05-05 00:17:27 -0600

Seen: 1,558 times

Last updated: May 05 '11
{"cc_re__cc_re__cc_by_sa_3_0_le": ["\"/question/8890/how-to-find-a-local-maximum/\">how to find a local maximum?</a> </p> <p> <a href=\"/question/8042/does-sage-show-steps-to-solving-an-equation/\">Does Sage show steps to solving an equation?</a> </p> <p> <a href=\"/question/9506/how-to-solve-an-implicit-differential-equation-numerically/\">How to solve an implicit differential equation numerically?</a> </p> </div> </div> </div> </div> <!-- template footer.html --> <div id=\"ground\"> <div class=\"content-wrapper\"> <div class=\"copyright\"> <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\"> <img\n                            class=\"license-logo\"\n                            src=\"/m/default/media/images/cc-by-sa.png?v=19\"\n                            title=\"cc-by-sa\"\n                            alt=\"cc-by-sa\"\n                        /> </a>\n                \n                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share", "wrapper\"> <div class=\"copyright\"> <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\"> <img\n                            class=\"license-logo\"\n                            src=\"/m/default/media/images/cc-by-sa.png?v=19\"\n                            title=\"cc-by-sa\"\n                            alt=\"cc-by-sa\"\n                        /> </a>\n                \n                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share Alike 3.0</a> license.\n\n            </div> <div class=\"footer-links\" > <a href=\"/about/\">about</a><span class=\"link-separator\"> |</span> <a href=\"/faq/\">faq</a><span class=\"link-separator\"> |</span> <a href=\"/help/\" title=\"help\">help</a> <span class=\"link-separator\"> |</span> <a href=\"/privacy/\">privacy policy</a><span class=\"link-separator\"> |</span> <a href=\"/terms/\">terms of service</a> </div> <div class=\"powered-link\"> <a href=\"http://askbot.com\" target=\"_b"], "copyright__copyright__copyright": ["ll roots.\n\nIn the given case $f(x) = \\tanh(a \\cdot x) - x$:\n\n  \u2022 If $a \\leq 1$, then the only root of $f(x)$ is $x = 0$.\n\n  \u2022 If $a > 1$, then there are three distinct roots: $0$, $r$, and $-r$. It can be shown that $0 < r < 1$.\n\nedit flag offensive delete link more\n\nYour Answer\n\nPlease start posting anonymously - your entry will be published after you log in or create a new account.\n\nAdd Answer\n\nQuestion Tools\n\nStats\n\nAsked: 2011-05-05 00:17:27 -0600\n\nSeen: 1,558 times\n\nLast updated: May 05 '11", "ll roots.\n\nIn the given case $f(x) = \\tanh(a \\cdot x) - x$:\n\n  \u2022 If $a \\leq 1$, then the only root of $f(x)$ is $x = 0$.\n\n  \u2022 If $a > 1$, then there are three distinct roots: $0$, $r$, and $-r$. It can be shown that $0 < r < 1$.\n\nedit flag offensive delete link more\n\nYour Answer\n\nPlease start posting anonymously - your entry will be published after you log in or create a new account.\n\nAdd Answer\n\nQuestion Tools\n\nStats\n\nAsked: 2011-05-05 00:17:27 -0600\n\nSeen: 1,558 times\n\nLast updated: May 05 '11"]}