discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

help with maths

RW
Raymond West
Sun, Jan 23, 2022 2:47 PM

Hi,

I have the following points on a graph of X,Y, derived empirically, but
I would like to have the formula for their relationship. They seem to
lie on a reasonable curve, bearing in mind the Y values were empirically
derived, to not many decimal places.

[5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1]

I was hoping that there would be a web site somewhere, where i could
enter the x/y values, and out would pop the formula, but so far not
found one. It was a long time ago, if ever, when I had to derive
polynomial formulae. Any help appreciated.

Best wishes,

Ray

Hi, I have the following points on a graph of X,Y, derived empirically, but I would like to have the formula for their relationship. They seem to lie on a reasonable curve, bearing in mind the Y values were empirically derived, to not many decimal places. [5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1] I was hoping that there would be a web site somewhere, where i could enter the x/y values, and out would pop the formula, but so far not found one. It was a long time ago, if ever, when I had to derive polynomial formulae. Any help appreciated. Best wishes, Ray
HL
Hans L
Sun, Jan 23, 2022 3:16 PM

Here is one that seems decent:
https://arachnoid.com/polysolve/

Some example search terms:
polynomial best fit calculator
polynomial regression
curve fitting
etc.

On Sun, Jan 23, 2022 at 8:48 AM Raymond West raywest@raywest.com wrote:

Hi,

I have the following points on a graph of X,Y, derived empirically, but
I would like to have the formula for their relationship. They seem to
lie on a reasonable curve, bearing in mind the Y values were empirically
derived, to not many decimal places.

[5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1]

I was hoping that there would be a web site somewhere, where i could
enter the x/y values, and out would pop the formula, but so far not
found one. It was a long time ago, if ever, when I had to derive
polynomial formulae. Any help appreciated.

Best wishes,

Ray


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Here is one that seems decent: https://arachnoid.com/polysolve/ Some example search terms: polynomial best fit calculator polynomial regression curve fitting etc. On Sun, Jan 23, 2022 at 8:48 AM Raymond West <raywest@raywest.com> wrote: > Hi, > > I have the following points on a graph of X,Y, derived empirically, but > I would like to have the formula for their relationship. They seem to > lie on a reasonable curve, bearing in mind the Y values were empirically > derived, to not many decimal places. > > [5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1] > > I was hoping that there would be a web site somewhere, where i could > enter the x/y values, and out would pop the formula, but so far not > found one. It was a long time ago, if ever, when I had to derive > polynomial formulae. Any help appreciated. > > Best wishes, > > Ray > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AD
Ari Diacou
Sun, Jan 23, 2022 3:39 PM

To work on your question, there is some physics that has to go on:

  1. What were you measuring?
  2. What were your error bars? i.e. how much should we trust each
    measurement?
  3. This looks like it could be a parabola or a lens with the minima at 10,
    or it could be a x^-a kind of graph, again what is being measured?

Desmos might be able to do this, but in University, I was taught to do it
using Excel.

On Sun, Jan 23, 2022 at 9:48 AM Raymond West raywest@raywest.com wrote:

Hi,

I have the following points on a graph of X,Y, derived empirically, but
I would like to have the formula for their relationship. They seem to
lie on a reasonable curve, bearing in mind the Y values were empirically
derived, to not many decimal places.

[5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1]

I was hoping that there would be a web site somewhere, where i could
enter the x/y values, and out would pop the formula, but so far not
found one. It was a long time ago, if ever, when I had to derive
polynomial formulae. Any help appreciated.

Best wishes,

Ray


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

To work on your question, there is some physics that has to go on: 1) What were you measuring? 2) What were your error bars? i.e. how much should we trust each measurement? 3) This looks like it could be a parabola or a lens with the minima at 10, or it could be a x^-a kind of graph, again what is being measured? Desmos might be able to do this, but in University, I was taught to do it using Excel. On Sun, Jan 23, 2022 at 9:48 AM Raymond West <raywest@raywest.com> wrote: > Hi, > > I have the following points on a graph of X,Y, derived empirically, but > I would like to have the formula for their relationship. They seem to > lie on a reasonable curve, bearing in mind the Y values were empirically > derived, to not many decimal places. > > [5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1] > > I was hoping that there would be a web site somewhere, where i could > enter the x/y values, and out would pop the formula, but so far not > found one. It was a long time ago, if ever, when I had to derive > polynomial formulae. Any help appreciated. > > Best wishes, > > Ray > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Sun, Jan 23, 2022 3:59 PM

