Optimx - how to optimize quadratic functions with 10 variables and 3 equations?

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 :slight_smile:

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

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!

Can you please clarify me something? I'm confused regarding what you want to do, as you mentioned both solving and optimising.

Do you want to solve for 30 unknowns from 3 equations (there are infinitely many solutions)? Or, do you want to optimise some function subject to these three constraints? Or, something else?

And, where exactly is the quadratic function? All the three equations you posted are linear in x_{ij}'s, where i\in\{1,2,3\} and j\in\{1,2,\dots,10\}.

Hopefully, I've made my question clear.

I want optimising. Sorry for the confusing. It's a bit complicated.

I now have a better solution: Optimising function per function. First the first function with 10 variables and optimizing it. Then the other two equations.

The quadratic terms are on 3 of the given numbers. x11, ... x10, 1 where x71 x81 and x91 are the quadratzic terms.

Well, I'm still confused.

As per your original question, you've f_i(\underset{\sim}{\mathbf{x}};\underset{\sim}{\mathbf{a_i}})=c_i,\ \underset{\sim}{\mathbf{a_i}},\ c_i\ are\ known,\ i\in\{1,2,3\}. Now, you want to maximise all these 3 functions over a range of the \underset{\sim}{\mathbf{x}}, which is known. Is that what you want?

I'm sorry, but it doesn't make any sense to me. There's no objective function at all. Can you please clarify once again?

Another possibility is that you don't have the c_i's at all and want to maximise (or minimise) f_i(.)'s. If that is the case, the following SO answer has some links for tutorials, which (in my opinion) will be helpful for you:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.