Estimating translog production function with constraints

Hello.

I am new to stan and trying to estimate a translog production function. My problem is that the estimated function using the sampled coefficients has to be strictly increasing and following the law of diminishing returns.

The first constraint is therefore:
a_i +a_{it}*t+\sum_{j=1}^3a_{ij}*lnx_{jt}>0

The second constraint is:
a_{ij} + (a_i+a_{it}*t+\sum_{j=1}^3a_{ij}*lnx_{jt})^2-(a_j+a_{jt}*t+\sum_{i=1}^3a_{ij}*lnx_{it})<0 for i=j
and
a_{ij} + (a_i+a_{it}*t+\sum_{j=1}^3a_{ij}*lnx_{jt}) * (a_j+a_{jt}*t+\sum_{i=1}^3a_{ij}*lnx_{it})<0 for i \neq j

Is there any way to restrict the parameters so that these constraints are satisfied?

Thank you in advance for any help.