Questions about vpasolve about finding multiple solutions for nonpolynomial equation
8 views (last 30 days)
Show older comments
Xiao Lai
on 28 Sep 2018
Answered: Walter Roberson
on 28 Sep 2018
The following example show that the "vapsolve" can find multiple solutions for nonpolynomial equation.
syms x
f = x-tan(x);
for n = 1:3
vpasolve(f,x,'random',true)
end
But I want to limit the range of variables, so I changed previous codes like this:
syms x
f = x-tan(x);
for n = 1:3
vpasolve(f,x,[0 100],'random',true)
end
The results always produce the same results. How to solve this problem?
0 Comments
Accepted Answer
Walter Roberson
on 28 Sep 2018
_ = vpasolve(_,'Random',Random) uses a random starting point for finding solutions when 'Random' is set to true. Use this input to avoid returning the same solution repeatedly for nonpolynomial equations. If you specify starting points for all variables, setting 'Random' to true has no effect.
I tested with
assume(x>=0&x<=100)
with that in effect, some negative x values were found and some x values greater than 100 were found, but the range was much less than if the assume was not in effect.
0 Comments
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!