Can vpasolve restrict the numerical solution to be a real number? If it can, how should I stipulate this condition?
30 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Dyuman Joshi
el 24 de Abr. de 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 comentarios
jessie sun
el 25 de Abr. de 2022
3 comentarios
Walter Roberson
el 25 de Abr. de 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.
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!