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에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by