- 16
- 30 388
Dr. Katie
Приєднався 29 чер 2022
Hi! I'm an Associate Professor in the Industrial and Systems Engineering Department at Rochester Institute of Technology. I have my PhD in Industrial Engineering from University of Buffalo, and am excited to share some materials with you to make your Operations Research journey easier. These materials have helped students in my Introduction to Operations Research class. I hope they can help you too. We'll start with some tutorials on using Pyomo and GLPK to write and solve simple linear programs.
Pyomo for MCNFP Shortest Path Problem - Decision Variables, Objective and Constraints (Part 2)
This video is part 2 of 2 videos that reviews a shortest path problem and formulates the problem using the Pyomo python library.
This video was made to support an undergraduate introductory course to operations research. The audience is meant to be new to linear programming with minimal coding skills.
This video was made to support an undergraduate introductory course to operations research. The audience is meant to be new to linear programming with minimal coding skills.
Переглядів: 988
Відео
Pyomo for MCNFP Shortest Path Problem - Sets Parameters Data File (Part 1)
Переглядів 8272 роки тому
This short tutorial is video 1 of 2 covering coding a shortest path problem in Pyomo. This video goes over the general shortest path problem formulation and is followed by writing the sets, parameters and the data file. We introduce the concept of arcs in this video for the first time. This video was made to support an Introduction to Operations Research undergraduate class. The content is mean...
PYOMO Transportation Problem - Decision Variables, Objective Function,, and Constraints (Part 2)
Переглядів 1,5 тис.2 роки тому
This video explains details of the classic Transportation problem linear programming formulation as well as takes the viewer through coding the formulation using the Pyomo python library. This is video 2 in a two part series covering the transportation problem. These videos were originally created as pre-lab materials for an introduction to operations research class. Students with a basic knowl...
Pyomo Transportation Problem - Sets Parameters and Data File (Part 1)
Переглядів 2,4 тис.2 роки тому
This video covers a brief review of transportation problems and then begins formulating the transportation problem using the Pyomo python library. This two part tutorial was made for an Introduction to Operations Research course. They are intended for students new to linear programming with minimal coding abilities. The powerco problem in this video series is originally from Wayne Winston's Int...
Advanced Pyomo - OJ Juice Running Abstract Models (Part 4)
Переглядів 6612 роки тому
This is the fourth and final video that has covered formulating the OJ Juice company linear program as an abstract model, and then coding it in Pyomo. This video covers running the model, and then demonstrates how abstract model formulations make it easy to expand and contract a model simply by changing the data file. This series of videos was made for an Introduction to Operations Research cou...
Advanced Pyomo - OJ Juice Objective and Constraints (Part 3)
Переглядів 7282 роки тому
This is video 3 of a 4 part series that covers translating a concrete linear program into an abstract form, and then coding that abstract model into pyomo. This video in particular covers coding an objective function with two summations, and sets of constraints with summations in them. This video was made for a introduction to operations research lab. It's target audience is beginner linear pro...
Advanced Pyomo - OJ Juice Sets Params Data File and DV (Part 2)
Переглядів 5672 роки тому
This video covers coding the sets, parameters and decision variables of the OJ Juice Company model using the Pyomo python library. Files used in this video can be found here: drive.google.com/drive/folders/1ySmCuh_oaNhdZTEHdU9IPOCGduA4PVxv?usp=sharing This video is part 2 of a 4 part series. If you are unfamiliar with the OJ Juice Company model formulation you may want to start on video 1 of th...
Advanced Pyomo - OJ Juice Concrete to Abstract (Part 1)
Переглядів 1,1 тис.2 роки тому
This is the first video in a series that will use the Pyomo library to formulate an abstract linear programming. This particular video covers translating a concrete model formulation into an abstract model. This video was made for an introduction to operations research class and is meant for beginner linear programmers. The notation of linear programs can be confusing, this video walks through ...
Jeff Learns About the Supply Chain
Переглядів 1522 роки тому
A brief introduction to supply chain. This video was created as a sample for students given a project related to creating simple Industrial Engineering videos with nawmalEDU. This video was made by Wheel Move You a team from the Material Handling Teaching Institute of 2022.
Beginner's Guide to Pyomo for Abstract Linear Programs - Solving the Model (Part 4)
Переглядів 1,9 тис.2 роки тому
This video is the last in a four part series to formulate an abstract linear program using the Pyomo python library. This particular video goes over combining the model and data file into an instance, solving the model instance, and interpreting the solution of the CSL model formulation. These videos were originally made for third year Industrial Engineering students taking an introduction to o...
Beginner's Guide to Pyomo for Abstract Linear Programs - Constraints (Part 3)
Переглядів 1,3 тис.2 роки тому
This is the third of four videos in a series which is covering how to write and solve abstract linear programs using Pyomo. This video covers writing the constraints of the CSL abstract model. These videos were initially made for 3rd year Industrial Engineering students taking an Introduction to Operations Research Course. These videos are meant for students new to linear programming, and for t...
Beginner's Guide to Pyomo for Abstract Linear Programs - Decision Variables & Obj Function (Part 2)
Переглядів 1,6 тис.2 роки тому
This is the second of four videos in a series which is covering how to write and solve abstract linear programs using Pyomo. This video covers writing the decision variables and the objective function of the CSL abstract model. These videos were initially made for 3rd year Industrial Engineering students taking an Introduction to Operations Research Course. These videos are meant for students n...
Beginner's Guide to Pyomo for Abstract Linear Programs - Sets Parameters and Data Files (Part 1)
Переглядів 4,4 тис.2 роки тому
This video tutorial is the first of a four part series that introduces the novice linear programmer to writing abstract linear programs using the Pyomo library. This video will cover: 1. A Review of the CSL concrete model and its abstract formulation 2. Coding the sets and parameters in the model file 3. Creating a data file to hold the values of the parameters and sets. This video was original...
Pyomo Concrete Models - Error Handling and Data Extraction
Переглядів 7962 роки тому
This video covers a few more details related to concrete models formulated in Pyomo. We cover adding some code for error handling, as well as code to extract data values (such as decision variable values) from our solved model. These videos were made for 3rd year Industrial Engineering students. They are meant for students with little to no coding experience who are new to linear programming. F...
Gentle Intro to Pyomo Concrete Models
Переглядів 7 тис.2 роки тому
This video provides an easy to follow introduction to writing and solving linear programs using the Pyomo python library. We start with simple concrete models. The video is for absolute programming beginners. The video assumes you have installed python and GLPK. If you have not, simply watch this video (ua-cam.com/video/SCmAqjqQoPo/v-deo.html) to follow along using Google Colab. This video was ...
Intro to Pyomo and GLPK for Google Colab
Переглядів 4,3 тис.2 роки тому
Intro to Pyomo and GLPK for Google Colab
Very helpful, thank you so much!
It is incredibly hard to focus with this massive amount of background noise sounds like an airplane engine
Can you use this approach when your source file is .xlsx so excel files?
1. Record voice better without noise. 2. Changue the size and type of the Code, now it's horrible for read
I've watched several videos for pyomo in youtube but this is the best tutorial pyomo videos in youtube
That’s really kind of you to say. Thank you!
Is there an easy way to omit the answers with value 0 from the solution?
The easiest thing to do would be to add a for loop at the end of the code that loops through all the arcs. Have an if statement that says if the arc is equal to 1, print out something. Something like: for (i,j) in instance.ARCS: if instance.x[i,j]()==1: print("Travel Arc:",i,"-",j,sep=",")
Thanks for responding so quickly! I see, so it has to be done for every variable? I will absolutely give it a try, though I was hoping for something similar to option omit_zero_rows 1; as in AMPL 😅
Hi Dr. Katie, I have a query, if in the mentioned probelm, supply is dependent on the qty from plants, can it be solved using Pyomo? To me it seems, the problem will become non linear... and i'm still figuring out how to do it?
Is the supply known or the qty from the plants known?
Hi Katie. Thanks a lot for your kind lectures. I have a question about the 'set' in .dat file. In your case, 'month' is simple which is sort of a list just including 5 elements. But how about I tend to use/introduce timeindex (e.g., Pandaframe index) values to be a set variable 'time'? It could be very long since there will be 1440 elements if the time interval is one minute for one day (24*60). how could I realize that? do I need to type them into a .dat file manually?
I would recommend within your model file using a range set. So you could do something like: model.MONTHS = RangeSet(1,timeindex.length(),1) This would create a set with the numbers 1 through the length of the number of elements in your panda data frame, then just leave the set definition out of the data file.
Thank you Prof Katie... I diligently follow your uploads... Your step by step approach to code an optimization problem is immensely helpful... Thanks once again...
Hi. May I know where is the 3rd video of this problem?
I don’t believe there is a third video.
@@DrKatieRIT Thanks for your response. I thought there would be a step to solve the problem.
After completing the writing of objective function and constraints you have to write few more lines as following: \\\\\\\\ data = DataPortal() data.load(filename='transportation.dat', model=model) instance = model.create_instance(data=data) optimizer = SolverFactory('gurobi') results = optimizer.solve(instance) instance.display() print(results)
i need to make aproject can tell me a dataset that is kinda realsitic
Thanks doctor Katie for the very patient explanation. It helped me a lot. Please check out HiGHS solver also, it is MIT licensed (CBC, Ipopt and CPLEX are Eclipse licensed) and almost as good as Gurobi in some cases
Hi Dr. Katie, I had a question about the constraints and the objective. In the objective you use 2 for loops within the sum() to represent a double sum. In the constraints you had one for loop and said "for every 'i' in Supply". I was wondering if there was a specific reason you passed in 'i' to the constraint function 'supply_rule()' rather than have 2 for loops within a sum() function to represent all of your supply_rules() in one function, similar to how you have in the objective function. To me, these seem equivalent so I'm just trying to make sure I'm not missing something here either with Pyomo or mathematical modeling. I love the videos so far, I'm haven't been in school in a long time but this makes me want to go back!
Hi Adam! Great question. In the objective function we are adding up the cost of everything sent across ALL the arcs in the ENTIRE network. The double summation will accomplish this nicely because we do indeed want to sum up all the costs. In the supply constraints we want to make several distinct constraints, in this particular problem we want to make 1 constraint for each power plant that says "If I add up everything leaving this one particular power plant, I want to make sure it exactly equals the supply at this particular power plant." Passing in "i" to the supply function is the part that tells pyomo which supply node we are making a constraint for. We want to do them one at a time. Inside the supply constraint we only want to sum over the index j, in this case cities, because we want to hold the power plant constant for a single supply constraint, and just add up all the demand that is leaving a single plant and going to each of the cities. So a supply constraint for plant 1 would look something like: S11+S12+S13+S14 ==35. Pyomo would also make these other two constraints: S21+S22+S23+S34==50 S31+S32+S33+S34==40 If we did what you suggest and used a double summation in the constraint, and did not pass in a power plant i to the constraint function, pyomo would create the following single constraint: S11+S12+S13+S14+S21+S22+S23+S24+S31+S32+S33+S34==35+50+40 (Not even sure what you'd put on the right hand side because this doesn't make sense). This lumped together version of the supply constraints won't work properly. For example, you could have S11 = 125, and all the other Sij =0. The constraint would be satisfied, but we know this is impossible because Plant 1 doesn't even have 125 units of power to send, and plants 2 and 3 are sending nothing, but we also know that is against the rules too. So we must make one supply constraint for each supply node to ensure the node sends all its supply, and the way the problem is formulated in the example accomplishes this. Hope this helps.
Thank you Dr. Katie. You're the best.
Love your video! Thank you ! Please keep making them!
Thank you for this video! It really helps!
Hi Dr Katie, thank you for putting the lecture together. I'm just starting to learn modeling with Pyomo and these lectures are just wonderful.
Thank you for this Dr. Katie. Maximally helpful.
shouldn't your variables be integers and not continuous?
Yes and know. You can definitely hire "part time workers", so we'll assume that is the case for this problem.
One of the bests, if not the very best of the tutorials on Pyomo. You made it so so simple, descriptive and insightful. You are indeed a teacher!
please make more videos. specially how to write an equality constraint in pyomo. Loved your explanation of every step.
Hi Ali, I'm sure I have an example somewhere of an equality constraint, check out the transportation problems they for sure have one. But in the meantime, when you have an equality constraint instead of "<=" you need two equal signs "==". That tells python to do a comparison rather than set a variable value.
This video has equality constraints: ua-cam.com/video/b8YfCIZY2xI/v-deo.html
This is beautiful. Any chance a copy of the files can be provided as it just shortens definition time and avoids syntax errors
Hi James! Making those syntax mistakes and fixing them is part of the learning process. If you ever get too stuck just reach out and I'd be happy to help.
I understand when you have a parameter that has two subscripts, but... how do you organize your data file when a parameter has three or more subscripts?
Learning about Pyomo from scratch by googling is tough. There is a lot of content out there that is overly complicated and case-specific. Having clear and simple examples really helps! Thanks a bunch!
Thanks Raymund! Glad I could help.
How can I install ipopt?
Hi Dr.Katie I would like to ask how would do an objective function that has three summations in a row? Kind regards, Juan
Hi Juan! Check out this video here: ua-cam.com/video/IZkHhq71myU/v-deo.html This one shows an example of an objective function with two summations, for three you follow the same pattern, except you just add in one more "for k in SETWHATEVER" at the end. Hope this helps. -Dr. Katie
Hello Doc. You are the best. I give it to you! Teachers are rare, yours is exceptional. I can't evbe figure out how you are able to do it. You are literally teaching us python and Pyomo at the same time and you make it so so easy and simple. Thanks so so much ❤
why in my notebook the value is not available?:(
I’m not sure what you mean. Can you explain your error a bit more?
Hi Dr. Katie, you are really awesome. Please continue to teach us more. Thanks a lot.
Lovely video! Very clear and fun. I like the light way you explain things.
Thank you!
@@DrKatieRIT Could I possibly use it for illustration of my abstract course of optimization methods?
@@malgosianowak You can use my videos for whatever you'd like, just please provide acknowledgment, and links to these videos.
@@DrKatieRIT Thank you! I will.
@@DrKatieRIT If you gave me your family name, the credentials would look better. (If you think it's a good idea) I could not find you on RIT. :)
This really helped me a lot; thank you. Was able to get CPLEX and HiGHS solvers to run the model also.
Thank you so much, I was looking for a solution for hours. I found the solution to my problem in your video. Thanks a lot
Glad you found a solution!!!!!
Thank you, Dr. Katie. It really clears up my understanding of Pyomo!
thanks a million
Me ayudo muchisimo!! You are the best
Gracias!
OMG you are the best
Wow!
I appreciate your efforts and it is well elaborated however, I am still confused about the way you modelled the quality constraint from 08:46 to 12:15.
These constraints are easiest to understand if you make yourself a concrete example. For instance, what would be the average quality of orange juice if you had 5 quality 6 oranges and 3 quality 9 oranges? It would be (6+6+6+6+6+9+9+9)/8 = 7.125. This is just (6* # of quality 6 + 9 * # quality 9) / (Total Oranges) = (6*5+9*3)/(5+3) = 7.125. Once you understand how to find the average of a group of things, the rest is just simplifying the constraint so that it doesn't involve division which is a non-linear operation.
Hi Katie, Followed the entire playlist. It's very well explained and super informative. Thanks for making and sharing it.
Excellent work. Please keep your work posted. It is so amazing Katie, Professor
Your use of examples and graphics to explain complex scenarios is extremely helpful. By way Professor Katie likes Lama :)
Content like this is highly appreciated. Thank You, Professor Katie. I am trying to reproduce the same and With data=DataPortal() data.load(filename='abstractmodelcreation.dat', model=model) instance = model.create_instance(data) the error is: AttributeError: 'DataPortal' object has no attribute 'is_constructed' while with, data=DataPortal() data.load(filename='abstractmodelcreation.dat', set=model.MONTHS) instance = model.create_instance(data) the error is ValueError: Parameter 'salaryExp' defined with '1' dimensions, but data has '1' values: [2000]. Are you missing a value for a 1-dimensional index?
Errors in these models can be finicky and hard to find. The error messages are often not particularly helpful either. Check the parameter for salaryExp matches in both your model and data file. Make sure salaryExp has no sets listed in its declaration. Finally, I’d be happy to take a look at your files if you use Google colab and share them with me.
All set! You were missing the () after model = AbstractModel, is should say model=AbstractModel(). Assuming your data file is correct (I had to use my own), everything will work fine once you add in those (). If it doesn't work, take a look at your data file.
@@DrKatieRIT I really appreciate your prompt solution. Yeah, it is working now. You are awesome.
Dear Dr. Katie, Your approach to lecture content, its delivery and organization is outstanding. This is greatly appreciated.
Thank you so much madam I am From India and I am keen on learning Operation Research and its application Thanks again for your valuable insight
Just what I've been looking for. This is awesome. Thanks
Can you help me to write a first constraint using pyomo. I am stucked since couple of weeks
Sure. What are you trying to do?
@@katiemcconky938 I am trying to solve the transportation kind of problem which is mixed integer quadratic problem. I have solved problem with Gurobi solver , now wanted same to pyomo as script writing is somewhat different I need help in writing the first constraint or any expression which willl help me to understand the all pyomo functionality, then later I will write my self. If you could help me would be great help for me. You can suggest your availability and you can share link to join meeting.
It appears that Jeff has a sticker of the new green variety of Jack Daniel's on his wall!
This is fantastic!
This is great! 😀
Thanks! 😄