how to use vpasolve to solve the equation sin(x)==0 in the range of (0,5] instead of [0,5]?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Dyuman Joshi
am 23 Sep. 2023
"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?
Antworten (1)
Walter Roberson
am 23 Sep. 2023
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])
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 Kommentare
David Goodmanson
am 23 Sep. 2023
Bearbeitet: David Goodmanson
am 24 Sep. 2023
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.
Walter Roberson
am 23 Sep. 2023
That suggests,
syms x
sol = pi * vpasolve(sinc(x) == 0, x, [0 5/pi])
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!