This email may contain confidential and privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please reply back to the sender about the error and delete all copies of this email message. Thank you.
--
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.
For more options, visit https://groups.google.com/d/optout.
Hi,
Note that you can also create “indexed” variables (not sure if this is what you need or not). For example,
model.x = Var(range(5), initialize=qw, bounds=(l,u))
will create x[0] through x[4].
In my opinion, the best reference right now is the Pyomo Book. The second edition is now out, and available in the libraries at many universities. We are working on updates to the online documentation now. This should be available soon (if not already).
Regards,
Carl.
Correct. “The Pyomo Book” on that page is the reference I meant. Please note that the second edition is the current edition. Several things have changed, and the first edition will be quite out of date.
One of the reasons add_component is not documented in the book is because most (but not all) modeling problems can be captured more simply with the indexed component notation that I referenced. The book should explain the concept of indexed components pretty clearly.
WARNING: Loading a SolverResults object with a warning status into
model=unknown;
message from solver=Ipopt 3.11.1\x3a Iterates diverging; problem might
be unbounded.
I see that you have added constraints that say x3==3 and x4==50, but you have bounds on those variables that do not contain these values.
From: "harish.padmakar via Pyomo Forum" <pyomo...@googlegroups.com>
Reply-To: "pyomo...@googlegroups.com" <pyomo...@googlegroups.com>
Date: Thursday, May 17, 2018 at 10:34 AM
To: Pyomo Forum <pyomo...@googlegroups.com>
Subject: [EXTERNAL] Re: How to dynamically create variables (model.x1,model.x2..etc) with different 'initialize' and 'bounds' in pyomo
Carl and John, Could you please take a look at my model(attached image) and tell me if the objective, constraints and variables are created properly. Thank you!
I get the below error,
WARNING: Loading a SolverResults object with a warning status into
model=unknown;
message from solver=Ipopt 3.11.1\x3a Converged to a locally infeasible
point. Problem may be infeasible.
No idea why.
On Thursday, 17 May 2018 17:35:30 UTC+5:30, harish....@latentview.com wrote:
Hi,
Is there a way to loop and create new variables in pyomo?
Eg:
OLD
model.x1 = Var( initialize= 1.0, bounds=(1.0,5.0) )
model.x2 = Var( initialize= 5.0, bounds=(1.0,5.0) )
NEW
for i in range(1):
model.x + str(i) = Var( initialize= qw, bounds=(l,u) )
Please help! Thanks!
This email may contain confidential and privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please reply back to the sender about the error and delete all copies of this email message. Thank you.
This email may contain confidential and privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please reply back to the sender about the error and delete all copies of this email message. Thank you.
--
WARNING: Loading a SolverResults object with a warning status into model=unknown; message from solver=Ipopt 3.11.1\x3a Converged to a locally infeasible point. Problem may be infeasible.This error is indicating that the solver could not find a feasible solution. I was pointing out that the constraints were NOT feasible as written.
The question is really if the two approaches are returning the same objective value. If they are not, then you have a discrepancy in your model formulations. If they are, then your model is degenerate: there are multiple – potentially infinitely many – solutions that all evaluate to the same objective value. In that case, they are all mathematically equivalent and the single solution returned by the solver is arbitrary and depends greatly on the solver implementation. If you have a preference as to the solution you get back, you will need to change your model to break the degeneracy (e.g., through regularization).
john
From: harish.padmakar via Pyomo Forum [mailto:pyomo...@googlegroups.com]
Sent: Monday, May 28, 2018 5:31 AM
To: Pyomo Forum <pyomo...@googlegroups.com>