Re: Error using quad...




"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


.



Relevant Pages

  • Re: Positive/Negative after taking the square root
    ... logical reason for this? ... the confusion: ... You cannot make a substitution u for x which has ... the interval of integration, i.e. a and b are ...
    (sci.math)
  • Re: Numerical integration with many points
    ... steps and use Boole's rule to perform the integration. ... I would recommend VERY STRONGLY analytically ... continuing into the complex plane, ... choose the exponentially decreasing direction, ...
    (sci.math.num-analysis)
  • Re: Implicit integrals?
    ... non-homogeneous Fredholm equation and there are many ways (e.g. series ... integration, or perhaps use some kind of higher-order integration, and ... The reason I ask is that you originally ... fixed point iterations." ...
    (comp.soft-sys.matlab)
  • Re: Self-teaching of integration methods
    ... > He apparently didn't realize that the reason that I'm not a ... and I think that teaching them will go OK. ... > However, when I hit the part in my book about integration techniques, I ... > integration by parts well beyond the scope of a typical high school ...
    (sci.math)
  • RE: 9.30 upgrade: 9.40 or 10?
    ... Taking this long on testing and integration, I would recommend version ... re-writes to accommodate the new libraries, ... Prev by Date: ...
    (comp.databases.informix)

Loading