Hello People,

I have a difficult **problem**:

- quadratic equation with 3 equations and 10 variables
- source: a unknown 3-10 matrix to transform a 3-d-coordinate system to another 3-d-coordinate system
- formula for the equation system:

x11xA + x12xB + ... x1,10xJ = L*

x21xA + ... x2,10xJ = a*

x31xA + ... x3,10xJ = b*

--> Find the matrix of x11 ... x33!

--> A ... J is given.

Now either you can solve it manually via t-equations (solution equations with t in it) OR:

**Solutions (automatic):**

*Excel Solver* (it don't works with so many variables and for quadratic equations its even more problematic and the result is crap, i checked it by multiplying the x11 ... x33 with the A ... J and the result is NOT the true result from my data).

**R: optim() and optimx():**

So i'm a newbie in R and only had a half year of experience but not regulary.

So i need a explanation of the code you given me, please

So i searched for optim and it works with distributions. But how can i put this equation system in the optimx() function?

Arguments:

3 equations are the formulas i want to optimize, that the results match given values. You can see it like a simple example:

3x + 4y -2z = 20

-x + 2y + 5z = 14

Find x, y and z by optimizing the values of x, y and z!

I know the upper and lower limit of my 3-D-coorinate-system.

But now the problem gets bigger:

This way i use the maximize option in optimx().

But actually my calculated values are just a part of another calculated values which i want to get minmized.

The calculated values L*, a* and b* has to match given values of L*, a* and b*. Ok. But now another value is calculated of L*, a* and b*. So this new value *deltaE calc* is subtracted by *deltaE given*. *deltaE given* is calculated from the given L*, a* and b* values. And now the mean of the difference has to be minimized! This is the same as when you go for the first solution, when calculated L*, a* and b* values have to be the same as the given L*, a* and b* values.

I know it sounds complicated but in reallity its so simple...

I can solve it by hand but it will took me a lot of time and i have a lot of data. Excel doesn't works and with R i have less experience. I need help!