Find area under curve and energy of function (matlab)

Click For Summary
SUMMARY

The discussion centers on calculating the area under the curve and energy of a function using MATLAB. The first function yields an area of 0 and energy of 0, while the second function's area is calculated as 1.73, resulting in an energy of 2.99. The integral is evaluated from t=-2 to t=5 using the trapezoidal rule via the MATLAB function trapz(). Additionally, alternative integration methods for the second function are suggested, including integrating e^-t over specified intervals.

PREREQUISITES
  • Understanding of integral calculus and its applications
  • Familiarity with MATLAB programming and its syntax
  • Knowledge of the trapezoidal rule for numerical integration
  • Basic concepts of energy calculations in physics
NEXT STEPS
  • Explore MATLAB's trapz() function for numerical integration
  • Learn about different numerical integration techniques, such as Simpson's rule
  • Study the properties of exponential functions and their integrals
  • Investigate energy calculations in various physical systems
USEFUL FOR

Students and professionals in mathematics, engineering, and physics who are involved in numerical analysis and function evaluation using MATLAB.

asdf12312
Messages
198
Reaction score
1

Homework Statement


image.png


For the 1st one you wouldn't really need MATLAB I guess to find the area under the curve, it is 0 and so is its energy. For the 2nd one I got A=1.73 and so E=2.99.

Homework Equations


area under curve = evaluate integral from t=t1 to t=t2. in this case t=-2 to t=5 since they are both defined only that far.

energy = area2

The Attempt at a Solution


Used MATLAB and the waveforms for the functions are plotted below. I used trapz() to approximate the integral i.e. to find the area. I could post the MATLAB code but wouldn't think it would be of much use.

image2.png
 
Physics news on Phys.org
hi asdf12312! :smile:

(what are you asking about?)

for the 2nd one, can't you integrate e-t ?
 
I guess you could lol. Integrating e^-t from t=0 to t=2 and e^(t-4) from t=2 to t=4. so u would get the answer i had listed.. i don't really know what my question was :(
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
992
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K