11-19-2012 05:32 PM
I'm building a gait evaluation program, and got stuck on this. I have a XY graph of hip x knee angles, and need to find the area of the plotted curve. I searched the forums, but found no way of doing this. Any ideas?
Solved! Go to Solution.
11-19-2012 05:50 PM - edited 11-19-2012 05:51 PM
Can you respost your VI for Labview 2011?
Also are you asking for the area under the curve...? If so there are multiple integration VIs.
11-19-2012 05:52 PM
The endpoints of your graph are not at the same point. So you do not have a closed path which would define an irregular poygon. How are you defining the area you want to measure? The image below shows the detail of the endpoints. If the point at Knee Angle = -4.0 had Hip Angle = 16.4 rather than 16.3 the curve would be open.
Lynn
11-19-2012 05:54 PM
Right away. Saved as LV9
11-19-2012 06:16 PM - edited 11-19-2012 06:27 PM
Lynn,
The image is missing, but I understand what you mean.
The graphs are cyclic (as walking pattern is cyclic), and beacuse of natural walking "irregularities", the end points will never match. The fact that the data is crossed at a point (figure 1) just means that the data collected is greater than 1 walking step. That can be corrected, and I can use the first value to force the polygon to close (see VI v.2).
11-19-2012 06:52 PM
Green's Theorem instantly comes to mind:
I lopped off the first couple of points to make the graph more cyclic and get 1300.36 for the answer. Passes the eyeball test but you should double check my rapidfire implementation (and my sketchy calculus recollections).
11-19-2012 10:04 PM
Running against some known regular polygons (triangle, square, pentagon, hexagon) it worked flawlessly. But when I checked it against a circle, I found an odd behavior: The calculated area is slightly greater than the expected (and it increases as the area of the graph increases) when the expected result was to be a little smaller than the expected area.
Check the attached vi for an example.
I'll try to figure that out.
11-19-2012 10:33 PM
You are actually overclosing the curve (at least for how I calculated it). I leave out the last point (which should equal the first). If you leave out the last point you add, the results seem to make sense, and approach pi after about 1000 points.
11-20-2012 05:13 AM