Re: Quadrature problem



roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson) wrote in message
<fonfre$r42$1@xxxxxxxxxxxxxxxxxxxxxxx>...
In article <fonf2t$sdu$1@xxxxxxxxxxxxxxxxxx>,
Dmitriy <dmuravy2@xxxxxxxx> wrote:
Code below seems don't work any more
f = inline('r.*exp(-r.^2).*exp(r)')
[int,tol] = gaussq(f,0,inf,[.0000001,8])
??? Matrix index is out of range for deletion.

Error in ==> gaussq at 142
P0(1:istart)=[];

The context for this seems to have disappeared; perhaps it is
a very old thread.

Is there a particular reason you are using exp(-r.^2).*exp(r)
instead of the equivilent exp(-r) ? Assuming, that is,

Um, it is not true that

exp(-r.^2).*exp(r) == exp(-r)

There is a difference, and it is not just at
the LSB level. Please read through this
reference for a decent explanation of the
exponential function.

http://en.wikipedia.org/wiki/Exponential_function


that r is not in the range that you *want* -r^2 or exp(-r^2)
to underflow to 0 where exp(-r) would not?

Also, is there a particular reason (e.g., using an older Matlab)
that you are using inline instead of an anonymous function?

(If you were to change these two things, I would not expect
the error to go away; I do not know what the error is caused by.)

The poster wishes to compute a moment,
in this case, the first moment, of a gaussian
function, over a half infinite interval. The
approach was to use a numerical integration,
a Gauss-Laguerre method for integration
over the half infinite domain [0,inf].

John
.



Relevant Pages

  • Re: Quadrature problem
    ... Matrix index is out of range for deletion. ... The context for this seems to have disappeared; ... Also, is there a particular reason ...
    (comp.soft-sys.matlab)
  • Re: Musa ibn Nusair Albalawi
    ... I'm tempted to tag it for deletion. ... good article is not a legal reason for article deletion (which would ... (perhaps mention of his only surviving charter would be useful, ... historical record) an article on this man can only be so good. ...
    (soc.genealogy.medieval)
  • =?iso-8859-1?q?Re:_Torkel_Franz=E9n_is_dead?=
    ... people reason well in non-mathematical contexts." ... I took into account the context, and none of your discussion of the ... rather only that they do not have a talent for formal logic. ... don't have an APTITUDE for symbolic logic. ...
    (sci.logic)
  • Re: php requires ".php" not ".html" ?
    ... That is not an authoritative reason, and it's the only reason you ... Jerry is a single minded twit: he always relates any issue to his own very limited experience in a particular corporate environment. ... or how other peoples contexts differ from his own. ... There is a grain of truth in most of what he says, but its a grain that is far easier gleaned from other peoples posts, and they WILL give the context, and the reasoning behind the assertions. ...
    (comp.lang.php)
  • Re: 50 years later, Marvin Minsky still doesnt get it
    ... And for some reason which I can't grasp, you seem to think this is ... The result is that the associations developed over experience answer the ... the knowledge updates that need to happen are not evenly ... the most likely knowledge updates needed for any new context. ...
    (comp.ai.philosophy)