Re: MuPAD 3.0 code gives strange result
- From: "John O'Flaherty" <quiasmox@xxxxxxxxx>
- Date: 15 Apr 2006 09:30:26 -0700
Brad Cooper wrote:
A question about MuPAD 3.0
If I execute this code, the numeric solution returned is
1.0339735, for all values of t, including t=PI/6.
reset():
t := PI/6:
c := 9: d := 4: r := 2:
s := sqrt(c^2*sin(x)^2+d^2*cos(x)^2):
f := tan(t)-tan(x)*(c^2-r*s)/(d^2-r*s):
//plotfunc2d(tan(x)*(c^2-r*s)/(d^2-r*s),x=0..PI/2);
numeric::solve(f,x=0..PI/2,RestrictedSearch);
If I include the plot by removing the // and execute it
again, the numeric solution is 0.062740333399
which I think is correct and the solution varies as t
is changed.
My question is - why does the solution to the function
change if I plot something first?
It seems to be a bug. The same behavior can be demonstrated more
simply:
reset()
numeric::solve(tan(x),x=PI/2..PI)
result is {1.570796327} , or PI/2. It incorrectly calls the sign
change from plus infinity to minus infinity a solution.
If you then change the search range
numeric::solve(tan(x),x=PI/2-.0001..PI)
it gives
Warning: Package redefined [package]
{3.141592654}
( the correct answer).
It then continues to give the right answer even if the range is set to
the original range, PI/2..PI.
--
john
.
- References:
- MuPAD 3.0 code gives strange result
- From: Brad Cooper
- MuPAD 3.0 code gives strange result
- Prev by Date: Re: maxima and symbolically finding eigenvalues
- Next by Date: Re: SOLVED - Excessive Mathematica CPU usage on Solaris 10
- Previous by thread: MuPAD 3.0 code gives strange result
- Next by thread: a polynomial system; Grobner bases?
- Index(es):
Relevant Pages
|
|