Hello, i would like to ask about a complicated mathematical model if it is valid for pynomo
1 unknown: y
5 variables: x1, x2, x3, x4, x5
equation:
y= x1* (a*x1 +b* x2 + c* x3 + d* x4+ e* x5+ f) + x2* (g*x2+h*x3 + i*x4 + j*x5 + k) + X3* (L*x3 +m*x4 + n*x5 + o) + x4* (p*x4 + q*x5 + r) + x5* (s*x5+t) + u
from a to u are constants
6 variables equation

 Posts: 3
 Joined: Thu Jan 16, 2014 3:11 pm
Re: 6 variables equation
Hello,
I think this is tough question. Equation is possible to cast into nomographic form if it can be turned into determinant of matrix equals zero, where each row of matrix has functions of only one or two variables. In your case this could be threegrid nomograph and a determinant of matrix:
[f1, g1, h1],
[f2, g2, h2],
[f3, g3, h3]
where for example functions f1,g1 and h1 are functions of x1,x2, etc.
I wrote small script to build this general determinant form with python and sympy. Just uncomment to see some terms. It is to be noted that each term has in the end quite a sum of coefficients. For example the last line:
detr.coeff(x1,1).coeff(x2,1)
print coefficients of x1*x2 term (your b) and result here reproduced is:
f1_0*g2_0*h3_3 + f1_0*g2_1*h3_2 + f1_0*g2_2*h3_1 + f1_0*g2_3*h3_0  f1_0*g3_0*h2_3  f1_0*g3_1*h2_2  f1_0*g3_2*h2_1  f1_0*g3_3*h2_0 + f1_1*g2_0*h3_2 + f1_1*g2_2*h3_0  f1_1*g3_0*h2_2  f1_1*g3_2*h2_0 + f1_2*g2_0*h3_1 + f1_2*g2_1*h3_0  f1_2*g3_0*h2_1  f1_2*g3_1*h2_0 + f1_3*g2_0*h3_0  f1_3*g3_0*h2_0  f2_0*g1_0*h3_3  f2_0*g1_1*h3_2  f2_0*g1_2*h3_1  f2_0*g1_3*h3_0 + f2_0*g3_0*h1_3 + f2_0*g3_1*h1_2 + f2_0*g3_2*h1_1 + f2_0*g3_3*h1_0  f2_1*g1_0*h3_2  f2_1*g1_2*h3_0 + f2_1*g3_0*h1_2 + f2_1*g3_2*h1_0  f2_2*g1_0*h3_1  f2_2*g1_1*h3_0 + f2_2*g3_0*h1_1 + f2_2*g3_1*h1_0  f2_3*g1_0*h3_0 + f2_3*g3_0*h1_0 + f3_0*g1_0*h2_3 + f3_0*g1_1*h2_2 + f3_0*g1_2*h2_1 + f3_0*g1_3*h2_0  f3_0*g2_0*h1_3  f3_0*g2_1*h1_2  f3_0*g2_2*h1_1  f3_0*g2_3*h1_0 + f3_1*g1_0*h2_2 + f3_1*g1_2*h2_0  f3_1*g2_0*h1_2  f3_1*g2_2*h1_0 + f3_2*g1_0*h2_1 + f3_2*g1_1*h2_0  f3_2*g2_0*h1_1  f3_2*g2_1*h1_0 + f3_3*g1_0*h2_0  f3_3*g2_0*h1_0
So there is quite a task to find your variables a,b,c,... from variables f1_0,... if possible. It is interesting if this solves out.
br,
\leif
I think this is tough question. Equation is possible to cast into nomographic form if it can be turned into determinant of matrix equals zero, where each row of matrix has functions of only one or two variables. In your case this could be threegrid nomograph and a determinant of matrix:
[f1, g1, h1],
[f2, g2, h2],
[f3, g3, h3]
where for example functions f1,g1 and h1 are functions of x1,x2, etc.
I wrote small script to build this general determinant form with python and sympy. Just uncomment to see some terms. It is to be noted that each term has in the end quite a sum of coefficients. For example the last line:
detr.coeff(x1,1).coeff(x2,1)
print coefficients of x1*x2 term (your b) and result here reproduced is:
f1_0*g2_0*h3_3 + f1_0*g2_1*h3_2 + f1_0*g2_2*h3_1 + f1_0*g2_3*h3_0  f1_0*g3_0*h2_3  f1_0*g3_1*h2_2  f1_0*g3_2*h2_1  f1_0*g3_3*h2_0 + f1_1*g2_0*h3_2 + f1_1*g2_2*h3_0  f1_1*g3_0*h2_2  f1_1*g3_2*h2_0 + f1_2*g2_0*h3_1 + f1_2*g2_1*h3_0  f1_2*g3_0*h2_1  f1_2*g3_1*h2_0 + f1_3*g2_0*h3_0  f1_3*g3_0*h2_0  f2_0*g1_0*h3_3  f2_0*g1_1*h3_2  f2_0*g1_2*h3_1  f2_0*g1_3*h3_0 + f2_0*g3_0*h1_3 + f2_0*g3_1*h1_2 + f2_0*g3_2*h1_1 + f2_0*g3_3*h1_0  f2_1*g1_0*h3_2  f2_1*g1_2*h3_0 + f2_1*g3_0*h1_2 + f2_1*g3_2*h1_0  f2_2*g1_0*h3_1  f2_2*g1_1*h3_0 + f2_2*g3_0*h1_1 + f2_2*g3_1*h1_0  f2_3*g1_0*h3_0 + f2_3*g3_0*h1_0 + f3_0*g1_0*h2_3 + f3_0*g1_1*h2_2 + f3_0*g1_2*h2_1 + f3_0*g1_3*h2_0  f3_0*g2_0*h1_3  f3_0*g2_1*h1_2  f3_0*g2_2*h1_1  f3_0*g2_3*h1_0 + f3_1*g1_0*h2_2 + f3_1*g1_2*h2_0  f3_1*g2_0*h1_2  f3_1*g2_2*h1_0 + f3_2*g1_0*h2_1 + f3_2*g1_1*h2_0  f3_2*g2_0*h1_1  f3_2*g2_1*h1_0 + f3_3*g1_0*h2_0  f3_3*g2_0*h1_0
So there is quite a task to find your variables a,b,c,... from variables f1_0,... if possible. It is interesting if this solves out.
br,
\leif
Code: Select all
from sympy import *
x1,x2,x3,x4,x5,x6 = symbols("x1,x2,x3,x4,x5,x6")
f1,f2,f3,g1,g2,g3,h1,h2,h3 = symbols("f1,f2,f3,g1,g2,g3,h1,h2,h3")
#f1
f1_0,f1_1,f1_2,f1_3,f1_4,f1_5 = symbols("f1_0,f1_1,f1_2,f1_3,f1_4,f1_5")
f1=f1_0+f1_1*x1+f1_2*x2+f1_3*x1*x2+f1_4*x1**2+f1_5*x2**2
#g1
g1_0,g1_1,g1_2,g1_3,g1_4,g1_5 = symbols("g1_0,g1_1,g1_2,g1_3,g1_4,g1_5")
g1=g1_0+g1_1*x1+g1_2*x2+g1_3*x1*x2+g1_4*x1**2+g1_5*x2**2
#h1
h1_0,h1_1,h1_2,h1_3,h1_4,h1_5 = symbols("h1_0,h1_1,h1_2,h1_3,h1_4,h1_5")
h1=h1_0+h1_1*x1+h1_2*x2+h1_3*x1*x2+h1_4*x1**2+h1_5*x2**2
#f2
f2_0,f2_1,f2_2,f2_3,f2_4,f2_5 = symbols("f2_0,f2_1,f2_2,f2_3,f2_4,f2_5")
f2=f2_0+f2_1*x1+f2_2*x2+f2_3*x1*x2+f2_4*x1**2+f2_5*x2**2
#g2
g2_0,g2_1,g2_2,g2_3,g2_4,g2_5 = symbols("g2_0,g2_1,g2_2,g2_3,g2_4,g2_5")
g2=g2_0+g2_1*x1+g2_2*x2+g2_3*x1*x2+g2_4*x1**2+g2_5*x2**2
#h2
h2_0,h2_1,h2_2,h2_3,h2_4,h2_5 = symbols("h2_0,h2_1,h2_2,h2_3,h2_4,h2_5")
h2=h2_0+h2_1*x1+h2_2*x2+h2_3*x1*x2+h2_4*x1**2+h2_5*x2**2
#f3
f3_0,f3_1,f3_2,f3_3,f3_4,f3_5 = symbols("f3_0,f3_1,f3_2,f3_3,f3_4,f3_5")
f3=f3_0+f3_1*x1+f3_2*x2+f3_3*x1*x2+f3_4*x1**2+f3_5*x2**2
#g3
g3_0,g3_1,g3_2,g3_3,g3_4,g3_5 = symbols("g3_0,g3_1,g3_2,g3_3,g3_4,g3_5")
g3=g3_0+g3_1*x1+g3_2*x2+g3_3*x1*x2+g3_4*x1**2+g3_5*x2**2
#h3
h3_0,h3_1,h3_2,h3_3,h3_4,h3_5 = symbols("h3_0,h3_1,h3_2,h3_3,h3_4,h3_5")
h3=h3_0+h3_1*x1+h3_2*x2+h3_3*x1*x2+h3_4*x1**2+h3_5*x2**2
""" #uncomment to see functions in matrix
print f1
print g1
print h1
print f2
print g2
print h2
print f3
print g3
print h3
"""
matr = Matrix([[f1,g1,h1],[f2,g2,h2],[f3,g3,h3]])
detr = matr.det().expand(basic=True)
#print matr #uncomment to see matrix
#print detr #uncomment to see determinant
detr.coeff(x1,1).coeff(x2,1)

 Posts: 3
 Joined: Thu Jan 16, 2014 3:11 pm
Re: 6 variables equation
thank you so much. i have already tried a lot to do that but i couldn't. i think i have to simplify the equation as much as possible.
Re: 6 variables equation
Are you trying to make nomograph of some specific equation or just work a very general case?
If you have a specific equation as polynomial approximation, it could be easier to use the original equation. If you could post the original equation here (or with email if you want to limit the audience)?
br,
\leif
If you have a specific equation as polynomial approximation, it could be easier to use the original equation. If you could post the original equation here (or with email if you want to limit the audience)?
br,
\leif
Last edited by Leif on Sat Jan 18, 2014 8:55 pm, edited 1 time in total.

 Posts: 3
 Joined: Thu Jan 16, 2014 3:11 pm
Re: 6 variables equation
i have about 150,000 readings of 6 variables. i used SYSTAT to predict a suitable equation with the highest possible R^2 value. there was no reference equation for me
Re: 6 variables equation
One possibility to try is to fit your data to the nomographic matrix form. In my script there were 9X6=36 variables to tune (for example f1_0,f1_1,f1_2,f1_3,f1_4,f1_5, etc.). One could pick up some (clever) set from these variables and to try to fit data to tune them.
br,
\leif
br,
\leif
Who is online
Users browsing this forum: No registered users and 0 guests