Since this is the OpenSCAD list, how about a solution using OpenSCAD!
Below is a quadratic least squares fit using BOSL2.  Of course,
whether this is the right thing to do depends on those questions Ari
asked.

include<BOSL2/std.scad>

$fn=16;

data = [[5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1]];

// Solve least squares problem:
x = column(data,0);
y = column(data,1);
const = repeat(1,len(data));
x2 = [for (a=x) a^2];
M = transpose([const, x, x2]);
coef = linear_solve(M,y);

// Here are coefficients, [const, linear, square]
echo(coef);  // It prints: [4.16429, -0.430071, 0.0225]

// Visualize solution
color("black")
stroke([for(x=lerpn(3,12,100)) [x,coef*[1,x,x*x]]], width=.03);

move_copies(data) circle(r=.05);

On Sun, Jan 23, 2022 at 10:39 AM Ari Diacou ari.diacou@gmail.com wrote:

To work on your question, there is some physics that has to go on:

  1. What were you measuring?
  2. What were your error bars? i.e. how much should we trust each measurement?
  3. This looks like it could be a parabola or a lens with the minima at 10, or it could be a x^-a kind of graph, again what is being measured?

Desmos might be able to do this, but in University, I was taught to do it using Excel.

On Sun, Jan 23, 2022 at 9:48 AM Raymond West raywest@raywest.com wrote:

Hi,

I have the following points on a graph of X,Y, derived empirically, but
I would like to have the formula for their relationship. They seem to
lie on a reasonable curve, bearing in mind the Y values were empirically
derived, to not many decimal places.

[5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1]

I was hoping that there would be a web site somewhere, where i could
enter the x/y values, and out would pop the formula, but so far not
found one. It was a long time ago, if ever, when I had to derive
polynomial formulae. Any help appreciated.

Best wishes,

Ray


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Since this is the OpenSCAD list, how about a solution using OpenSCAD! Below is a quadratic least squares fit using BOSL2. Of course, whether this is the right thing to do depends on those questions Ari asked. include<BOSL2/std.scad> $fn=16; data = [[5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1]]; // Solve least squares problem: x = column(data,0); y = column(data,1); const = repeat(1,len(data)); x2 = [for (a=x) a^2]; M = transpose([const, x, x2]); coef = linear_solve(M,y); // Here are coefficients, [const, linear, square] echo(coef); // It prints: [4.16429, -0.430071, 0.0225] // Visualize solution color("black") stroke([for(x=lerpn(3,12,100)) [x,coef*[1,x,x*x]]], width=.03); move_copies(data) circle(r=.05); On Sun, Jan 23, 2022 at 10:39 AM Ari Diacou <ari.diacou@gmail.com> wrote: > > To work on your question, there is some physics that has to go on: > 1) What were you measuring? > 2) What were your error bars? i.e. how much should we trust each measurement? > 3) This looks like it could be a parabola or a lens with the minima at 10, or it could be a x^-a kind of graph, again what is being measured? > > Desmos might be able to do this, but in University, I was taught to do it using Excel. > > On Sun, Jan 23, 2022 at 9:48 AM Raymond West <raywest@raywest.com> wrote: >> >> Hi, >> >> I have the following points on a graph of X,Y, derived empirically, but >> I would like to have the formula for their relationship. They seem to >> lie on a reasonable curve, bearing in mind the Y values were empirically >> derived, to not many decimal places. >> >> [5,2.6],[6,2.35],[7,2.26],[8,2.18],[9,2.13],[10,2.1] >> >> I was hoping that there would be a web site somewhere, where i could >> enter the x/y values, and out would pop the formula, but so far not >> found one. It was a long time ago, if ever, when I had to derive >> polynomial formulae. Any help appreciated. >> >> Best wishes, >> >> Ray >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org