On Wednesday 11 May 2005 15:55, Viktor T. Toth wrote:
> Your legendre_root function, used in
>
> x : legendre_root(order,i),
>
> returns a number, e.g.:
>
> (%i46) legendre_root(4,0);
> sqrt(15 - 2 sqrt(30))
> (%o46) - ---------------------
> sqrt(35)
>
> This number is then supplied as the function argument xi:
>
> sum : sum + (w * func(x))),
>
> to your anonymous (lambda) function. The function then calls diff() with
> xi as its second argument, i.e., it tries to differentiate with respect
> to a number, as opposed to a variable:
Yes, I understand. I guess I was asking how should I go about writing this
thing 'correctly'?
Can I call func so that it performs the analytic differentiation and then
substitute for values of x?
> quad(order,func):=
> block([sum, x, w],
> sum:0,
> for i:0 thru order-1 do (
> x : legendre_root(order,i),
> w : gauss_legendre_weight(order,i),
> sum : sum + (w * func(x))),
> return(sum)
> )$
Angus
ps Incidentally, it is possible to read this m/l through the gmane interface
nttp://nttp.gmane.org/gmane.comp.mathematics.maxima.general but it is not
possible to post messages to the list this way, even though I'm subscribed.
Mail delivery failed: returning message to sender
From: Mail Delivery System
To: gcsm-maxima@gmane.org
Date: Today 16:12:04
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
maxima@www.math.utexas.edu
SMTP error from remote mailer after RCPT TO::
host ironmaiden3.mail.utexas.edu [128.83.32.56]:
550 #5.1.0 Address rejected.
Is that meant to be the case? It doesn't happen with other m/l to which I'm
subscribed?
A.