필터 지우기
필터 지우기

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.

답변 (2개)

Dyuman Joshi
Dyuman Joshi 2022년 4월 24일
syms x
S = vpasolve(x^6 - x^2 == 3, x)
S = 
assume(x,'real')
S = vpasolve(x^6 - x^2 == 3, [-Inf Inf])
S = 

jessie sun
jessie sun 2022년 4월 25일
Dear @Dyuman Joshi, I used "assume" to restrict the unknown variables to be real numbers:
But the output result was not as I expected:
  댓글 수: 3
Walter Roberson
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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by