0
votes

I have plotted the hysteresis curve of (fy against uy) in Matlab. I want to find the area of the plot. I am aware of the trapz command. However, in my case I do not have two specific equations of the curve. How should I go about it?

Also, some parts of the curve lies in the negative region. How can I make sure that areas don't cancel each other?

uy =
   1.0e-03 *
   [-0.2238
   -0.3616
   -0.4817
   -0.5642
   -0.5962
   -0.5752
   -0.5048
   -0.3945
   -0.2603
   -0.1222
   -0.0020
    0.0807
    0.1129
    0.0918
    0.0213
   -0.0889
   -0.2232
   -0.3615
   -0.4819
   -0.5648
   -0.5972
   -0.5760
   -0.5055
   -0.3952
   -0.2607]



fy =
   -0.0000
   -1.4886
   -2.7506
   -3.5939
   -3.8900
   -3.5939
   -2.7506
   -1.4886
    0.0000
    1.4886
    2.7506
    3.5939
    3.8900
    3.5939
    2.7506
    1.4886
   -0.0000
   -1.4886
   -2.7506
   -3.5939
   -3.8900
   -3.5939
   -2.7506
   -1.4886
    0.0000
1
Apply Green theorem to trabnsform the area calculation in a contour intergation: en.wikipedia.org/wiki/Green%27s_theorem#Area_calculation - user2271770

1 Answers

2
votes

Use the function polyarea(X, Y). To check that you are considering the right polygon, use the function fill(X, Y, color), to plot the polygon you are evaluating.

Edit:
In your case the problem with using these functions is that you go 1.5 times around the curve, just with slightly different values the second time. A way to fix this is to cut your data at the first round. You could do it:
1) by doing just one round when you collect this data
2) by ordering your data so that you just go once around the curve

In the particular case of the data you sent here, you have to stop at the 17th value. By doing that I obtain the correct polygon enter image description here