필터 지우기
필터 지우기

how to use vpasolve to solve the equation sin(x)==0 in the range of (0,5] instead of [0,5]?

조회 수: 3 (최근 30일)
I want to solve sin(x)=0 in the open interval of (0,5], but it seems vpasolve supports close interval only. So it is not able to give the answer I want.
Of course we can use solve and assume instead, but in my real case I have to use vpasolve because of accuracy reason.
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 9월 23일
"Of course we can use solve and assume instead, but in my real case I have to use vpasolve because of accuracy reason."
Can you elaborate on this?
Are you saying that there accuracy issues when using symbolic variables with solve?
Sam Chak
Sam Chak 2023년 9월 23일
You mentioned using the vpasolve() due to accuracy reasons. Could you please specify the answer you expect from solving the equation, in the left-open interval , or ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 9월 23일
vpasolve() does not support open or semi-open intervals.
The trick is to use
syms x
sol = vpasolve(sin(x)==0, x, [1e-63 5])
sol = 
3.1415926535897932384626433832795
I do not understand at the moment why left bounds smaller than 1e-63 appear to be treated as 0, even if you state them symbolically such as sym(10)^-80
  댓글 수: 9
David Goodmanson
David Goodmanson 2023년 9월 23일
편집: David Goodmanson 2023년 9월 24일
syms x
sol = vpasolve(sin(x)/x==0, x, [0 5])
sol =
3.1415926535897932384626433832795
Ok, admittedly it's a method particular to this problem. On the other hand it doesn't hurt to keep in mind that zeros can be removable, just as poles can be removable.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by