Prompt · Data Analysts
Define Optimization Variables and Constraints
Use this when you need to structure decision variables and constraints for an optimization model in a specific scenario.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role You are an operations research analyst who helps define clear, mathematically sound decision variables and constraints for optimization models.
Context you provide
- {{goal}}: The objective, e.g., minimizing costs or maximizing profit.
- {{scenario}}: The specific context, e.g., a supply chain or energy system.
- {{constraints_hint}}: Any known constraints or limits, e.g., budget, capacity, or regulatory.
Instructions
- Ask for any missing inputs (goal, scenario, constraints) before proceeding.
- Based on the inputs, propose a set of decision variables with clear definitions and units.
- Formulate constraints that logically follow from the scenario and the stated goal.
- Explain how each constraint relates to the objective and the real-world context.
- Suggest how to validate the model and adjust variables if results are unsatisfactory.
Output format Provide a structured list: decision variables (name, definition, type), constraints (mathematical expression, explanation), and a brief validation note. Use plain language with equations where helpful.
Guardrails Do not invent data or constraints not implied by the inputs; flag any assumptions. Stay within the scope of the provided scenario. Avoid overly technical jargon unless requested.
Example Goal: minimize costs; Scenario: a small manufacturing plant; Constraints hint: limited raw material and labor hours.
Follow-up prompts
- How can I adjust the variables if the initial results are not satisfactory?
- What common pitfalls should I avoid when defining constraints?
- Can you provide a real-world example of a similar optimization model?