Economic Model Predictive Control

Поділитися
Вставка
  • Опубліковано 7 бер 2018
  • Set up and solve the commercial fishing economic optimal control problem. Create a program to optimize and display the results. The commercial fishing optimal control problem has an integral objective function. The population of fish x is influenced by how many fish are removed each year that depends on u. The objective is to maximize the revenue from fishing over a 10 year time period. If there is overfishing (high u) then the returns for subsequent years are reduced and the fish population does not recover. This optimal control problem finds the optimal extraction profile to maximize the commercial fishing profit. See apmonitor.com/do/index.php/Mai... for source code in MATLAB and Python.
  • Наука та технологія

КОМЕНТАРІ • 27

  • @frederickpurifoy2261
    @frederickpurifoy2261 3 роки тому +1

    What if I want to change one of the constraints after some time period has passed? What I'm trying to do is to include demand shocks by changing the functional form of the demand equation after some time t.

    • @apm
      @apm  3 роки тому +1

      You can define an input Parameter that has a different demand at every time point or a step in value.

  • @user-oh7tz7qb9k
    @user-oh7tz7qb9k 10 місяців тому +1

    Thanks for the video.
    Why is the maximum fishing rate not sustained for longer to achieve a higher profit? There are still fish remaining after 10 years?

    • @apm
      @apm  10 місяців тому

      If they started max fishing earlier then the decreased fish population would have less reproduction and decrease the profits for the final years. Try fixing a different fishing profile and observe the objective value. For example, try max fishing the entire time horizon and the profit is lower. The interesting thing about this case study is that sustainability is also the most profitable solution.

    • @user-oh7tz7qb9k
      @user-oh7tz7qb9k 10 місяців тому

      Thank you.@@apm

  • @Aquelzor
    @Aquelzor 5 років тому +1

    Hello again APMonitor, great tutorial as always.
    I have a question though; is there any way to set variables to being strictly integers.
    For example, if I want my manipulated variable to range between [1,2,3,..,n], or even my controlled variable.
    I cant seem to find any settings within the GEKKO variable-functions. Does anyone have any suggestions?

    • @apm
      @apm  5 років тому +1

      Sure, just set the parameter to integer=True when you define the MV. Here is some additional help on using Integer variables: apmonitor.com/do/index.php/Main/DiscreteVariables You'll also need to switch to the APOPT solver with m.options.SOLVER = 1.

    • @Aquelzor
      @Aquelzor 5 років тому

      @@apm Brilliant, and thank you for such quick and informational answers!
      Some more questions for when you have time and will to answer them:
      1. The option for SOLVER = 3 worked for me as well. It says in the GEKKO docu that option 1 is for simulation, and I am actually trying to control something with an "integer" input (option 3 actually gives a higher final "score" for me). Am I missing something about the mechanics of these solvers?
      2. As I am trying to control something in discrete steps, is there any function other than dt() that ought to be used instead to describe a state transition x(k+1) = g(x(k),u(k))? Or is it just to define the "m.time"-vector accordingly?
      Really looking forward to your answers :)

    • @apm
      @apm  5 років тому

      @@Aquelzor yes, IMODE=1 is for steady-state simulation. It means that you need to have the same number of variables and equations and all of the derivative .dt() values are set to zero. If you have an integer decision variable then you'll need IMODE=3 so that you can optimize the inputs to give a better objective function value. Here is additional information on IMODE: apmonitor.com/wiki/index.php/Main/OptionApmImode
      The SOLVER parameter is different than IMODE. If the solver finds a solution, all solvers should give the same answer, unless integer variables are involved. If there are integer variables then SOLVER=1 will give a worse objective because it is enforcing integer values while the other solvers may report non-integer values. Here is additional information on the SOLVERS: apmonitor.com/wiki/index.php/Main/OptionApmSolver
      The m.time vector is used to determine where you want to calculate solutions. If you have a discrete linear time-invariant model, then you can use a discrete state space model as shown here: www.apmonitor.com/wiki/index.php/Apps/DiscreteStateSpace If you have a model with continuous derivative values then you shouldn't need the discrete state-space model. The collocation method is used to turn the continuous form into a form that can be solved at discrete time points: apmonitor.com/do/index.php/Main/OrthogonalCollocation

  • @pkl520
    @pkl520 6 років тому

    Can I ask a silly question?
    Most of ur tutorials are about linear or nonlinear optimization methodologies.
    How about heuristic algorigthm(ex: partical swarm, genetic algorithm optimization)?
    These methods are also about optimization solutions, but they seems seldom been used in ur tutorial.
    Can I ask why? Hoping u can answer my question.
    Big thanks~!

    • @apm
      @apm  6 років тому +1

      I'm teaching the Dynamic Optimization course right now (apmonitor.com/do) so most of the problems are related to the content that is taught. I also teach an optimization course where we cover some of the topics that you mentioned. Here is the chapter on Genetic Algorithms: apmonitor.com/me575/index.php/Main/GeneticAlgorithms and here is content on simulated Annealing: apmonitor.com/me575/index.php/Main/SimAnnealHW - there are lots of other examples as well. There are PDF book chapters that give a broader treatment of optimization methods. Regarding model predictive control, genetic algorithm or particle swarm methods are sometimes too slow for real-time implementation so I favor gradient based methods that are fast but also only find local solutions. Genetic algorithms or particle swarm methods are nice for situations where you have more time (such as offline) or when you know that your problem is non-convex and you need a global solution method.

    • @pkl520
      @pkl520 6 років тому +1

      Very thanks for your reply!!
      You Clearly solve my doubt.
      Big thanks again~!

  • @emmanuelameyaw9735
    @emmanuelameyaw9735 2 роки тому +1

    You can sell this solution to some company or government? Or what are you going to do with it?

    • @apm
      @apm  2 роки тому

      Most large companies and advanced governments perform these types of optimization and modeling analyses. It helps determine policy and investment. This is a very simple example and the ones used in practice are very detailed and complicated but the same principles apply.

  • @GroupAdmin-zq6cf
    @GroupAdmin-zq6cf 2 місяці тому

    How can we handle the case with two controls say u_1 and u_2, two state space and do we still define the bounds of the control in the same way?

    • @apm
      @apm  2 місяці тому

      Here is an example with MIMO control. apmonitor.com/do/index.php/Main/TCLabF and a simple example: apmonitor.com/wiki/index.php/Apps/LinearStateSpace (see Gekko example at the end).

    • @GroupAdmin-zq6cf
      @GroupAdmin-zq6cf 2 місяці тому

      @@apm ok. Thanks a lot

  • @swapnilchandra759
    @swapnilchandra759 3 роки тому +1

    In the matlab dwonload file what is defined by s and a in fishing.m

    • @apm
      @apm  3 роки тому +1

      s is the server address and a is the application name

    • @swapnilchandra759
      @swapnilchandra759 3 роки тому

      @@apm while running this code i get error in python IDLE as 'GEKKO' object has no attribute 'equation' how do i fix that sir?

    • @swapnilchandra759
      @swapnilchandra759 3 роки тому

      This Gekko error is showing up in python3.6.4 and for python 3.9.0 it is showing module matplotlib is missing and after perofrming pip install it isnt getting setup

    • @apm
      @apm  3 роки тому +1

      @@swapnilchandra759 try it with a capital E instead: m.Equation()

    • @apm
      @apm  3 роки тому +1

      @@swapnilchandra759 here is information on how to install packages such as matplotlib: apmonitor.com/pdc/index.php/Main/InstallPython