Understanding Integration in MATLAB: A Case Study

  • Context: MATLAB 
  • Thread starter Thread starter furkang
  • Start date Start date
  • Tags Tags
    Integration Matlab
Click For Summary
SUMMARY

This discussion focuses on the integration of a function using MATLAB's quad function. The user initially calculated the integral of the function F defined as F = inline('(2*x)+((x.^3)/0.000441)') from 0.01 to 0.05, receiving a result of 0.0059, which they questioned against a perceived correct value of 0.361. After analysis, it was concluded that the integral value of 0.0059 is accurate, as the user misinterpreted the difference F(0.05) - F(0.01) as the integral rather than recognizing it as an overestimation. The discussion highlights the importance of understanding integral calculations in MATLAB.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of numerical integration techniques
  • Knowledge of inline function definitions in MATLAB
  • Basic calculus concepts, particularly integration
NEXT STEPS
  • Explore MATLAB's quad function documentation for advanced usage
  • Learn about MATLAB's integral function for improved integration techniques
  • Study numerical integration methods such as Simpson's Rule and Trapezoidal Rule
  • Investigate error analysis in numerical integration to understand approximation accuracy
USEFUL FOR

MATLAB users, engineers, and students in mathematics or physics who are working on numerical integration and seeking to enhance their understanding of MATLAB's integration capabilities.

furkang
Messages
9
Reaction score
0
I used MATLAB to calculate the integration of a basic function.
I wrote :

F = inline('(2*x)+((x.^3)/0.000441)')

Q = quad(F,0.01,0.05)

I want to calculate integral of F from 0.01 to 0.05
the answer shown is 0.059
but the real answer is 0.361

I am sure the function F is correct (I have tried some values).

is there any problem with "Q = quad(F,0.01,0.05)" command?
Thank you for your help...
 
Physics news on Phys.org
Why do you think the real answer is 0.361?
I see that
F(0.05) - F(0.01) = 0.361
but this is of course not the integral, the integral is smaller.

The function is increasing and so on the interval [0.01, 0.05] it is maximum at 0.05, there it is 0.3834. Overestimating the integral by assuming that F would be 0.3834 everywhere in the interval [0.01, 0.05] would give an area: 0.3834 * 0.04 = 0.0153
which is close to 0.0059 (the answer that quad gives).
I think 0.0059 is the right answer.
 
gerben said:
Why do you think the real answer is 0.361?
I see that
F(0.05) - F(0.01) = 0.361
but this is of course not the integral, the integral is smaller.

The function is increasing and so on the interval [0.01, 0.05] it is maximum at 0.05, there it is 0.3834. Overestimating the integral by assuming that F would be 0.3834 everywhere in the interval [0.01, 0.05] would give an area: 0.3834 * 0.04 = 0.0153
which is close to 0.0059 (the answer that quad gives).
I think 0.0059 is the right answer.


ok now 1ve got it , 1 made a big mistake but 1 am happy to know my command is true . Thank you again
:smile:
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
10K
  • · Replies 14 ·
Replies
14
Views
4K