Find area under curve and energy of function (matlab)

In summary, the conversation discusses using MATLAB to find the area under a curve and the corresponding energy. The equations used are the area under the curve and energy equations. The solution involves plotting waveforms and using trapz() to approximate the integral. The conversation also briefly mentions integrating e^-t and e^(t-4) to find the answer.
  • #1
asdf12312
199
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
  • #2
hi asdf12312! :smile:

(what are you asking about?)

for the 2nd one, can't you integrate e-t ?
 
  • #3
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 :(
 

1. What is the purpose of finding the area under a curve and energy of a function using MATLAB?

The purpose of finding the area under a curve and energy of a function using MATLAB is to calculate the total amount of energy or the total area bounded by a given function. This can be useful in various fields such as physics, engineering, and economics where understanding the total energy or area can provide valuable insights.

2. How does MATLAB calculate the area under a curve and energy of a function?

MATLAB uses numerical integration methods such as the trapezoidal rule or Simpson's rule to calculate the area under a curve and energy of a function. These methods divide the curve into smaller segments and approximate the area or energy within each segment, which is then summed up to get the total value.

3. What are the steps involved in finding the area under a curve and energy of a function using MATLAB?

The steps involved in finding the area under a curve and energy of a function using MATLAB are as follows:

  • Define the function to be evaluated in MATLAB.
  • Choose the limits of integration.
  • Select the appropriate integration method.
  • Use the built-in function in MATLAB to calculate the area or energy.

4. Can MATLAB handle complex functions when finding the area under a curve and energy of a function?

Yes, MATLAB can handle complex functions when finding the area under a curve and energy of a function. It has built-in functions that can handle complex numbers and functions. However, the user must specify the limits of integration and choose an appropriate integration method for accurate results.

5. Are there any limitations to using MATLAB for finding the area under a curve and energy of a function?

One limitation of using MATLAB for finding the area under a curve and energy of a function is that it can only approximate the value and may not provide exact results. This is because numerical integration methods are used, which can introduce errors. Additionally, the accuracy of the results also depends on the step size and the complexity of the function being evaluated.

Similar threads

Replies
2
Views
263
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
13
Views
2K
Replies
10
Views
824
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
Replies
11
Views
981
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
826
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
Back
Top