Can vpasolve restrict the numerical solution to be a real number? If it can, how should I stipulate this condition?
33 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Dyuman Joshi
on 24 Apr 2022
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 Comments
jessie sun
on 25 Apr 2022
3 Comments
Walter Roberson
on 25 Apr 2022
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.
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!