Finding the equation of a curved line

  • I
  • Thread starter LT72884
  • Start date
  • Tags
    equation
In summary, finding the equation of a curved line involves determining a mathematical expression that accurately represents the relationship between the variables of the curve. This process typically requires identifying the curve's type (e.g., polynomial, exponential, etc.), using techniques such as curve fitting, regression analysis, or calculus to derive the equation. By analyzing data points and applying appropriate mathematical methods, one can create an equation that models the curvature and predicts values accurately.
  • #1
LT72884
335
49
Ok, so i have done many math classes, as i am an engineer, however, a theory class and proof class i h ave not done, except maybe one haha.

here is my question, if i draw some sort of curved line by hand, how do i find an equation for that?

for example, i draw half of a tear drop but along the horizontal (like the posted image). How would i find the equation of that line, preferably without a computer? im just wanting to see how this was done back in the past.

thanks

1696301354687.png
 
Mathematics news on Phys.org
  • #2
LT72884 said:
Ok, so i have done many math classes, as i am an engineer, however, a theory class and proof class i h ave not done, except maybe one haha.

here is my question, if i draw some sort of curved line by hand, how do i find an equation for that?

for example, i draw half of a tear drop but along the horizontal (like the posted image). How would i find the equation of that line, preferably without a computer? im just wanting to see how this was done back in the past.

thanks

View attachment 332931
For this I would just guess a functional shape, with some constants to tweak it to fit data if you have it.

$$ y(x) = \sqrt{x} - x $$

Plot it?

Otherwise, you could use the data from the drawing to do Fourier Transform. They can draw anything with those.
 
  • Like
Likes LT72884 and FactChecker
  • #4
erobz said:
For this I would just guess a functional shape, with some constants to tweak it to fit data if you have it.

$$ y(x) = \sqrt{x} - x $$

Plot it?

Otherwise, you could use the data from the drawing to do Fourier Transform. They can draw anything with those.
yeah, its coming up with the functional shape thats tough to do haha.

i mean, how did engineers do this in the past before computers did curve fitting?

thanks
 
  • #5
LT72884 said:
yeah, its coming up with the functional shape thats tough to do haha.

i mean, how did engineers do this in the past before computers did curve fitting?

thanks
Computer programs that "curve fit" a data set still assume a functional form to do so. Are you asking what the computer program (like Excel) is doing under the hood? What people would have done manually at the time of its inception?

If so, that's likely the Method of Least Squares, If not I'm having trouble figuring out what is being asked exactly.
 
  • Like
Likes LT72884
  • #6
erobz said:
Computer programs that "curve fit" a data set still assume a functional form to do so. Are you asking what the computer program (like Excel) is doing under the hood? What people would have done manually at the time of its inception?

If so, that's likely the Method of Least Squares, If not I'm having trouble figuring out what is being asked exactly.
yes, how is this done manually with no computer help.

also what is this least squares method?

thanks
 
  • #7
LT72884 said:
yes, how is this done manually with no computer help.

also what is this least squares method?

thanks
1696375647202.png

The basic idea for the Method of Least Squares:

You have some data points ##( x_1,y_1),(x_2,y_2),(x_3,y_3)##

Say you want to fit a linear function of the form ##y = mx+b## to the data.

You have 2 parameter to adjust ##m##, and ##b## in that form ( If you want to try to fit a different form, like ##y = ax^2 + bx + c##, you have more free parameters that can be adjusted, etc..).

You begin by forming the total squared error. That is some measure of "how far"(just magnitude -hence the squaring) the ##y## value of the function is off from the data when it is evaluated at the independent coordinate of a particular point:

We would have above:

$$ f(m,b) = ( y_1 - (mx_1+ b))^2 + ( y_2 - (mx_2+ b))^2 + ( y_3 - (mx_3+ b))^2 $$

From there you optimize ##f(m,b)## using standard techniques from multivariable Calculus, namely:

$$ \frac{\partial f }{\partial m } = 0 $$

$$ \frac{\partial f }{\partial b } = 0 $$

Are solved simultaneously for the parameters ##m## and ##b## that minimize the sum of squared error i.e. ##f(m,b)##.

For a full explanation you'll be best to search the term "The Method of Least Squares", I just wanted to give you "the flavor" with a basic example.
 
Last edited:
  • Like
Likes LT72884
  • #8
LT72884 said:
yeah, its coming up with the functional shape thats tough to do haha.
ha.

This is something that people unfamiliar with the problem you are trying to solve are least able to help you with. An understanding of the system may tell you that you are looking for a polynomial, or a trig function, or something else. All we can say is "Sure looks like a parabola."
 
  • #9
erobz said:
View attachment 332963
The basic idea for the Method of Least Squares:

You have some data points ##( x_1,y_1),(x_2,y_2),(x_3,y_3)##

Say you want to fit a linear function of the form ##y = mx+b## to the data.

You have 2 parameter to adjust ##m##, and ##b## in that form ( If you want to try to fit a different form, like ##y = ax^2 + bx + c##, you have more free parameters that can be adjusted, etc..).

You begin by forming the total squared error. That is some measure of "how far"(just magnitude -hence the squaring) the ##y## value of the function is off from the data when it is evaluated at the independent coordinate of a particular point:

