Questions about vpasolve about finding multiple solutions for nonpolynomial equation

8 ビュー (過去 30 日間)
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?

採用された回答

Walter Roberson
Walter Roberson 2018 年 9 月 28 日
_ = 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 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by