What's a "knee point" on a pressure curve, or anywhere for that matter? Do you mean a local maximum?
DIAdem Product Support Engineer
Thanks for your response. I apologize for my delayed reply. I came up with an alternative method. I must thank You all.
Thanks and Regards,
Hi Peter et al.
I read this post with some interest. I've got an ongoing problem here trying to automatically determine the knee point on an hysterics curve. I'm hoping that it is a similar problem to the one you solved. I plot displacement versus pressure and need to determine with a good degree of accuracy where the knee point is as the pressure is increased.
It has been suggested to use straight lines and points of intersection but I haven't had much success with this approach so far.
Are you able to share your scripts/ ideas by any chance?
Would also be interested to hear from anybody else who has had some success determining the knee point on a hysteresis curve using vbs scripts.
Thanks very much for any assistance in advance.
Just to add some further clarification regarding the knee point "definition" problem, I have taken the liberty of attaching a word document containing one picture.
would you be willing to post an example data set ? I would think that what you are looking for is the point of maximum curvature in one half of the curve. Having an example would make it possible to play with a few option for a solution.
Thanks for the reply to my post. I've actually managed to script a solution (I hope so anyway) to this problem now.
However I'm interested as I'm sure others are how someone else might approach the problem. I've attached an example dataset as requested. In the dataset you'll notice that the pressure channel ranges from 0 to 3 bar. However in the other datasets I've noticed that this maximum pressure can range from about 1 to 10 bar which could have an impact on the solution.
I've also taken the liberty of attaching a word document containing an image which shows the kneepoint being picked out from the script. You'll see from the figure that I've calculated a kneepoint value of 9.8. When I did the task by hand I was obtaining a value of 10.2. So a very small delta between manual and scripted methods
Thanks in advance.
I have attached a script calculating the knee point(s) of the hysteresis curves. The script does the following:
1) Filter the signals to get rid of the noise
2) split the signal into the hysteresis curves
3) split each hysteresis into the increasing and decreasing part
4) find the knee point for each part
Finding the knee point is done in the function called "CalculateKneePoint"
This function uses a combination of two algorithms:
1) The "Kneedle" algorithm
2) using the point of maximum slope
While "1)" typically delivers a point above what one would choose manualy, "2)" deliver a point below
CalculateKneePoint uses the result of those algorithms to define an intervall around the desired knee point. Within this intervall, "Kneedle" is
used to find the desired result point.
The algorithm delivers 10.25 for the first segment, compared to 10.2 as a result from your manual selection. Please take a look at the result and let me know whether this is what you were looking for.
The "DataFileLoad" command in the script assumes that the data is in the same directory like the script and the TDM file is named "knee_point_data.TDM". PLease adjust accordingly.
Here is the result for your example data :
Thanks very much for the reply. It sounds very similiar to how I scripted the solution. It will be very interesting to compare the two solutions side by side.
You mention that you applied filtering to the signals? I noticed that some of the datasets we had required filtering and others did not. I suspect that your filtering parameters are hard coded into the script? Do you know of any techniques to automatically determine the filter parameters?
Thanks a lot. I shall report back.