Can vpasolve restrict the numerical solution to be a real number? If it can, how should I stipulate this condition?
33 次查看(过去 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!