Linsolve broken recently? was Re: Oscillatory integrals
Subject: Linsolve broken recently? was Re: Oscillatory integrals
From: Richard Fateman
Date: Fri, 27 Sep 2013 10:31:23 -0700
This new version makes LevinInt work:
LevinInt(f,g,a,b,omega,k):= block([varlist,p,pointlist,sol,ratprint:false],
varlist: makelist(alpha[i],i,0,k-1),
p: varlist . makelist(x^i,i,0,k-1),
pointlist : makelist(a+ (b-a)*i/(k-1),i,0,k-1),
define(eq(x), diff(p,x)+%i*omega*diff(f,x)*p-g),
sol:linsolve(eqs:map(eq,pointlist),varlist),
define(H(x), exp(%i*omega*f)*float(expand(ev(p,sol)))),
rectform(H(b)-H(a)))$
The only change is from
define(H(x), exp(%i*omega*f)* ev(p,sol)),
to
define(H(x), exp(%i*omega*f)**float(expand*(ev(p,sol)*))*),
strictly speaking, the float() or it could be bfloat() is not necessary,
but the expand() is. I think linsolve provides bad (ill-conditioned)
pivot elements when
coefficients are complex.
...
> (%i3) LevinInt(sinh(x),cos(x),-1.0,1.0,1000,7);
The results from linsolve look substantially different from Maxima 5.25
and 5.29.
They apparently handle this somewhat ill-conditioned system in different
ways. I think the new version is not as good as the old one on this
system, but I'm not sure why. Shouldn't the exact solution to an exact
system
be the same?
Anyway, the new version seems to give rectform indigestion.
The new version may produce a kind of factored form that is like
tiny*(huge+ huge*%i)
I'm hoping that someone else will diagnose this better.