Area under Curve REVERSED

In summary: A2 fprintf('Coordinates for 20%% of area: (%f, %f) \n', conversion(i), rate(i)); end if cumulative_area >= A3 fprintf('Coordinates for 30%% of area: (%f, %f) \n', conversion(i), rate(i)); endendIn summary, to find the coordinates where a certain percentage of the area under the curve falls, you can first calculate the total area under the curve using trapz function. Then, using a loop, you can add the area of each trapezoid to a cumulative area variable and check
  • #1
rebelsnake
1
0
Area under Curve REVERSED!

ok now I have got a plot b/w x & y, which produced a curve
using trapz function I evaluated the area
now the important thing is that I have to take say 10% of the evaluated area & want to find at which coordinates 10% of the caculated area approaches to; similarly which coordianes correspond to 20% 30% of the original calculated area


Code is
x=[0.8 0.7125 0.6375 0.534 .381 0]

x =

0.8000 0.7125 0.6375 0.5340 0.3810 0

>> conversion=x;
>> y=[1/0.4 1/.8 1/1.2 1/2 1/4 0]

y =

2.5000 1.2500 0.8333 0.5000 0.2500 0

>> rate=y;
>> plot(conversion,rate)
>> color=[010];
>> basey = min(0,min(y));
h = fill([x x(end) x(1)], [y basey basey], color);
>> %area under curve shaded
>> area=trapz(conversion,rate)

area =

-0.4162

>> area=trapz(conversion,-rate)

area =

0.4162
 
Physics news on Phys.org
  • #2


Hello there,

Thank you for sharing your code and the problem you are trying to solve. It seems like you have a plot of conversion rate (y-axis) against conversion (x-axis) and you want to find the coordinates where a certain percentage of the area under the curve falls.

One approach you can take is to first calculate the total area under the curve, which you have already done using the trapz function. Let's call this total area "A". Then, you can calculate the 10%, 20%, 30% etc. of A, which would be 0.1*A, 0.2*A, 0.3*A etc. Let's call these values "A1", "A2", "A3" etc.

Next, you can create a variable to keep track of the cumulative area under the curve. Let's call this variable "cumulative_area" and set it initially to 0. Then, you can loop through each data point in your conversion and rate arrays, and add the area of the trapezoid formed by that point and the previous point to the cumulative area. If the cumulative area is greater than or equal to A1, A2, A3 etc., then you have found the coordinates where 10%, 20%, 30% etc. of the area falls.

Here is an example code to illustrate this approach:

% calculate total area under curve
A = trapz(conversion, rate);

% calculate 10%, 20%, 30% etc. of A
A1 = 0.1*A;
A2 = 0.2*A;
A3 = 0.3*A;

% initialize variable to keep track of cumulative area
cumulative_area = 0;

% loop through each data point
for i = 2:length(conversion)
% calculate area of trapezoid formed by current point and previous point
trapezoid_area = (conversion(i) - conversion(i-1)) * (rate(i) + rate(i-1)) / 2;

% add trapezoid area to cumulative area
cumulative_area = cumulative_area + trapezoid_area;

% check if cumulative area is greater than or equal to A1, A2, A3 etc.
if cumulative_area >= A1
% print corresponding coordinates
fprintf('Coordinates for 10%% of area: (%f
 

1. What is the "Area under Curve REVERSED"?

The "Area under Curve REVERSED" is a concept in mathematics and statistics that refers to the area enclosed between a curve and the x-axis, when the direction of the y-axis is reversed. This means that instead of the area being above the curve, it is now below the curve.

2. How is the "Area under Curve REVERSED" different from the regular area under a curve?

The regular area under a curve is calculated by finding the integral of the function defining the curve, whereas the "Area under Curve REVERSED" is calculated by finding the integral of the negative of the function. This changes the direction of the area and can result in a different numerical value.

3. What is the importance of the "Area under Curve REVERSED" in scientific research?

The "Area under Curve REVERSED" is commonly used in scientific research to analyze data and make predictions. It can be used to calculate probabilities, assess the accuracy of measurements, and compare different experimental conditions.

4. How is the "Area under Curve REVERSED" used in real-world applications?

The "Area under Curve REVERSED" has many practical applications, such as in economics to analyze market trends, in medicine to evaluate the effectiveness of treatments, and in engineering to assess the performance of systems. It is also used in data analysis and machine learning algorithms.

5. Are there any limitations or assumptions when using the "Area under Curve REVERSED"?

Like any mathematical concept, the "Area under Curve REVERSED" has limitations and assumptions. It is based on the assumption that the curve is continuous and doesn't account for any gaps or outliers in the data. It also assumes that the direction of the y-axis can be reversed, which may not always be applicable depending on the context of the problem.

Similar threads

Replies
2
Views
150
Replies
3
Views
214
Replies
2
Views
2K
  • Calculus
Replies
2
Views
1K
Replies
24
Views
2K
Replies
7
Views
2K
Replies
3
Views
1K
  • Calculus
Replies
2
Views
933
  • Calculus
Replies
3
Views
2K
Replies
3
Views
820
Back
Top