Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Evaluate double integral

Subject: Evaluate double integral

From: Paul

Date: 17 Aug, 2010 13:27:24

Message: 1 of 2

Hello.
I have two integrals (S is integral):
 I(t)=S(f(x,t))dx
 B(t)=S(g(x,t))dx

function dblquad is used to find integral SS(f(x,t)*g(x,t))dxdt
But is there exist some way to find the following integral:

S(I(t)*B(t))dt

May be some numerical methods.
Please help, I just don't know how to do it.


Thanks in advance.

Subject: Evaluate double integral

From: Roger Stafford

Date: 17 Aug, 2010 19:02:05

Message: 2 of 2

"Paul " <unicybsatr@gmail.com> wrote in message <i4e2ns$pak$1@fred.mathworks.com>...
> Hello.
> I have two integrals (S is integral):
> I(t)=S(f(x,t))dx
> B(t)=S(g(x,t))dx
>
> function dblquad is used to find integral SS(f(x,t)*g(x,t))dxdt
> But is there exist some way to find the following integral:
>
> S(I(t)*B(t))dt
>
> May be some numerical methods.
> Please help, I just don't know how to do it.
> Thanks in advance.
- - - - - - - - -
  The easy way to do it is to consider it a triple integration problem. Matlab's 'triplequad' could handle it provided a three-dimensional rectangular volume is involved. The integrand would simply be f(x,t)*g(y,t), integrated with respect to x, y, and t. The x and y would range over the values you use for defining I(t) and B(t) and the t would range over the values you have for the final integral.

  On the other hand you could conceivably treat it as a double integration problem by defining the functions I(t) and B(t) in terms of results obtained from separate uses of one of the quadrature functions. Then you could prepare another function that would multiply these two values together to be used as an integrand in a second quadrature. The difficulty there would be that with matlab's quadrature routines this second quadrature function will be passing vectors, not scalars, to its integrand function. Since your integrand function has to do two integrations for each value in such a vector, you would have to provide your integrand function with this capability - meaning that there has to be a testing of the length of the vector passed to it and a for-loop with the corresponding count used to obtain the multiple integrand values.

  You can count on the latter being a slow process. However triple integration is not fast either and it might possibly be much slower than doing the more cumbersome double integration.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us