help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: definite numerical integration


From: David Bateman
Subject: Re: definite numerical integration
Date: Wed, 21 Sep 2005 12:02:55 +0200
User-agent: Mozilla Thunderbird 0.8 (X11/20040923)

roberto wrote:

hello,
i need some hint about the following topic:

1. take a function f(r; a), where "a" is a parameter, whose analytical
form i don't know explictly but i can evaluate it point by point in a
given interval [0,r_max]
(i already wrote Octave code for this);

2. i have to evaluate the definite integral of f(r; a) in [0,r*]
(where r*<r_max);

3. doing this, evaluating the integral by varying r* in [0,R] (e.g. R = 110)
i'll have a function F(r*,a) where a should be obtained by imposing
some boundary condition;

i looked for some help into Octave like http://octave.sourceforge.net/index/Q.html

but in libraries like:
[v, ier, nfun, err] = quad (f, a, b, tol, sing)
the function to be integrated are to be inserted by their explicit formulation
which i don't have now, as already stated above;

I don't quite see the problem as in 1) you saw you have a function to numerically calculate the values in a range [0,r_max] and then in 3) you state you can use a explicit formulation

What about something like

function y = fun (x)
# Nasty integrable singularity to be unkind to quad and show octave's better here :-)
 y  = 1/x;
endfunction

[v, ier, nfun, err] = quad (@fun, 1, 3, 1e-6)

I was going to integrate over the range [-1:1] above, but that seems to seg-fault in dqpsrt.f.
Looking at it...

Cheers
David




thank you very much for any help about this topic, since it's the last
step of my work up to now
bye


--
David Bateman                                address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]