07-30-2020 10:11 AM
Hello,
I am trying to manipulate some of the data gathered by my program. My goal is to take the resulting "parabola like" graph and project lines along each of the two arms. I then have to see where they intercept along the x-axis and find the distance between them. after i will show the resultant number on a meter on the front panel. Please see the pictures i have posted for more clarification, the screen capture of the front panel is the resultant XY graph, the two signals on the right are the x and y axis's data represented in a wave form. The picture of the plot in excel is essential what i am trying to do. I do not need to show the lines, i just need to find the slope of the left arm and the slope of the right arm, find where they intercept x and then calculate the distance between them.
Kind regards,
07-30-2020 10:31 AM
Hi beginner,
some easy steps:
Find the minimum point of the curve
Get a subset of the plot data left and right of the minimum.
Do a 1st order interpolation on both subsets to get the parameters of the desired lines.
Use simple math to find the crossing point of both lines...
07-30-2020 10:36 AM
Im trying to find the appropriate functions in the block diagram to accomplish this, i do not want this done in excel. is there a function i can use to easily find the bottom most point? then to also find the left and right hand side?
regards,
07-30-2020 10:59 AM
Hi,
Try finding the array max and min vi, in the Array tool pallet. That will get you both the min value and its index in the array.
Then use the linear fit vi in the Maths > Fitting pallet to fit a linear function to each arm. That will return the slope and intercept of each line.
Then use maths to get the intercept.
Good luck
07-30-2020 02:31 PM
This is my block diagram (see picture) i cant find a way to separate the graph into its left and right hand sides.
07-30-2020 02:53 PM
What do you mean by Left and Right hand sides?
07-30-2020 03:06 PM
i have the multiplication by 1 just as a scaling, i would some times change it to 0.5 or 2 if i wanted to increase the size,i ts not their permanently. Here is the re wired diagram, now when i say 2 half's i mean that i want to separate the data on my XY plot and find the slope of each line. Maybe separate was not the right word. maybe the following pictures will help...
The excel is an example of what i want to do, my goal is to find out where the projected lines intercept the x axis, then find the distance.
07-30-2020 03:18 PM
I'm sorry, when the new messages popped up, I didn't see the previous ones that showed the graph that described the right vs left.
You can use array subset of your original data (or waveform subset) to get just the respective sides.
But the tricky part is determining where each side begins and ends. You could start by finding the lowest Y value and make that break point. But it looks like you want to eliminate some of the points that are down in the valley of the overall graph.
So exactly where along the side would you consider the start of the side, and where do you consider part of the valley? If there is some mathematical relationship, you can apply that to your data to determine which indices meet the conditions.
07-30-2020 06:07 PM
I was thinking along the lines of RavensFan before I got to his last message. I agree that the tricky part is how to decide which data to consider *representative* of both the left and right legs.
It looks to me like you have a lot of data points with a decent amount of high freq noise (possibly random) such that the raw graph makes a pretty fuzzy curve. However, the general trend of the data appears pretty linear except near the turnaround point.
Here's the kind of thing I'd start inspecting over several runs of fairly typical data:
1. As already recommended, start by finding the index of the minimum value. Due to the noise in the data, this may not be in the middle of the turnaround area. That's one of the things to account for.
2. I'd use that index to split the data into left leg and right leg.
3. I'd then start by retaining only the first 50% of the left leg and the last 50% of the right leg. With only this limited amount of data, far from the curvature of the turnaround point, I'd see what kind of results I got (slopes, intersection points, difference of intersection points).
4. I'd then further iterate and increment the %age until I got all the way to 100%.
5. With your large # of data points, you'll probably see very little difference from retaining 50% of each leg vs. 75% of each leg. There *should* be a noticeable difference when you retain all 100%. Somewhere in between is where the curvature starts to distort your results.
6. As you repeat this over a number of your data sets, you'll be able to develop some justification for choosing the %age of data to retain rather than merely estimating by eyeball.
-Kevin P