|
From: | Kenneth Geisshirt |
Subject: | Re: [Help-gsl] Can you do this in GSL? |
Date: | Mon, 17 Jan 2005 20:13:33 +0100 |
User-agent: | Mozilla Thunderbird 0.9 (X11/20041124) |
Anders Misfeldt wrote:
I wrote the integral wrong. Sorry! The correct function is: 0.067*b^3 = \int_0^b x^2/(exp(x)+1) dx
Assume that F(b) = \int_0^b x^2/(exp(x)+1) dx. Your equation is then 0.067*b^3 = F(b) - F(0) = F(b). Now differentiate wrt b, and you have 0.2*b^2 = F'(b) = f(b).
You can calculate f(b) as a finite difference, f(b) = (F(b+h)-F(b-h))/2h. In general you can calculate F(b) using an integration function found in GSL. Last, your solve the equation G(b) = f(b)-0.2*b^2 = 0 using a nonlinear equation solver in GSL.
-- Kenneth Geisshirt, M.Sc., Ph.D. -- http://kenneth.geisshirt.dk/ GPG Fingerprint: CEC4 7449 1B9B C8A5 7679 F062 DDDF 020E F812 4EE3
[Prev in Thread] | Current Thread | [Next in Thread] |