We would have above:

$$ f(m,b) = ( y_1 - (mx_1+ b))^2 + ( y_2 - (mx_2+ b))^2 + ( y_3 - (mx_3+ b))^2 $$

From there you optimize ##f(m,b)## using standard techniques from multivariable Calculus, namely:

$$ \frac{\partial f }{\partial m } = 0 $$

$$ \frac{\partial f }{\partial b } = 0 $$

Are solved simultaneously for the parameters ##m## and ##b## that minimize the sum of squared error i.e. ##f(m,b)##.

For a full explanation you'll be best to search the term "The Method of Least Squares", I just wanted to give you "the flavor" with a basic example.
Yep, this can always be done by hand, but the calculations (i.e. solving the linear system of ##n## equations) get exponentially more time consuming. I did that with ##n=2## (quadratic fit) and it took me four to five pages of writing.
The drop-like shape will probably require a quartic polynomial fit at least if you want a decent approximation.
Beware of Excel, as it shows very few sig figs in the fit formula. I had to wrote a vba macro (which uses matrix calculations) to get the coefficients with all the 15 sig figs manageable by Excel.
 
  • Like
Likes LT72884
  • #10
Also, choose the sampling points wisely (i.e. denser where your shape is steeper).
 
  • Like
Likes LT72884
  • #11
FranzS said:
Beware of Excel, as it shows very few sig figs in the fit formula. I had to wrote a vba macro (which uses matrix calculations) to get the coefficients with all the 15 sig figs manageable by Excel.
I don't know what version you are (were)running, but you can format the trendline label to show however many sig figs you want in the current Office 365 version.
 
  • #12
FranzS said:
The drop-like shape will probably require a quartic polynomial fit at least if you want a decent approximation.
It looked like a parabola to me so I digitized the curve and rotated the points until my spreadsheet maximized the R² value for a parabola. Almost perfect @ 127°.

rotated half drop 2023-10-04 at 09.29.23.png
 
  • #13
erobz said:
I don't know what version you are (were)running, but you can format the trendline label to show however many sig figs you want in the current Office 365 version.
Nice to know! I'll try that.
 
  • #14
OmCheeto said:
It looked like a parabola to me so I digitized the curve and rotated the points until my spreadsheet maximized the R² value for a parabola. Almost perfect @ 127°.

View attachment 333007
Nice intuition!
 
  • Like
Likes LT72884
  • #16
FranzS said:
Nice intuition!
Thanks!
I suppose if I were stuck on a deserted island without a laptop, I could solve for 3 points picked from the parabolish curve, and solve with simultaneous equations:

given​
given​
x​
y​
ax²​
bx​
c​
y​
-0.057​
-0.017​
0.0030​
-0.057​
1​
-0.017​
-0.41​
0.32​
0.17​
-0.41​
1​
0.320​
-0.60​
0.80​
0.36​
-0.60​
1​
0.798​
matrix math​
curve fit​
a​
1​
2.77​
2.68​
b​
1​
0.330​
0.295​
c​
1​
-0.00724​
-0.00571​
R² =​
0.9996​
0.9999​

Mathematically a bit less accurate, but visually identical.
 
  • #17
i have been messing around with desmos and started to add functions together. y=sqrt(x) -x -x^2 and things like this. but y=sqrt(x)-x produces a nice curve, then i went all fancy from an equation found in my airfoil design book. How the heck did they discover this equation back in the 50's before computers could do this? thats what i want to know? i feel so lazy when i use a PC haha

image
 
  • Like
Likes erobz

FAQ: Finding the equation of a curved line

1. What is a curved line in mathematics?

A curved line, or curve, in mathematics refers to a continuous and smooth path that does not have straight segments. Curves can be represented by various types of equations, such as polynomial, trigonometric, or exponential functions, depending on their shape and properties.

2. How do I find the equation of a curved line given points on the curve?

To find the equation of a curved line given points, you can use methods such as polynomial regression or curve fitting. You can plot the points and use statistical software or a graphing calculator to determine the best-fit curve that passes through or near the points. The resulting equation will describe the relationship of the points along the curve.

3. What is polynomial regression, and how is it used to find curved line equations?

Polynomial regression is a form of regression analysis used to model the relationship between a dependent variable and one or more independent variables by fitting a polynomial equation to the data. It is particularly useful for finding the equation of a curved line when the relationship between variables is nonlinear. By choosing the degree of the polynomial, you can adjust the curve's flexibility to fit the data points accurately.

4. Can I find a curved line equation using calculus?

Yes, calculus can be used to find the equation of a curved line, especially when dealing with curves defined by functions. By using techniques such as differentiation, you can determine the slope of the tangent at any point on the curve, which helps in understanding the curve's behavior. Additionally, integration can be used to find the area under the curve, which is related to the curve's equation.

5. What tools or software can help in finding the equation of a curved line?

There are several tools and software options available for finding the equation of a curved line, including graphing calculators, Excel, and specialized software like MATLAB, Python (with libraries such as NumPy and SciPy), and R. These tools can perform curve fitting, regression analysis, and provide visualizations to help identify the best-fit equation for the given data points.

Similar threads

Back
Top