How to find inflection point in graph when dx is very small

Hello,
I'm trying to sort through position data from a feedback pot to calculate linearity of movement as part of a testing procedure. An image of the data is attached. I want to delete all data in the 'flat' part, in order to do a linear fit and R^2 of the sloped line.
This is made trickier by the fact that the number of samples, the start and end points, and slope of the line can all vary considerably. Therefore I need some way to find the 'knee' in the graph and remove all subsequent samples from the data. 
The most obvious method I tried was to use a derivative to find the inflection point, but since I have so many data points, the dx is very small
(~0.05) when using the built-in labview derivatives. This means that I can't distinguish the inflection point from any other change in the values due to noise or change in velocity. I made my own derivative function, which was a newton quotient that looked at (xi+N)-(xi-N) instead of (xi+1) - (xi-1), but this still did not give good results. My next idea is to just look at the difference of every N points, and arbitrarily decide a threshold to indicate when it has levelled off. Any other ideas would be really helpful though.
Thanks,
-SK-
Attachments:
position.PNG ‏17 KB

Lets see if I can answer without having to write a book.
Fisrt I'd run the data through a zero-phase shift low pass filter. Then look at the 2nd derivative to find the knee. Using a zero-pahse shift fileter I was able to detect when a value was jumping up when it started to jump rather than after. THis thread may be interesting.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • How to find the ME29N 'USER EXIT' when our save the release PO after.

    How to find the ME29N 'USER EXIT' when our save the release PO after.
    which user exit will be used?
    thanks.
    alex.

    Hi,
      process :
        go to tranx code :   ME29N ,
           System---->Status , here copy the program name (SAPLMEGUI),
         go to abap editor and specify the program name SAPLMEGUI and find the package "ME".
         tranx code : CMOD ,  Utilites--->Sap Enanchement,
                                         specify the package name : ME
                                          and execute, displays a list of exits ,
                                 and find out our suitable exit based on requirement.
    check these :   EXIT_SAPMM06E_021
    reg
    Siva

  • How to find a point lies inside circle

    Hi,
    How do I find a point (x,y) is lies inside a circle? I trying to do a small shooting game.
    If the user clicks inside the circle they get a point. I am using the Pythagoras theorem to achieve this. But I can't.
    Please advice me.
    Here is my code
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Shoot extends JFrame implements MouseListener, MouseMotionListener
        private int winWidth = 300;
        private int winHeight = 300;
        private MyCanvas canvas = null;
        private int ballX = 50;
        private int ballY = 50;
        private int ballW = 50;
        private int ballH = 50;
        private int ballR = ballW / 2;
        private int curX = 0;
        private int curY = 0;
        private int left = 0;
        private int top = 0;
        public Shoot()
            Cursor c = new Cursor(Cursor.CROSSHAIR_CURSOR);
            this.setCursor(c);
            canvas = new MyCanvas();
            packIt();
            left = getInsets().left;
            top = getInsets().top;
        private void packIt()
            setTitle("My first game!");
            setPreferredSize(new Dimension(winWidth, winHeight));
            setSize(new Dimension(winWidth, winHeight));
            setContentPane(canvas);
            addMouseListener(this);
            addMouseMotionListener(this);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //setUndecorated(true);
            setLocation(300, 0);
            setVisible(true);
        public void mouseClicked(MouseEvent e)
            int x = e.getX() - left - ballX;
            int y = e.getY() - top - ballY;
            int r = ballR;
            System.out.println("x :" + x + "\ty :" + y);
            //Trying to implememt Pythagoras theorem. But I am missing something.
            System.out.println(((x * x) + (y * y)) + "\t=\t" + (r * r));
            System.out.println();
        public void mousePressed(MouseEvent e)
        public void mouseReleased(MouseEvent e)
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        public void mouseDragged(MouseEvent e)
        public void mouseMoved(MouseEvent e)
            curX = e.getX() - left;
            curY = e.getY() - top;
            canvas.repaint();
        private class MyCanvas extends JPanel
            public MyCanvas()
                setBackground(Color.BLACK);
                setBorder(BorderFactory.createLineBorder(Color.yellow));
            public void paintComponent(Graphics g)
                super.paintComponent(g);
                g.setColor(Color.WHITE);
                g.drawString("x :" + curX, 10, 20);
                g.drawString("y :" + curY, 10, 30);
                g.setColor(Color.RED);
                g.fillOval(ballX, ballY, ballW, ballH);
        public static void main(String[] asd)
            new Shoot();
    }

    public boolean isPointInCircle(){
        double x= circle.getWidth/2.0+circle.getX();
        double y= circle.getHeight/2.0+circle.getY();
        double distance=getDistance(x,y,pointX,PointY);
        return (distance<= circle.getWidth/2.0); //if the distance from the point to the center of the circle is less than the radius of the circle return true
    double getDistance(double x1, double y1, double x2, double y2){
        return math.sqrt((x1-x2)(x1-x2) + (y1-y2)(y1-y2));
    }Edited by: ghostbust555 on Jan 23, 2011 3:20 PM

  • @FINDSTR - How to find an element containing . (dot) when . (dot) is wildcharacter

    I'm checking a LogFile containing FileName(s) and want to Include/Exclude files according to FileType.
    How to use @FINDSTR  to find an element containing . (dot) when . (dot) is wildcharacter...???

    PowerShell ${"%MainDir%\%FullPath%\%FullFileName%"} = Get-Content ${"%MainDir%\%FullPath%\%ListFileName%"}
    |Select-String '\.mp3|\.mp4|\.m4a|\.flac|\.cue|\.ogg|\.ape|\.wav|\.wv'
    That wont work. Two things wrong
    First thing
    Get-Content expects a filename  like Get-Content c:\music.txt  
    or  Get-Content
    "%MainDir%\%FullPath%\%ListFileName%"  
    Get-Content ${c:\music.txt} will try to get the filename in the file c:\music.txt and not use c:\music.txt
    itself.
    Second Thing
    ${"%MainDir%\%FullPath%\%FullFileName%"} = is wrong, don't use the " inside the { }, the { } act as a
    quotes
    for example ${C:\My Documents\Music.txt} = is ok, that will work, this is a variable
    PowerShell ${"%MainDir%\%FullPath%\%FullFileName%"} = Get-Content ${"%MainDir%\%FullPath%\%ListFileName%"}
    |Select-String '\.mp3|\.mp4|\.m4a|\.flac|\.cue|\.ogg|\.ape|\.wav|\.wv'
    Should be 
    PowerShell ${%MainDir%\%FullPath%\%FullFileName%} = Get-Content "%MainDir%\%FullPath%\%ListFileName%"
    |Select-String '\.mp3|\.mp4|\.m4a|\.flac|\.cue|\.ogg|\.ape|\.wav|\.wv'

  • How to find function module exit name when i know the Include

    As per my requirement i should change the existing exit. I know the include name but i want to
    know exit name. How to find out exit name based on include name. I tried Where-used list but it
    is not giving the exit and function module name.Please let me know.
    Regards
    Rajitha

    Hello Rajitha,
    1. You can do a "where-used" for the include & get the corresponding name of the exit function module.
    2. Goto table MODSAP & in the field MEMBER pass the name of the function module & you will get the Exit Name in the NAME.
    Hope this helps.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 16, 2009 3:08 PM

  • How to find nearest point on polyline

    Hi,
    I have to find the nearest point to my standing point on a polyline. I have Oracle Locator installed, but my data is not in a locator format. Is it possible to do this by using Locator's functionality by for example puting the polyline and standing point coordinate values into a spatial type variable and calling some locator functionality?
    Or I have to coordinate data into a "spatial enabled" table, create spatial index etc and then call some Locator procedure.
    Tamas

    Luc,
    Thanks for the reference.
    When the data is converted, finding the nearest vertex in an sdo_geometry object could be done this way (of, of course, many):
    select f.vertex_id,f.dist,f.min_dist,f.a_vertex
      from (select p.vertex_id,
                   sdo_geom.sdo_distance(p.the_point,p.a_vertex,0.005) as dist,
                   min(sdo_geom.sdo_distance(p.the_point,p.a_vertex,0.005)) over (order by sdo_geom.sdo_distance(p.the_point,p.a_vertex,0.005) asc) as min_dist,
                   p.the_point,
                   p.a_vertex
              from (select t.id as vertex_id,
                           mdsys.sdo_geometry(2001,NULL,mdsys.sdo_point_type(358615,5407047,null),null,null) as the_point,
                           mdsys.sdo_geometry(2001,NULL,mdsys.sdo_point_type(t.x,t.y,t.z),null,null) as a_vertex
                      from table(sdo_util.getVertices(
                                MDSYS.SDO_GEOMETRY(2002,null,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(362253.9,5409676.63,355608.12,5407615.16,358063.37,5407673.48,355276.53,5407361.08,360471.08,5408880.79,362483.4,5406024.69,362359.16,5408840.11,354570.21,5406219.18,360204.62,5405849.14,359214.51,5408283.5,358761.06,5406683.88,356739.05,5405590.46,358615.79,5407047.29,355978.02,5407326.33,356240.87,5409898.7,363159.35,5405510.46,358588.81,5406536.54,354822.42,5408643.75,357690.2,5408872.57,359839.29,5407253.86,355236.29,5409711.53,355342.54,5407448.87,360290.53,5405111.51,354677.02,5407916.83,361651.27,5409178.26,361730.18,5407553.5,357402.33,5409065.5,361546.51,5407278.41,361915.65,5408942.57,361974.74,5405464.91,357794.3,5406979.33,356106.58,5405481.32,357604.96,5407407.72,360718.31,5406765.8,359745.49,5406568.16,363005.29,5407557.46,355844.01,5407095.47,362749.66,5405041.82,359714.13,5408898.69,354509.69,5406113.6,360041.59,5406204.24,360380.17,5408751.21,356621.4,5409603.06,355156.27,5405401.98,354441.35,5409090.68,356376.45,5407472.81,363877.1,5405582.72,361883.83,5409696.17,356363.41,5406434.53,362078.96,5406617.37,362714.59,5409800.2,362703.49,5408513.33,358317.64,5408170.64,359294.27,5409197.53,360240.93,5406333.84))
                                )) t
                    ) p
            ) f
      where f.dist = f.min_dist;Hope this helps.
    Simon

  • How to find intersection point between a lineseries and a vertical line.

    I have a lineseries chart (refer the screenshot). As I move the spend slider shown in the attachment, a vertical line is drawn in the chart. (I did this using the cartesian canvas as annotation element - using canvas.moveTo(), canvas.lineTo() functions)
    I want to find out the intersection point(y value) where the vertical line meets the lineseries. Can someone help me on this. It will be really helpful.
    Thanks,
    Jayakrishnan

    Here are a few functions I wrote years ago for common chart transformations... the function you're going to focus on for your solution is chartToScreen...
    *  Converts the screen position to chart value position
    *  @param thePos - Number - The position you want to convert
    *  @private
            private function getChartCoordinates(thePos:Point):Object
                   var tmpArray:Array = dataTransform.invertTransform(thePos.x, thePos.y);
                   return {x:tmpArray[0], y:tmpArray[1]};
    *  Takes a non-numeric chart value and returns a proper numeric value
    *  @param inValue - String - The display name of the instance showing on the axis (eg. if we're showing months, it might be 'Sep - 06'
    *  @param theAxis - IAxis - The axis on which we're looking
              public function getNumericChartValue(inValue:String, theAxis:IAxis):Object
                   var axisCache:Array = new Array({inValue: inValue})                 
                   if(!(theAxis is LinearAxis))
                        theAxis.mapCache(axisCache, "inValue", "outValue", true);
                        return {numericValue: axisCache[0].outValue}
                   else
                        return {numericValue: Number(inValue)};
    *  Converts the chart values into screen coordinate values
    *  @param chartX - Number - The display name of the instance showing on the axis (eg. if we're showing months, it might be 'Sep - 06'
    *  @param chartY - Number - The axis on which we're looking
              public function chartToScreen(chartX:Number, chartY:Number, theSeries:Series):Point
                   var tmpCache:Array = new Array({chartX:chartX, chartY:chartY});
                   if(theSeries)
                        theSeries.dataTransform.transformCache(tmpCache, "chartX", "screenX", "chartY", "screenY");
                   else
                        dataTransform.transformCache(tmpCache, "chartX", "screenX", "chartY", "screenY");
                   return new Point(Math.round(tmpCache[0].screenX), Math.round(tmpCache[0].screenY));
    *  takes a point in mouse position, and runs it through converting to chart coordinates, converts chart coordinate to numeric value if needed
    *  and then back into mouse position to get the nearest axis snap point
    *  @param thePoint - Point - The position we're converting
    *  @private
              private function getSnapPosition(thePoint:Point):Point
                   var chartPoint:Object = getChartCoordinates(new Point(thePoint.x, thePoint.y));
                   //if either of the axis chart results is not in numeric format, we get the numeric equivalent of it
                   var chartX:* = chartPoint.x;
                   var chartY:* = chartPoint.y;
                   chartX = getNumericChartValue(chartPoint.x, CartesianChart(this.chart).horizontalAxis).numericValue;
                   chartY = getNumericChartValue(chartPoint.y, CartesianChart(this.chart).verticalAxis).numericValue;
                   return chartToScreen(chartX, chartY, null);

  • How to find VI's connected terminals when controls are hidden on the front panel?

    When working with a sub-VI which has terminals connected to hidden controls is there a straight-forward way to find the terminals on the block diagram?
    I click on the terminal and an outline appears on the front panel but when I try to click on that outline I can not unhide the control. 
    The only way I have discovered to find the terminal of the connected control is just check each terminal on the block diagram which looks like it might be connected.
    I'm using LV7.1 but also use 8.5.
    Thanks,
    Davey

    Ben wrote:
    smercurio_fc wrote:
    If I understood the premise of the question it sounds like you have controls/indicators wired to the VI connector pane, but for some reason these controls/indicators are hidden. If this is a VI you wrote slap yourself. If this is a VI someone else wrote, go slap them.
    One way that you can find the terminals on the block diagram by performing a search by text. The context help will show you the names of the controls/indicators. The only problem with this approach is that if the control/indicator has the caption visible rather than the label, then the context help will show the caption, not the label.
    Another method is to use scripting. Not sure if it's worth the effort for just one VI, though.
    Before we get all slap-happy I have to ask...
    If I have a sub-VI which is set for Print on completion and the controls in/out for the icon connector are NOT supposed to show up on the final report, isn't setting those objects as hidden a viable option?
    Ben
    Well, of course, Ben. My comment was not meant to be taken seriously... hence the smiley happy icon. To respond to your question in a more serious matter, though, there's always exceptions to rules. That's why they're rules - they're meant to be broken. Otherwise they wouldn't be rules. It's a strange state of the universe, isn't it? Although, one could probably just place the control behind another object. That sort of hides it, doesn't it?

  • How to find messages sent to you when your phone was broken

    So my iphone 4s running ios7 was having trouble for about a week. Whenever I plugged it into iTunes it said it was in recovery mode and had to be backed up, which I did and would never complete because it would say error. During this time my iphone would just keep restarting itself over and over and would show the icon with the charger at the bottom and the itunes logo in the middle when it would restart and would loop through this process until the battery ran out. I since replaced my iphone with a replacement and backed it up, but the text messages that I should have received during this week have not come through. I know that pictures were sent to me through imessage and none of the text messages that I got during this time are showing up.
    Is there a way for me to see all of my imessages? or to find these lost texts?

    SMS messages are not guaranteed to be delivered, so any which you have not received are most likely gone forever (unless you can get the NSA to give you copies they have).  As for iMessage, the message history should populate to your new device when you use it with the same Apple ID and send/receive iMessages with the same contacts.  My iPad Air uses the same Apple ID as my iPhone 5, and when I actually send or recieve an iMessage with a contact since signing into the iPad Air it has pulled the history of the conversation to that device as well.

  • How to find the points that define an edge?

    I'm looking at a very large geometry that's generating an error from VALIDATE_GEOMETRY_WITH_CONTEXT:
    ORA-13349: polygon boundary crosses itself 13349 [Element <5>] [Ring <1>][Edge <7566>][Edge <7591>]
    How can I find the X & Y coordinates of those two edges?
    It's a two-dimensional polygon, with thirty two inner rings, and extracting ring 5 doesn't show any obvious errors: It doesn't have seven thousand edges to it either though - is that supposed to be the edge number counting from the start of the outer ring, or just the start of that element?
    Cheers
    Simon Anderson
    Scisys

    Hi,
    What I'm looking for is a way to report the error back to the end-user. The information is there in the form of:
    [Element <5>] [Ring <1>][Edge <7566>][Edge <7591>]
    But the exact position of the error is often hard to find in a CAD system.
    I want to return edge 7566 and edge 7591 as geometry objects.
    So the question is:
    Given a geometry object and a list of element,ring,edge elements. How to create geometry objects for these edges?
    Rene

  • How to find thead 2 archive log when i recover from 2-node RAC to single

    I backup 2-ndoe RAC and restore to single - node
    Control file created.
    SQL> recover database iuckup controlfile
    SQL> recover database using backup controlfIle;
    ORA-00279: change 12100176131169 generated at 07/06/2013 16:36:57 needed for
    thread 1
    ORA-00289: suggestion : /arch/hop1_566085708_1_212692.dat                 -- Oracle suggest
    ORA-00280: change 12100176131169 for thread 1 is in sequence #212692
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    arch/sch1_566085708_1_212692.dat                                            --- I input  
    ORA-00279: change 12100176131169 generated at  needed for thread 2
    ==> Oracle didn't suggest thread 2 archive log file/
    How can I find ?

    You have to query V$ARCHIVED_LOG for THREAD# 2 on the source database to find the first archivelog where 12100176131169 is less than the NEXT_CHANGE#
    select SEQEUNCE# from V$ARCHIVED_LOG where THREAD#=2 and 12100176131169 between FIRST_CHANGE# and NEXT_CHANGE#
    Once you provide the Sequence# and file name for the first Thread 2 file, the RECOVER command will automatically generate the expected file name for the subsequent archivelogs (of both threads).
    Hemant K Chitale

  • How to find out date in oracle when the Stored procedure in changed.

    Dear Sir,
    I want to know the list of dates when stored procedure is modified during a given period.
    eg. Procedure created 01/01/2011
    i changed the procedure 4 times say 01/10/2011,01/12/2011,01/01/2012 and 20/12/2012.
    from where i can get these details along with the other details like what will be procedure syntax at different modifications and most important what is ipof machine.
    thanks & regards
    Munish

    user9216770 wrote:
    Dear Sir,
    I want to know the list of dates when stored procedure is modified during a given period.
    eg. Procedure created 01/01/2011
    i changed the procedure 4 times say 01/10/2011,01/12/2011,01/01/2012 and 20/12/2012.
    from where i can get these details along with the other details like what will be procedure syntax at different modifications and most important what is ipof machine.
    thanks & regards
    MunishOracle does NOT retain or contain previous versions.
    You should be able to obtain these from your Source Code Repository; like Subversion.

  • How to find enhancement point or enhancement section

    Hi,
                        If anybody is trying to make changes to the approved sale order it shows a message
                        "SALE ORDER APPROVED BY xx CHANGES NOT POSSIBLE".
                        i want to know where excatly the enhacement code is written.
    Thanks & Regards,
    vijay karri.
    Edited by: vijaykarri on Jul 8, 2010 11:39 AM

    Hi ,
    Please find in the Source code using Search Option with the Message String  Or Using the Message No and Whereused List .
    Regards,
    Kishore.S

  • HOw to find out a report name when you know only the name of background job

    Hi experts ,
    my question is i need to find out teh report name for which i knew only the background job name of the report .
    thanx
    Venky.

    Go to tcode SM37->Give job name and execute->choose tool bar button STEPS (Disply Steps list) ->Then you will get program or command

  • How to find format of an image when its byte[] content alone is available?

    Hi,
    I'm working on code that gets an image content as input in byte[] format. With no other further details provided, how to identify the format of the image contained in the byte array? Specifically, I would like to know if the image contained in it is a PNG, JPG, BMP, etc.
    Image or ImageIO API does not seem to provide a means to do this. Is there a way how this can be achieved?
    Thanks in advance.

    The ImageIO class does provide a way to do what you want... it just takes a couple of steps. Take a look at the determineInputFormat() method below:
    import java.io.ByteArrayInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    public class ImageFormatTest {
       private static final String IMAGE_PATH = "... PATH TO IMAGE HERE ...";
       public static void main( String[] args ) {
          try {
             final byte[] imageBytes = readImageBytes( IMAGE_PATH );
             final String imageFormat = determineImageFormat( imageBytes );
             System.out.println( "Image format is " + imageFormat );
          } catch (Throwable ex) {
             ex.printStackTrace();
       private static byte[] readImageBytes( String imagePath ) throws IOException {
          final File imageFile = new File( imagePath );
          final byte[] buf = new byte[ (int) imageFile.length() ];
          final FileInputStream fStream = new FileInputStream( imageFile );
          fStream.read( buf );
          fStream.close();
          return buf;
       private static String determineImageFormat( byte[] imageBytes ) throws IOException {
          final ByteArrayInputStream bStream = new ByteArrayInputStream( imageBytes );
          final ImageInputStream imgStream = ImageIO.createImageInputStream( bStream );
          final Iterator<ImageReader> iter = ImageIO.getImageReaders( imgStream );
          final ImageReader imgReader = iter.next();
          return imgReader.getFormatName();
    }

Maybe you are looking for