Are all 35 of your constraints differential equations? You only need to specify initial conditions for the differential variables (i.e. the state variables that you are differentiating in your differential equations). You can try using the model size report utility in Pyomo to see how many degrees of freedom you are off by. Add the following lines after discretizing the model:
from pyomo.util.model_size import build_model_size_report
report = build_model_size_report(m)
print(‘Num constraints: ‘, report.activated.constraints)
print(‘Num variables: ‘, report.activated.variables)
If you are trying to solve a forward simulation of a system of ODEs then the number of variables should be equal to the number of constraints.
Bethany
--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
pyomo-forum...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyomo-forum/c7cebb04-6177-4eb5-9a23-03b6ba913b34n%40googlegroups.com.
The problem is noted in the IPOPT status message: “EXIT: Invalid number in NLP function or derivative detected.”
Try adding the following options to your call to the solver to help debug the problem:
solver_options = {‘halt_on_ampl_error’:’yes’}
opt = SolverFactory('ipopt')
results = opt.solve(m, tee=True, symbolic_solver_labels=True, options=solver_options)
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/17089dcc-4cad-4190-a589-ddf867370becn%40googlegroups.com.