Numerical problem



Ram, here are some random comments, in addition to what everyone else said.

On 9/14/07, amli at comcast.net <amli at comcast.net> wrote:

> p:192.6988*sin(th)^2+4.9619*cos(th)^2;
> q:4.9619*sin(th)^2+8.0665*cos(th)^2;
> r:4.9619*sin(th)^2+2.4489*cos(th)^2;
> t:-7.69*cos(th)*sin(th);

Better to write this as p : p1 * sin(th)^2 + p2 * cos(th)^2; etc,
and assign values to p1 and p2 only after taking the symbolic
treatment as far as you can.

> v11:ratsubst(1-sin(th)^2,cos(th)^2,ev(v1));
> v22:ratsubst(1-sin(th)^2,cos(th)^2,ev(v2));

Calling ev is useful in some rather narrow circumstances,
which doesn't include the present case, I think.
If you write just ratsubst(..., v1) then v1 is evaluated before
ratsubst processes it. For most Maxima functions, the
arguments are evaluated before the function is called
(and for the others, writing ev(my_argument) probably won't help).

>    dd:ev(sol2[1].sol2[2]);
>    radcan(dd);
>    ratsubst(%pi/3,th,dd);
>
>    ratsubst(%pi/3,th,ev(sol2[1].sol2[2]));

In addition, you might find ratsimp is a useful function.

(%o22) -40097501137496861237157027/13068951382041112994598500000000

Actually, this isn't such a big number.
-40097501137496861237157027/13068951382041112994598500000000, numer;
 => - 3.0681498434983395E-6
which seems OK considering the floating point numbers
appearing in the calculations have about 5 or 6 figures in them.

HTH

Robert Dodier