Can vpasolve restrict the numerical solution to be a real number? If it can, how should I stipulate this condition?
34 ビュー (過去 30 日間)
古いコメントを表示
I have eight unknown variables and eight equations. Now I use the vpasolve to find the numerical solution of the equation, hoping to get only the real solution, but the vpasolve only returns a complex solution. Can I restrict the it to output only real solutions? If I can, how should I implement it? Thank you for your reply.
0 件のコメント
回答 (2 件)
Dyuman Joshi
2022 年 4 月 24 日
Taken from vpasolve documentation
syms x
S = vpasolve(x^6 - x^2 == 3, x)
assume(x,'real')
S = vpasolve(x^6 - x^2 == 3, [-Inf Inf])
0 件のコメント
jessie sun
2022 年 4 月 25 日
3 件のコメント
Walter Roberson
2022 年 4 月 25 日
Tips:
vpasolve ignores assumptions set on variables. You can restrict the returned results to particular ranges by specifying appropriate search ranges using the argument init_param.
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!