Questions about vpasolve about finding multiple solutions for nonpolynomial equation

8 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Walter Roberson
Walter Roberson il 28 Set 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.

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by