MATLAB Nonlinear Optimization with fmincon

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ต.ค. 2024

ความคิดเห็น • 150

  • @Tudo-Sobre-Tud0
    @Tudo-Sobre-Tud0 3 ปีที่แล้ว +3

    It helped me a lot. I am doing a master's degree in HSE and matlab and the resident program, I hope to learn a lot with the support of the page.
    from: Mozambique

  • @SolvingOptimizationProblems
    @SolvingOptimizationProblems 4 ปีที่แล้ว +4

    For constrained optimization problems, fmincon solver runs faster compared to genetic algorithm solver. Great tutorial on how to use fmincon solver. Thank you very much Prof.

    • @hantin4543
      @hantin4543 4 ปีที่แล้ว +1

      Agree. fmincon solver is better than genetic algorithm solver.

    • @DaoNguyen-ox8cw
      @DaoNguyen-ox8cw 4 ปีที่แล้ว +1

      Solving Optimization Problems Really? Thanks for this suggestion. I will try both solvers to see the difference.

    • @apm
      @apm  4 ปีที่แล้ว +3

      Gradient based methods are generally much faster than GAs but have the disadvantage of possible local minima and the functions need to be continuous with continuous derivatives. GAs are better for problems where a gradient based method isn't successful.

  • @wondemsegegnzewdu8208
    @wondemsegegnzewdu8208 7 ปีที่แล้ว +4

    Proffesor John D. Hedengren, Thank you very much. All your videos are very heplfu to me.

  • @thanhthanh-vh5hu
    @thanhthanh-vh5hu 2 ปีที่แล้ว +1

    I can't use your code, because it's false. It only advent hear:
    "objective
    objective =
    @(x)x(1)*x(4)*(x(1)+x(2)+x(3))+x(3)"

    • @apm
      @apm  2 ปีที่แล้ว

      Try using the code at apmonitor.com/che263/index.php/Main/MatlabOptimization

  • @hakanberkcanpolat4408
    @hakanberkcanpolat4408 ปีที่แล้ว +1

    Thank you for your explaining video. I just want to ask just one question. I have a 4-plies Abaqus model and the objective is to find the minimum deformation for changing plies. How can I assign the objective function and c variables?

    • @apm
      @apm  ปีที่แล้ว +2

      If you're trying to optimize the layup sequence of the plies to minimize deformation in an ABAQUS model using MATLAB, here's a general outline of the steps you need to take:
      Setup ABAQUS Scripting Interface with MATLAB: Before running optimizations, ensure that you can call ABAQUS from MATLAB. This will often involve using the `system` command in MATLAB. For example:
      cmdStr = 'abaqus job=myModel.inp';
      system(cmdStr);
      Objective Function: Write an objective function in MATLAB that runs your ABAQUS model for a given layup sequence, extracts the deformation result, and then returns this value.
      function deformation = objectiveFunction(layup)
      % Write layup to ABAQUS input file
      writeLayupToInput(layup);
      % Run ABAQUS simulation
      cmdStr = 'abaqus job=myModel.inp';
      system(cmdStr);
      % Extract deformation result
      deformation = extractDeformationFromODB();
      % Possibly other post-processing steps...
      end

  • @SohilShah_Melodyman
    @SohilShah_Melodyman 6 ปีที่แล้ว +6

    Great video! Very well explained....thanks a lot for the efforts!

  • @lutherbrown8873
    @lutherbrown8873 3 ปีที่แล้ว +2

    Thank you. This was really helpful. I see why people use MATLAB over Python now; it's easier AND the functions are more powerful.

  • @akshaybhapkar1626
    @akshaybhapkar1626 4 ปีที่แล้ว +3

    Helped me in understanding something I'm working on...You sound like Jim Halpert from 'The Office'...Haha

    • @apm
      @apm  4 ปีที่แล้ว

      Thanks! That's a first! I've had a few say that I sound like Matthew McConaughey. I'll take either one as a complement.

  • @deepocean8750
    @deepocean8750 2 ปีที่แล้ว +1

    So I Have a hydrolic model that I made and I struggle to do the optimization to 4 parametres in order to have the least loss, and nothing. I saw many tutorials but all of them are for simple functions and I can not find in my case what to do.

    • @apm
      @apm  2 ปีที่แล้ว

      Try Python gekko such a problem 9 apmonitor.com/wiki/index.php/Main/GekkoPythonOptimization

  • @ojadukwu7516
    @ojadukwu7516 3 ปีที่แล้ว +1

    Many thanks for the video. How do I modify it to solve linear optimisation without changing the structure of the optimisation problem. I have used it to solve nonlinear system, I have linearized the nonlinear system and I still want to use the fmincon to solve the problem, How do I modify my optimisation? Many thanks.

    • @apm
      @apm  3 ปีที่แล้ว

      Linear programming solvers can be much more efficient. You can still use fmincon, just include the linear equations as shown here. Here are some specialized methods for linear programming too: apmonitor.com/pdc/index.php/Main/LinearProgramming

  • @anjaliguli5419
    @anjaliguli5419 2 ปีที่แล้ว +3

    This is amazing! I was struggling to find the right tutorial. Thank you.

  • @akshithmh7123
    @akshithmh7123 3 ปีที่แล้ว +1

    I have a question. I have a set of differential equations. I have an objective function which is a combination of these differential equations. I should minimize the objective function (along with ode solution) with the help of parameters of differential equations where the parameters are subjected to certain bounds. I have no experimental data as well. Can you please help me to solve this. Thank you in advance!

    • @apm
      @apm  3 ปีที่แล้ว +1

      Here is something that may help: apmonitor.com/do/index.php/Main/DynamicEstimation

    • @akshithmh7123
      @akshithmh7123 3 ปีที่แล้ว

      @@apm Thank you!

  • @rohitbabu3362
    @rohitbabu3362 6 ปีที่แล้ว +2

    Thank you very much. This is the great help for the beginners like me...

  • @DHIRAJGHOSH-e2u
    @DHIRAJGHOSH-e2u ปีที่แล้ว +1

    Why do you ignore the warning?
    Is it right the way you define the lower and upper bounds?

    • @apm
      @apm  ปีที่แล้ว

      Here is the instruction page: apmonitor.com/che263/index.php/Main/MatlabOptimization with the source code: apmonitor.com/che263/index.php/Main/MatlabOptimization?action=sourceblock&num=2

  • @yaniskaili9682
    @yaniskaili9682 2 ปีที่แล้ว +1

    Dear Professor,
    If the constraintes are a system of differential equations :
    dx/dt = Ax(t) + bu(t)
    Where:
    A is a n*n matrix
    b is a n-vector
    u(t) is a command (control)
    How we can do it ?
    Thank you

    • @apm
      @apm  2 ปีที่แล้ว

      Here is more information on state space models: apmonitor.com/pdc/index.php/Main/StateSpaceModel and control development with state space: apmonitor.com/do

  • @kaushikchand3668
    @kaushikchand3668 2 ปีที่แล้ว +1

    Hi there, firstly thank you so much for this tut. so I had a simple question. say suppose my objective function contains x(1),x(2) and x(3). how do I limit the bounds of my x(3) between 1 to 20 . thanks

    • @apm
      @apm  2 ปีที่แล้ว

      See the lb and ub as lower bound and upper bound for each variable: apmonitor.com/che263/index.php/Main/MatlabOptimization

    • @vinesnation7202
      @vinesnation7202 2 ปีที่แล้ว

      @@apm thanks for your reply. I had just got it while playing around with the values from another tutorial.

  • @venkatsarma007
    @venkatsarma007 6 ปีที่แล้ว +7

    Sir, Thank you so much. You helped me for the take home part of my exam which is due submission tomorrow. I want to learn more about Matlab, from you(FREE, if possible). Would you be interested in helping me?

    • @apm
      @apm  6 ปีที่แล้ว +2

      sure, there is course content available at apmonitor.com/che263

  • @MasetGaming
    @MasetGaming ปีที่แล้ว +1

    This video explains it better than my tutor... amazing! Thank your for your work

  • @anastasiakyriakou6922
    @anastasiakyriakou6922 3 ปีที่แล้ว +1

    great video!! I have a question. I have to do portfolio optimization by minimizing the mean absolute deviation. I have calculated the rate of returns by using real data. how can I continue?

    • @apm
      @apm  3 ปีที่แล้ว

      Try Python Gekko for portfolio optimization: th-cam.com/video/bXAkr7MPf4w/w-d-xo.html

  • @faraznassar9823
    @faraznassar9823 3 ปีที่แล้ว +1

    Can you please optimize the water filling algorithm using fmincon?

    • @apm
      @apm  3 ปีที่แล้ว

      Here is something that may help: apmonitor.com/pdc/index.php/Main/LevelControl

  • @李星-盲僧
    @李星-盲僧 4 ปีที่แล้ว +1

    this video is very helpful, thanks so much

  • @immortalmuffinz
    @immortalmuffinz 5 ปีที่แล้ว +1

    Thank you for the tutorial. This actually helped me gain some traction on a linearization problem I have been working on. Super quick questions if I may:
    1) Using fmincon, how do you approach the syntax if you have state variables that each have their own bounded and equality constraints? Meaning, in this example, instead of having states x1 -> x5 bounded by 1 and 5, how can you implement constraints on each states
    (i.e. a < x1

    • @apm
      @apm  5 ปีที่แล้ว

      Use the lb and ub (lower and upper bounds) as input arguments to fmincon.

    • @SolvingOptimizationProblems
      @SolvingOptimizationProblems 5 ปีที่แล้ว +5

      Set your bounds like this: lower bound = [ 1 2 1 0] and upper bound = [5 7 9 3] ; So, x1 = (1 to 5), x2 = (2 to 7), x3 = (1 to 9), and x4 = (0 to 3)

  • @danielgemayel7604
    @danielgemayel7604 2 ปีที่แล้ว +1

    how can i make the opt solution to give me x1 and x2 as multiples of 10 ?

    • @apm
      @apm  2 ปีที่แล้ว

      fmincon can't solve mixed integer problems. Use APM Matlab or Gekko for MINLP options.

  • @thegoosy69
    @thegoosy69 5 ปีที่แล้ว +1

    Thank you very much for your tutorials. I have one question. Is there a problem if flag=-2?

    • @apm
      @apm  5 ปีที่แล้ว

      Yes, there is a problem. The solver is reporting that no feasible point was found.

  • @hamzabaali9274
    @hamzabaali9274 3 ปีที่แล้ว +1

    Thank you for your effort, very useful and well-explained material. Just a small observation: The definition of the lower and upper bounds might be better defined as :
    lb = 1.0 * ones(4,1);
    ub = 5.0 * ones(4,1);

    • @apm
      @apm  3 ปีที่แล้ว +1

      Thanks for the suggestion!

  • @marcmontanaperramon9740
    @marcmontanaperramon9740 4 ปีที่แล้ว +1

    This is a great video, but I'm getting an error that I don't understand. When I finish writing both files and I run them, it works perfectly. But as soon as I pressed save, and then I run it again, I'm getting this error:
    Not enough input arguments.
    Error in nlcon (line 2)
    c = 25-x(1)*x(2)*x(3)*x(4);
    I would be so thankful sir if you could help me with this!

    • @apm
      @apm  4 ปีที่แล้ว

      Try 'clear all' at the top of your script.

  • @aligokalptopsakal4279
    @aligokalptopsakal4279 4 ปีที่แล้ว +1

    Thank you for your effort. I have a few questions for you.
    1) I realized that you didn't use set for X variables. You wrote all X variables. However, the problem I need to solve is large-scale. It's impossible for me to define all variables one by one. What should I do?
    2) How are fmincon, APM MATLAB toolbox and Python compares to programs such as GAMS, AMPL in solving optimization problems. Which one do you suggest for large-scale nonlinear optimization problems?

    • @apm
      @apm  4 ปีที่แล้ว +1

      Check out Python Gekko for large scale problems. You can also use Gekko in MATLAB. Almost all modeling platforms are similar. It is the solver that makes most of the difference.

  • @panaluu
    @panaluu 7 ปีที่แล้ว

    Where do I find info finding x(0)? Maybe a dumb question but I don't see where you got that?

    • @apm
      @apm  7 ปีที่แล้ว +1

      +panaluu, x0 is the initial guess. Sometimes the problem statement specifies the initial guess (like this time) or you just need to insert an educated guess.

  • @qus.9617
    @qus.9617 6 ปีที่แล้ว

    Thanks for the video. I have a quick question, if you don't mind.
    For the ceq does the matlab fmincon assume that it is equal to 0?
    For your c you had

    • @apm
      @apm  6 ปีที่แล้ว +4

      Yes, you can have multiple inequality constraints and no equality constraints. If you have no equality constraints then you return ceq = []. If you have multiple inequality constraints then you return c = [c1,c2] where c1 and c2 are your inequality constraints.

    • @qus.9617
      @qus.9617 6 ปีที่แล้ว

      okay, thank-you for your speedy reply, and for your helpful video.
      Just to confirm, if I had followed your video example, the only difference being:
      1) no equality constraint
      2) lower bound is negative number
      The final objective should be correct?

    • @qus.9617
      @qus.9617 6 ปีที่แล้ว

      Or I have to go back and defined c as [c1,c2] in the function that is allowed and then configure ceq as [] (or zero?) if allowed syntax.

    • @apm
      @apm  6 ปีที่แล้ว

      Yes, that is correct.

    • @anamfatima5491
      @anamfatima5491 4 ปีที่แล้ว +1

      @@apm Sir i am a student i am working on matlab on both linear and non linear programing .i watch a lot of your videos that are very helpful.
      Can you have a solved exampel of any heuristic and meta _ heuristic in matlab .or in any of your sylabeus that you teach if done so kindly provide the link . Thanks

  • @mah533
    @mah533 6 ปีที่แล้ว

    Thanks for your video.
    How do you set up your nonlinear constraints if they are in the form of sets of diferential equations, as in state space format?
    I know it's easy using APM, just curious to see how it's done in MATLAB.
    I believe that would render the problem from a pure optimization problem into an optimal control problem, am I correct?
    Thanks

    • @apm
      @apm  6 ปีที่แล้ว

      +Edmond A, you can add the differential equation solution in the objective function subroutine with a shooting (sequential) method. Another method that is more difficult to configure but often much faster. It is a simultaneous method by orthogonal collocation on finite elements. The differential equation is discretized into a set of algebraic constraints and added to the optimization problem. APMonitor uses both approaches as well as a hybrid technique. More info on orthogonal collocation in MATLAB is here: apmonitor.com/do/index.php/Main/OrthogonalCollocation

  • @slippinchillin
    @slippinchillin 4 ปีที่แล้ว +1

    Thank you sir! This tutorial helped a lot!

    • @beoptimistic5853
      @beoptimistic5853 3 ปีที่แล้ว

      th-cam.com/video/XPCgGT9BlrQ/w-d-xo.html 👍💐

  • @MatheusMoreira-ge6ng
    @MatheusMoreira-ge6ng 6 ปีที่แล้ว

    Congratulations for the video!
    May you help me?
    I have the following problem: I need to implement some nonlinear constraints, but they are another functions, with the same enter variables. How can I write the code in this case?

    • @apm
      @apm  6 ปีที่แล้ว

      The fmincon solver works with any number or form of nonlinear constraints. You can try another platform (APMonitor Matlab interface). If fmincon doesn't work.

  • @vijaykumars5041
    @vijaykumars5041 6 ปีที่แล้ว +1

    Thank a lot. It really helped me to solve my problem

  • @thetea-rexchannel8212
    @thetea-rexchannel8212 4 ปีที่แล้ว +1

    Its a great video! Thank you so much. Can I use the fmincon to solve a nonlinear MPC problem. If so, can you guide me a bit

    • @apm
      @apm  4 ปีที่แล้ว

      Here is some code for nonlinear MPC in MATLAB: apmonitor.com/do/index.php/Main/NonlinearControl Using fmincon would be much less efficient because you would need to use a shooting (sequential) method.

  • @zeyadalabsy7332
    @zeyadalabsy7332 6 ปีที่แล้ว

    Hello, Many thanks for that excellent presentation, But I have a question: What's about if I want to optimize two equations or three simultaneously, For example what I am working on it nowadays, I'd like to optimize J = (xy - zt)^2 with respect to the for variables x, y , z and ... which means optimizing the difference between their products, but at the same time, I would like to optimize the J1 = xy and J2 = zt. It means to optimize the difference of optimized multiplications. Is that possible ? which algorithm is usually used for that? Thank you so much in advance.

    • @apm
      @apm  6 ปีที่แล้ว

      Multiple equations aren't a problem but you typically need to have just one objective function. If you have multiple objectives that don't have a mathematical trade-off then you need to form a Pareto front. The Pareto front will help you decide what optimal combination of objectives is acceptable. See chapter 5: apmonitor.com/me575/index.php/Main/BookChapters

  • @shimabagherzade5302
    @shimabagherzade5302 4 ปีที่แล้ว +1

    Thanks. It was very helpful.

  • @echsankurniawan5161
    @echsankurniawan5161 3 ปีที่แล้ว +1

    Thank you for yor tutorial video, I got an error message, that fmincon is undefined at line 12 and I don't know the solution. is there anyone who can help me?

    • @apm
      @apm  3 ปีที่แล้ว

      You may not have the optimization toolbox. Here are alternatives: apmonitor.com/che263/index.php/Main/MatlabOptimization

  • @vasilikizarkadoula1027
    @vasilikizarkadoula1027 3 ปีที่แล้ว +1

    Shouldn't lb and ub be vectors and not arrays?

    • @apm
      @apm  3 ปีที่แล้ว

      A 1D array is also called a vector. Thanks for that clarification.

  • @ChristosPar
    @ChristosPar 4 ปีที่แล้ว +1

    What if I want the 40 in nolcon to be a variable and call fmincon many times?
    Thanks for the video btw. Very helpfull!

    • @apm
      @apm  4 ปีที่แล้ว +1

      Yes, you can make any of the constants into a variable. You'll just need to include it as a variable in the optimization problem, similar to x1-x4.

  • @kamaroolrushdan3242
    @kamaroolrushdan3242 6 ปีที่แล้ว

    Thanks a lot prof. I have a question regarding to my assignment( Genetic Algorithm Optimization by using Matlab). My equation is (A +U)n = A + n*A^n-1*U + (𝑛(𝑛−1)/2!)*A^n-2*U^2 + (𝑛(𝑛−1)(𝑛−2) /3!)*A^n-3*U^3… + U*n =1
    Where,
    A = availability of one-unit element in a certain time
    U = unavailability of one-unit element in a certain time
    The availability of a system can be expressed in equation:
    (A + U) n =1
    if I wanna do for 2-out-6 system, means 2 sub-system is available to run the whole system if another 4 sub-system failed.
    i will got As = 1 - (6AU5 + U6).
    So how can I put this equation for finding fitness function and iteration in Matlab?
    Thanks a lot if you could help me out of this question.

    • @apm
      @apm  6 ปีที่แล้ว

      This video is about a gradient based optimization approach. I recommend that you take a look at the optimization course and the book material in chapter 6. apmonitor.com/me575/index.php/Main/BookChapters

  • @GAment_11
    @GAment_11 4 ปีที่แล้ว +1

    Brilliant. Subscribed.

    • @apm
      @apm  4 ปีที่แล้ว

      Thanks Geoff!

  • @cristhianpettico3692
    @cristhianpettico3692 4 ปีที่แล้ว +1

    why did you use "@(x)" in the objetive ?

    • @apm
      @apm  4 ปีที่แล้ว +1

      It is an anonymous function in Matlab. Check out the course apmonitor.github.io/begin_matlab in the functions module.

  • @ruhinabegum3736
    @ruhinabegum3736 6 ปีที่แล้ว

    sir, i have linear equation A=a0+a1*B+a2*C+a3*D+a4*E , the coeficients values i know and i have (B,C,D,E) 5 values for each variable, i want to put A is constant then i want to find the optimum values of B,C,D,E how i can do please answer me

    • @apm
      @apm  6 ปีที่แล้ว

      I recommend that you use the polyfit function. apmonitor.com/che263/index.php/Main/MatlabDataRegression

    • @ruhinabegum3736
      @ruhinabegum3736 6 ปีที่แล้ว

      sir , i ask about optimization with 5 variables, please can help me

  • @Au6oJluT
    @Au6oJluT 7 ปีที่แล้ว

    Thank you for your tutorials! I tried to find right article or video, but failed. Well, i need to fined a minimum of function with 40+ variables (it's functional for nonlinear MPC). The function is nonlinear and has a lot of local minima. Could you advice me something please? I already tried a fmincon, ga in matlab. It gives some results but not what i expect.
    p.s. I apologize for the mistakes, English is not my native language

    • @apm
      @apm  7 ปีที่แล้ว

      +Au6oJluT, here are some files for Nonlinear MPC: apmonitor.com/do/index.php/Main/NonlinearControl. If your problem has multiple local minima, you may need to try a multi-start method. One way to have an intelligent multi-start method is to use simulated annealing or a genetic algorithm. More information on simulated annealing is here: apmonitor.com/me575/index.php/Main/SimAnnealHW

  • @kaiser434
    @kaiser434 4 ปีที่แล้ว +1

    Hi , How to write constraints like
    x1 != 0
    0

    • @apm
      @apm  4 ปีที่แล้ว

      There is no way to write the "not equal to" constraint with this solver. You could use Python Gekko and use the Mixed Integer capabilities to write that constraint.

  • @ASok-eo4zm
    @ASok-eo4zm 6 ปีที่แล้ว

    Thanks for the video. I do have a question I wanted to ask.
    Since the objective function in the video above is not convex(i think), and the Ceq is also not convex (not affine), it means the solution it gave is local minimum.
    Suppose the inputs are all convex instead, does this guarantee the solution will be global minimum?

    • @apm
      @apm  6 ปีที่แล้ว

      That is correct. For this specific example, you can get a different solution based on the initial variable guess. For convex problems, the optimal local solution is also the global solution as long as the solver verifies that the KKT conditions are satisfied (reports successful solution): apmonitor.com/me575/index.php/Main/KuhnTucker

    • @ASok-eo4zm
      @ASok-eo4zm 6 ปีที่แล้ว

      @@apm a small follow up question.
      Does the constraints variable have to be convex in order for the solution to be global minimum?
      For example if I have f(x,y,z) with constraints X²+y²+z²=r² (surface of a sphere), and f is convex, will I get a global solution if I use fmincon?

  • @srg25008
    @srg25008 5 ปีที่แล้ว +1

    why do add the dott at 4.39?

    • @apm
      @apm  5 ปีที่แล้ว

      It is an element-wise operator to do the square of each element in the array. Here is additional help on matrix and element-wise operators: www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html

  • @GangiGangan
    @GangiGangan 4 ปีที่แล้ว +1

    Thank you for sharing! :)

  • @maroofmaroof3799
    @maroofmaroof3799 5 ปีที่แล้ว

    Thank you soooo much for this helpful video.I want to know how to add linear equality constraint with in the same function? i tried to make another function of equality constraint but its not working.if you can kindly help

    • @apm
      @apm  5 ปีที่แล้ว

      You just need to load values into the A and b terms (inequalities) or else the Aeq and beq terms (equalities) such as shown here:
      x0 = [0.5,0];
      A = [1,2];
      b = 1;
      Aeq = [2,1];
      beq = 1;
      x = fmincon(fun,x0,A,b,Aeq,beq)
      www.mathworks.com/help/optim/ug/fmincon.html

  • @edenhuang6659
    @edenhuang6659 6 ปีที่แล้ว

    Hi, how can I read values for constants or parameters from Matlab, I want to use APM as an NLP solver in Matlab script, so I need pass parameter from Matlab to APM?

    • @apm
      @apm  6 ปีที่แล้ว

      I'd recommend the function apm_meas(server,app,name,value). This inserts a measurement into the model for an FV or MV with feedback status on (FSTATUS=1).

    • @edenhuang6659
      @edenhuang6659 6 ปีที่แล้ว

      Hi, do you have example that directely call ipopt in matlab without linking APM?

    • @apm
      @apm  6 ปีที่แล้ว

      Sorry, I don't have any material on linking IPOPT to MATLAB directly. MATLAB would need to provide at least the first derivatives and possibly the 2nd derivatives as well. A modeling language such as Pyomo, APMonitor, GAMS, AMPL, or others are generally used to simplify the process of providing derivatives and other information that the solvers need.

  • @othmanaljbory3649
    @othmanaljbory3649 ปีที่แล้ว +1

    I need bi-level programming please

    • @apm
      @apm  ปีที่แล้ว

      See Bard, Practical Bilevel Optimization: Algorithms And Applications, Springer, 1998.

  • @diogooliveira2708
    @diogooliveira2708 7 ปีที่แล้ว

    Thank you for your tutorials/videos. I need to find a minimum of function with 250 variables for mass balance. Could you advice me something please?

    • @apm
      @apm  7 ปีที่แล้ว +1

      +Diogo Oliveira, the source code for this tutorial and another are at: apmonitor.com/che263/index.php/Main/MatlabOptimization. I'd recommend the APM Matlab toolbox for large optimization problems such as 10,000+ variables.

  • @YUVRAJSINGH-jo3wy
    @YUVRAJSINGH-jo3wy 4 ปีที่แล้ว +1

    thank you so much for this such an informative video. I what to learn how to numerically minimize free energy functional provided by Chan-Hilliard. I want to learn it since this is very much required for my Ph.D. work and I am ready to pay the cost. If you could help me I am very thankful to you.

    • @apm
      @apm  4 ปีที่แล้ว

      Sorry, I can't help with specific projects. Here is some information that may help: cmsr.rutgers.edu/images/people/lebowitz_joel/publications/carlen_carvalho_esposito_marra_518latestversion.pdf and apmonitor.com/wiki/index.php/Apps/GibbsFreeEnergy I also maintain the Gekko Optimization Suite that may help with your project: apmonitor.com/wiki/index.php/Main/GekkoPythonOptimization If you prefer to use Matlab, here is an interface: apmonitor.com/che263/index.php/Main/MatlabCallsPython

  • @s.vinothjohnprakash5957
    @s.vinothjohnprakash5957 3 ปีที่แล้ว +1

    I need to minimize x2,x4,x6 using GA toolbox matlab
    For the function
    f(x)=(x1*x2)+(x3*x4)+(x5*x6)
    Subject to constraints
    0≤x2≤100
    0≤x4≤ 20
    0≤x6≤ 10

  • @ismailmujde
    @ismailmujde 3 ปีที่แล้ว +1

    Thank you for nice video. Something very small: ones(4) and zeros(4) create 4x4 matrices. For 4-element vectors, ones(4,1) and zeros(4,1) must be used.

    • @apm
      @apm  3 ปีที่แล้ว

      Thanks for the tip.

  • @ziadabdelsamad9842
    @ziadabdelsamad9842 3 ปีที่แล้ว

    King 👑 👑 👑

  • @dr.alikhudhair9414
    @dr.alikhudhair9414 2 ปีที่แล้ว +1

    Wonderful

  • @nivedithaponnapureddy443
    @nivedithaponnapureddy443 6 ปีที่แล้ว

    i need matlab coding with sub programs for crossover,mutation and selection
    so plzzz help with these 3

    • @apm
      @apm  6 ปีที่แล้ว

      I don't have any specific code for a GA but there is information on how to program it here: apmonitor.com/me575/index.php/Main/GeneticAlgorithms

  • @game_hard
    @game_hard 6 ปีที่แล้ว

    how to put multiple nonlinear constraints ?

    • @apm
      @apm  6 ปีที่แล้ว

      You need to return the constraints as a vector from that function to include multiple nonlinear constraints. Also check out APM Matlab for another option if your problem is large-scale or difficult to solve. apmonitor.com/wiki/index.php/Main/MATLAB

  • @aimalrehman2961
    @aimalrehman2961 6 ปีที่แล้ว +1

    Thank you very much

  • @shashankshekarmupparam6433
    @shashankshekarmupparam6433 7 ปีที่แล้ว

    thanku for ur help i have strucked to relate this with relay coordination in power system coordination can u help me sir

    • @rrc
      @rrc 7 ปีที่แล้ว

      shashank shekar mupparam, this may be a scheduling optimization problem with mixed integer elements. fmincon won't be able to handle discrete systems. You may want to look at an MINLP or MILP solver such as APOPT.

    • @shashankshekarmupparam6433
      @shashankshekarmupparam6433 7 ปีที่แล้ว

      Yeah I want to look for it my function is hyperbolic of order 2 so non linear function minimization I need kindly suggest me with some lectures

    • @apm
      @apm  7 ปีที่แล้ว

      I have a nonlinear optimization programming course that is available at apmonitor.com/me575 Please see the PDF textbook and the many lecture videos that are available.

  • @jtshek8217
    @jtshek8217 5 ปีที่แล้ว +1

    Thank you.

  • @doc_microscope
    @doc_microscope 6 ปีที่แล้ว

    Good evening, i have to obtain the power Pp0, Pp1, Pp2 and Pp3 for a gain optimization. The equations are the following:
    G1=exp(-alpha_s1*L+a1*Pp0+b1*Pp1+c1*Pp2+d1*Pp3);
    G2=exp(-alpha_s2*L+a2*Pp0+b2*Pp1+c2*Pp2+d2*Pp3);
    G3=exp(-alpha_s3*L+a3*Pp0+b3*Pp1+c3*Pp2+d3*Pp3);
    G1=exp(-alpha_s4*L+a4*Pp0+b4*Pp1+c4*Pp2+d4*Pp3);
    a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4,d1,d2,d3,d4,L and alpha_s1, alpha_s2,alpha_s3,alpha_s4 are constants.
    How can i implement it?

    • @apm
      @apm  6 ปีที่แล้ว

      It sounds like you need to solve a nonlinear regression problem. Do you have data for G1 through G4? Here is a tutorial for a similar problem in Python: apmonitor.com/me575/index.php/Main/NonlinearRegression

    • @doc_microscope
      @doc_microscope 6 ปีที่แล้ว

      G1=G2=G3=G4=G_target, i can choose an arbitrary value. How becomes this in Matlab?

    • @doc_microscope
      @doc_microscope 6 ปีที่แล้ว

      I don't understand the Python, could you help me with matlab?

  • @romainpryckodko9031
    @romainpryckodko9031 6 ปีที่แล้ว +1

    Thank you :)

  • @ayoubmadrid6976
    @ayoubmadrid6976 7 ปีที่แล้ว

    thank you for these vidoes,and i'need airship model in simulink matlab can you make video for help

    • @apm
      @apm  7 ปีที่แล้ว

      +ayoub madrid, sorry I don't have an airship model.

    • @apm
      @apm  7 ปีที่แล้ว +1

      +ayoub madrid, you may want to look on Mathworks File Exchange site.

    • @ayoubmadrid6976
      @ayoubmadrid6976 7 ปีที่แล้ว

      thanks

  • @atanusarkar4680
    @atanusarkar4680 2 ปีที่แล้ว

    Sir please solve this non linear optimization problem by PSO algorithm : Max.Z = 10 x1 + 4 x2 - 2 x1^2 - 3 x2^2
    subject to 2 x1 + x2 0

    • @apm
      @apm  2 ปีที่แล้ว

      Sorry, I can't help with the many requests for individual support, especially those that may be related to homework.

  • @nathanmezacasa5654
    @nathanmezacasa5654 7 ปีที่แล้ว

    I have a problem with a system developed in Simulink. Is a militar tank with six road whels, 8 DOF. I want to optimize with Fmincon the bounce, but I don't understand how to interconnect Simulink with fmincon. Can you help me? Do you have any material on this?
    Thank you.

    • @apm
      @apm  7 ปีที่แล้ว

      It sounds like your vehicle model is in Simulink. Here is some information on converting your model to MATLAB (solve with ode15s or ode23). apmonitor.com/che263/index.php/Main/MatlabDynamicSim Once it is converted to a MATLAB form, it can be optimized with fmincon. You may also want to look at the APMonitor MATLAB toolbox, specifically designed to optimize systems of differential and algebraic equations.

  • @knighttime19
    @knighttime19 6 ปีที่แล้ว +1

    Thanks

  • @henryotto9132
    @henryotto9132 3 ปีที่แล้ว +1

    nice

  • @deepocean8750
    @deepocean8750 2 ปีที่แล้ว +1

    I STILL STRUGGLE XD

  • @ruthsindie2660
    @ruthsindie2660 5 ปีที่แล้ว

    just after watching a vedio with more detailed explanations.. didn't find this helpful

    • @rrc
      @rrc 5 ปีที่แล้ว

      This is a beginner guide with a very basic example. There are better videos for those who need some of the more advanced features of the solver. For more capable solvers see apmonitor.com/wiki/index.php/Main/GekkoPythonOptimization

  • @NgọcKhôiĐặng-b7l
    @NgọcKhôiĐặng-b7l ปีที่แล้ว

    3:29

  • @عبداللهعدنانالبياتي
    @عبداللهعدنانالبياتي 4 ปีที่แล้ว +1

    I have your email

    • @apm
      @apm  4 ปีที่แล้ว +2

      Please ask your questions here, on public forums such as Stack Overflow, or on Mathworks support site. Unfortunately I can't answer all of the questions that are given to me each week by users who need specific help with their application. I also have additional tutorials at the course website apmonitor.com/che263