Re: Error using quad...
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Tue, 8 Nov 2005 09:12:58 -0500
"Roger Stafford" <ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:ellieandrogerxyzzy-0711051829350001@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> In article <dknnqo$e5e$1@xxxxxxxxxxxxxxxxxx>, "Steven Lord"
> <slord@xxxxxxxxxxxxx> wrote:
>>.......
>> I recommend John's solution, posted earlier in this thread; if you can't
>> use
>> that solution with FZERO for whatever reason, at least use the anonymous
>> function portion of that solution.
>> --
>> Steve Lord
> -------------------------
> Hello Steve Lord,
>
> I have a mild objection to the phraseology used in your last paragraph
> in response to the original poster of this thread. John D'Errico's
> solution is indeed a good one, as you indicated. He undoubtedly felt that
> it is important that the OP know how to make proper use of anonymous
> functions calling on 'quad' in problems of this general kind. My own
> solution was meant as a reminder to the OP that there is also the option
> of using explicit solutions to indefinite integrals when they are readily
> available, and that too is an important thing to remember.
You are correct.
> Your unqualified recommendation seemed to me to be stated in such a way
> that you appeared to regard the use of numerical integration in this
> situation as being somehow superior to that of explicit formulas for
> integrals. Perhaps you didn't mean it to be taken that way.
No, I didn't. I've seen too many cases where people throw an expression
into the INT function in the Symbolic Math Toolbox and complain when it
tells them that it can't find an explicit solution, and perhaps that's
affected how I view symbolic integration and when I recommend it. If you
interpreted my recommendation as somehow looking down on explicit formulae
for integrals or for symbolic integration used properly, I apologize.
> In terms of the number of computation steps required, reasonably simple
> explicit formulas such as the one available in this case, unquestionably
> furnish a more efficient method of solution for functions like 'fzero'
> than repeated calls on a numerical integration routine. There is also the
> added insight in a problem that can be gained by seeing an explicit
> formula for an integral, as opposed to having it be in implicit form with
> the use of calls to 'quad'. As I see it, the main argument for using
> 'quad' in this case would be the time involved on a user's part in having
> to look up indefinite integral formulas from integral tables. However, in
> most cases I would tend to regard that as time well spent in gaining a
> deeper understanding of problems one is faced with.
If a simple explicit formula exists for the integrand, then I agree it does
often pay to use it. Sometimes, though, you just have to use the numeric
solution, especially if a user-specified function is involved -- users seem
to tend to come up with some ... *ahem* strange and complicated inputs.
Both are useful tools.
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- References:
- Error using quad...
- From: ashesh
- Re: Error using quad...
- From: Steven Lord
- Re: Error using quad...
- From: Roger Stafford
- Error using quad...
- Prev by Date: Re: ignoring devide by zero
- Next by Date: Re: ignoring devide by zero
- Previous by thread: Re: Error using quad...
- Next by thread: Using a function within a function
- Index(es):
Relevant Pages
|
Loading