Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Equation of a line

  • 06-12-2011 2:33pm
    #1
    Registered Users, Registered Users 2 Posts: 88 ✭✭


    I have a range of points comming from a proximity sensor, see below.
    X values are centimeters and Y values are voltage outputs.
    Using Excel I managed to use the threadline fiunction to get the equation of the line that best fits this data.
    [CENTER][COLOR=black]y = -0.0035x[/COLOR][COLOR=black]4[/COLOR][COLOR=black] + 0.1849x[/COLOR][COLOR=black]3[/COLOR][COLOR=black] - 2.3623x[/COLOR][COLOR=black]2[/COLOR][COLOR=black] - 17.899x + 614.72[/COLOR][/CENTER]
    
    When I have a value for Y I want to solve for X , so I rewrote the top function as:
    594.6436-Y/0.0035
    594.6436-Y
    X =-----------
       0.0035
    
    This isnt giving me the correct awnser, can anyone spot my error?
          5   596.67 
          6   569.33
          7   542.00   
          8   514.67     
          9   487.33    
         10   460.00   
         11   432.00    
         12   404.00    
         13   376.00    
         14   348.00     
         15   320.00   
         16   306.00  
         17   292.00  
         18   278.00  
         19   264.00   
         20   250.00 
         21   247.70  
         22   245.40   
         23   243.10    
         24   240.80   
         25   238.50   
         26   236.20  
         27   233.90   
         28   231.60   
         29   229.30     
         30   227.00   
    


Comments

  • Registered Users, Registered Users 2 Posts: 1,501 ✭✭✭Delphi91


    You can't do that re-arrangement of the equation to solve for x.

    Bear in mind that the equation is a quartic one (highest power of x is 4) so for every value of y there are potentially up to 4 real possible values of x.

    Google quartic equations and see the possible ways of handling the equations.


  • Registered Users, Registered Users 2 Posts: 13,076 ✭✭✭✭bnt


    Since the cubic and quartic coefficients are so small, I'd be inclined to discount them and use just the quadratic equation only: y = 2.3623x² - 17.899x + 614.72.

    You could then substitute a y value and subtract it from both sides to get 2.3623x² - 17.899x + (614.72 - y_value ) = 0 . Then use the quadratic formula to find the roots of that formula, and you have two possible answers, only one of which makes sense.

    You could use Excel's "Goal Seek" system to find an X value to fit a given Y value using the quartic equation - but since there are four possible Y values, you might need to "seed" the process with something fairly close to the answer.

    You are the type of what the age is searching for, and what it is afraid it has found. I am so glad that you have never done anything, never carved a statue, or painted a picture, or produced anything outside of yourself! Life has been your art. You have set yourself to music. Your days are your sonnets.

    ―Oscar Wilde predicting Social Media, in The Picture of Dorian Gray



  • Registered Users, Registered Users 2 Posts: 1,163 ✭✭✭hivizman


    Is it necessary to express the relationship between y and x by a single equation?

    If you look closely at the data, you will see that, for values of x between 5 and 10, the value of y falls evenly by 27.33 or 27.34 (assumed to be roundings of 27 1/3 = 82/3) for each unit increase in x. Between 10 and 15, the decrease in y is 28 for each unit increase in x. Between 15 and 20, the decrease in y is 14 for each unit increase in x, while between 20 and 30 the decrease in y is 2.3 for each unit increase in x.

    This means that you can express y exactly using the following set of equations, for the range 5 to 30:

    y = 624 - (82/3)*(x-4) for x between 5 and 10
    y = 460 - 28*(x-10) for x between 10 and 15
    y = 320 - 14*(x-15) for x between 15 and 20
    y = 250 - 2.3*(x-20) for x between 20 and 30

    All the given points lie on the "curve" formed of the four line segments defined by these four equations, and the value of y for non-integer values of x in the given range can be found easily by linear interpolation.


  • Registered Users, Registered Users 2 Posts: 13,076 ✭✭✭✭bnt


    Yep - just plotted the data and noticed the same thing. You don't have a curve, you have a series of straight lines. :cool:

    You are the type of what the age is searching for, and what it is afraid it has found. I am so glad that you have never done anything, never carved a statue, or painted a picture, or produced anything outside of yourself! Life has been your art. You have set yourself to music. Your days are your sonnets.

    ―Oscar Wilde predicting Social Media, in The Picture of Dorian Gray



Advertisement