Multiple Integrals Without Using Symbolic

1 view (last 30 days)
ahmad
ahmad on 29 Mar 2014
Answered: Roger Stafford on 30 Mar 2014
Hi everyone, I need to solve this problem in matlab, Is there anyway I can do it without using symbolic integration ?
where a,b & c are constant.

Answers (1)

Roger Stafford
Roger Stafford on 30 Mar 2014
To my knowledge, 'integral2' is incapable of handling this kind of problem. Instead it will be necessary for you to write a function which calculates f(x) + exp(the integral from x to x+5 of f(y) w.r. to y). You can then use the function handle of this function as the integrand for 'integral'. Presumably you will also use matlab's 'integral' function to calculate this function handle. The latter must adhere to the requirement that it accept x in vector form as described in the documentation: "Integrand, specified as a function handle, defines the function to be integrated from xmin to xmax. For scalar-valued problems, the function y = fun(x) must accept a vector argument, x, and return a vector result, y" which is to be found at:
http://www.mathworks.com/help/matlab/ref/integral.html
This undoubtedly means that you must construct a for-loop to handle such vector inputs and do the calculation one element at a time, each time calling on 'integral' and then applying 'exp' to the result and finally adding f(x) to it.
In other words, you will have to do the double integration in terms of two single integrations, with the results of one integration being used in the integrand of the second integration. It's awkward, but I don't know of any shortcuts.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!