AndreyBychkov / QBee

Quadratization of differential equations
MIT License
7 stars 2 forks source link

An increase in the order of the derivative of the input variable in the Combustion Process example #6

Closed AndreyBychkov closed 1 year ago

AndreyBychkov commented 2 years ago

In the last commit in master it was enough to have T'' in the system. However, in the next commit in dev with the rework of conditions we must have T''' with no obvious reason. I need to prove whether T''' is actually the correct result or the rework was messed up somewhere. Below I attach the outputs for both:

Master:

Variables introduced in polynomialization:
w_{0} = c1**(-0.8)
w_{1} = c2**(-0.7)
w_{2} = 1/T
w_{3} = exp(-Ea*w_{2}/Ru)

Elapsed time: 0.137s.
==================================================
Quadratization result
==================================================
Number of introduced variables: 5
Nodes traversed: 117
Introduced variables:
w_{4} = T'*w_{2}
w_{5} = T'*w_{2}**2
w_{6} = c2**2*w_{0}*w_{1}*w_{3}
w_{7} = w_{2}**2
w_{8} = c1*c2*w_{0}*w_{1}*w_{3}

c1' = -A*c2*w_{8}
c2' = -2*A*c2*w_{8}
c3' = A*c2*w_{8}
c4' = 2*A*c2*w_{8}
w_{0}' = 4*A*w_{0}*w_{6}/5
w_{1}' = 7*A*w_{1}*w_{8}/5
w_{2}' = -T'*w_{7}
w_{3}' = Ea*w_{3}*w_{5}/Ru
T' = T'
T'' = T''
T''' = 0
w_{4}' = -T'*w_{5} + T''*w_{2}
w_{5}' = T''*w_{7} - 2*w_{4}*w_{5}
w_{6}' = 4*A*w_{6}**2/5 - 13*A*w_{6}*w_{8}/5 + Ea*w_{5}*w_{6}/Ru
w_{7}' = -2*w_{4}*w_{7}
w_{8}' = -A*w_{6}*w_{8}/5 - 3*A*w_{8}**2/5 + Ea*w_{5}*w_{8}/Ru

Dev:

Variables introduced in polynomialization:
w_{0} = c1**(-0.8)
w_{1} = c2**(-0.7)
w_{2} = 1/T
w_{3} = exp(-Ea*w_{2}/Ru)

Elapsed time: 0.163s.
==================================================
Quadratization result
==================================================
Number of introduced variables: 5
Nodes traversed: 123
Introduced variables:
w_{4} = c1*c2*w_{0}*w_{1}*w_{3}
w_{5} = T''*w_{2}
w_{6} = T'*w_{2}
w_{7} = T'*w_{2}**2
w_{8} = c2**2*w_{0}*w_{1}*w_{3}

c1' = -A*c1*w_{8}
c2' = -2*A*c1*w_{8}
c3' = A*c1*w_{8}
c4' = 2*A*c1*w_{8}
w_{0}' = 4*A*w_{0}*w_{8}/5
w_{1}' = 7*A*w_{1}*w_{4}/5
w_{2}' = -w_{2}*w_{6}
w_{3}' = Ea*w_{3}*w_{7}/Ru
T' = T'
T'' = T''
T''' = T'''
T'''' = 0
w_{4}' = -3*A*w_{4}**2/5 - A*w_{4}*w_{8}/5 + Ea*w_{4}*w_{7}/Ru
w_{5}' = -T''*w_{7} + T'''*w_{2}
w_{6}' = -T'*w_{7} + w_{5}
w_{7}' = w_{2}*w_{5} - 2*w_{6}*w_{7}
w_{8}' = -13*A*w_{4}*w_{8}/5 + 4*A*w_{8}**2/5 + Ea*w_{7}*w_{8}/Ru
pogudingleb commented 2 years ago

Looks like a bug to me: one extra derivative of an input should be always sufficient.

AndreyBychkov commented 2 years ago

The funny thing, actually, is that both versions are correct. The problem lies in the branching strategy that does not select the correct variable in quadratization (w2^2) if the upper bound is infinite. So, the actual solution would be to use the domination upper bound or the Hemery-Fages-Soliman M-set.