From: Andreas Bauer on
Hello,

a b c
fx 0,639242 0,032636 19,819060
fy 0,003413 -0,646874 273,495500


MustBe x MustBe y Measure X Measure Y
173,000 12,500 130,816 266,000
275,500 28,500 196,860 256,000
139,500 153,000 113,987 175,000


a) How can I calculate it with C++?
b) How is the correct algorithm? If I make it by hand.
Have somebody a good instruction?
c) Maybe I can use Excel, or?



Thanks. Regards Andreas
From: Giovanni Dicanio on
On 08/06/2010 09:33, Andreas Bauer wrote:

> a) How can I calculate it with C++?
> b) How is the correct algorithm? If I make it by hand.
> Have somebody a good instruction?
> c) Maybe I can use Excel, or?

Excel can compute regressions out-of-the-box: the Excel programmers
already wrote the regression code, so you could just use it via the
Excel user interface.

If you want to write your own regression routine/class in C++, you may
want to start from the mathematical description of the problem, which
you could find e.g. on Wikipedia:

http://en.wikipedia.org/wiki/Linear_regression_model

and if you practice your <<insert search engine here>> skills, you could
find already written C/C++ code (actually, in the aforementioned
Wikipedia article, there are links to that).

HTH,
Giovanni
From: Andreas Bauer on
Hello Giovanni,
here I send more details and hope is clear.
I need more informations, it is not so easy.

I hope the pictures are clear.
http://www1.minpic.de/bild_anzeigen.php?id=114414&key=77476860&ende

http://www1.minpic.de/bild_anzeigen.php?id=114415&key=92154987&ende


First, I measure my 3 or more points.
Second, I check the units(steps) to the axis. (Step motor)
Third, I should calculate the coefficient.

How is the best, easiest way?

Thanks for tipps.

Greeting Andreas.
From: Joseph M. Newcomer on
See below...
On Tue, 08 Jun 2010 09:33:01 +0200, Andreas Bauer <com(a)news.de> wrote:

>Hello,
>
> a b c
>fx 0,639242 0,032636 19,819060
>fy 0,003413 -0,646874 273,495500
>
>
>MustBe x MustBe y Measure X Measure Y
>173,000 12,500 130,816 266,000
>275,500 28,500 196,860 256,000
>139,500 153,000 113,987 175,000
>
>
>a) How can I calculate it with C++?
****
How do you calculate it *without* C++? Just convert that formula to C++ code!
*****
>b) How is the correct algorithm? If I make it by hand.
> Have somebody a good instruction?
****
I have no idea what you want, so I have no way of knowing what you got, and whether or not
it is correct. That's going to be *your* problem to determine its correctness.
****
>c) Maybe I can use Excel, or?
*****
If you have an algorithm, you code it in any language you want. If you don't have an
algorithm, you can't code it in any language.

See

http://en.wikipedia.org/wiki/Regression_analysis
****
>
>
>
>Thanks. Regards Andreas
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Andreas Bauer on
Hello Joseph
>
> http://en.wikipedia.org/wiki/Regression_analysis
> ****
>>
>>
>> Thanks. Regards Andreas
> Joseph M. Newcomer [MVP]
it is not clear.
On my Excel sheet, you see may problem

Two axis

x
y

Customer insert the values in mm, axis controller needs steps.
First I should calibrate the system.
http://www.fileuploadx.de/49586

How?
How I get a,b and the offset c?

Do you have a step by step instruction. Tutorial?

Thanks.
Regards Andreas