How to set the interval of the solution when I use "vpasolve" to solve an equation?

7 次查看(过去 30 天)
I want to solve an equation using "vpasolve" in MATLAB R2018a, equations may have more than one solutions, for example, 'x^2-1==0' has two solutions: -1 and 1, but if I limit the interval of the solutions to be [0,2], then only one solution left.
So how can I limit the interval to filter the solutions when I use "vpasolve" to solve an equation? Anyone can show me the simplest way? Thank you!

采纳的回答

Walter Roberson
Walter Roberson 2023-10-31
vpasolve() and pass a list of equations as the first parameter.
Pass a list of variables in the second parameter.
In the third parameter pass as many rows as there are variables. If you pass a column vector then each row is the starting value for the corresponding variable from the second parameter. If you pass an array with two columns then the first column is the lower bound and the second column is the upper bound. You can pass -inf as a lower bound or +inf as an upper bound.
Be careful that what you pass is row oriented. If you are were to try to pass a row with one value per variable (initial value) then that would fail.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by