Тёмный
No video :(

MATLAB Nonlinear Optimization with fmincon 

APMonitor.com
Подписаться 76 тыс.
Просмотров 239 тыс.
50% 1

This step-by-step tutorial demonstrates fmincon solver on a nonlinear optimization problem with one equality and one inequality constraint. Visit apmonitor.com/che263/index.php... for source code.

Опубликовано:

 

4 апр 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 150   
@wondemsegegnzewdu8208
@wondemsegegnzewdu8208 7 лет назад
Proffesor John D. Hedengren, Thank you very much. All your videos are very heplfu to me.
@Tudo-Sobre-Tud0
@Tudo-Sobre-Tud0 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
@SohilShah_Melodyman
@SohilShah_Melodyman 6 лет назад
Great video! Very well explained....thanks a lot for the efforts!
@rohitbabu3362
@rohitbabu3362 6 лет назад
Thank you very much. This is the great help for the beginners like me...
@anjaliguli5419
@anjaliguli5419 2 года назад
This is amazing! I was struggling to find the right tutorial. Thank you.
@vijaykumars5041
@vijaykumars5041 6 лет назад
Thank a lot. It really helped me to solve my problem
@shimabagherzade5302
@shimabagherzade5302 4 года назад
Thanks. It was very helpful.
@李星-盲僧
@李星-盲僧 4 года назад
this video is very helpful, thanks so much
@SolvingOptimizationProblems
@SolvingOptimizationProblems 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 года назад
Agree. fmincon solver is better than genetic algorithm solver.
@DaoNguyen-ox8cw
@DaoNguyen-ox8cw 4 года назад
Solving Optimization Problems Really? Thanks for this suggestion. I will try both solvers to see the difference.
@apm
@apm 4 года назад
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.
@jameskoh3463
@jameskoh3463 4 года назад
Thank you sir! This tutorial helped a lot!
@beoptimistic5853
@beoptimistic5853 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XPCgGT9BlrQ.html 👍💐
@GangiGangan
@GangiGangan 4 года назад
Thank you for sharing! :)
@lutherbrown8873
@lutherbrown8873 3 года назад
Thank you. This was really helpful. I see why people use MATLAB over Python now; it's easier AND the functions are more powerful.
@harrykenneth7807
@harrykenneth7807 3 года назад
Instablaster.
@aimalrehman2961
@aimalrehman2961 6 лет назад
Thank you very much
@akshaybhapkar1626
@akshaybhapkar1626 4 года назад
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.
@MasetGaming
@MasetGaming Год назад
This video explains it better than my tutor... amazing! Thank your for your work
@jtshek8217
@jtshek8217 5 лет назад
Thank you.
@romainpryckodko9031
@romainpryckodko9031 6 лет назад
Thank you :)
@venkatsarma007
@venkatsarma007 6 лет назад
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 лет назад
sure, there is course content available at apmonitor.com/che263
@dr.alikhudhair9414
@dr.alikhudhair9414 Год назад
Wonderful
@hamzabaali9274
@hamzabaali9274 3 года назад
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 года назад
Thanks for the suggestion!
@GAment_11
@GAment_11 3 года назад
Brilliant. Subscribed.
@apm
@apm 3 года назад
Thanks Geoff!
@immortalmuffinz
@immortalmuffinz 4 года назад
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 4 года назад
Use the lb and ub (lower and upper bounds) as input arguments to fmincon.
@SolvingOptimizationProblems
@SolvingOptimizationProblems 4 года назад
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)
@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
@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 лет назад
+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.
@thetea-rexchannel8212
@thetea-rexchannel8212 4 года назад
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.
@hakanberkcanpolat4408
@hakanberkcanpolat4408 9 месяцев назад
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 9 месяцев назад
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
@knighttime19
@knighttime19 5 лет назад
Thanks
@thegoosy69
@thegoosy69 4 года назад
Thank you very much for your tutorials. I have one question. Is there a problem if flag=-2?
@apm
@apm 4 года назад
Yes, there is a problem. The solver is reporting that no feasible point was found.
@ojadukwu7516
@ojadukwu7516 2 года назад
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 2 года назад
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
@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.
@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
@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
@kaushikchand3668
@kaushikchand3668 2 года назад
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.
@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
@anastasiakyriakou6922
@anastasiakyriakou6922 3 года назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-bXAkr7MPf4w.html
@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 лет назад
+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.
@ziadabdelsamad9842
@ziadabdelsamad9842 2 года назад
King 👑 👑 👑
@deepocean8750
@deepocean8750 2 года назад
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
@s.vinothjohnprakash5957
@s.vinothjohnprakash5957 3 года назад
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
@ChristosPar
@ChristosPar 4 года назад
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 года назад
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.
@akshithmh7123
@akshithmh7123 3 года назад
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 года назад
Here is something that may help: apmonitor.com/do/index.php/Main/DynamicEstimation
@akshithmh7123
@akshithmh7123 3 года назад
@@apm Thank you!
@aligokalptopsakal4279
@aligokalptopsakal4279 4 года назад
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 года назад
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.
@kamaroolrushdan3242
@kamaroolrushdan3242 5 лет назад
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 5 лет назад
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
@ismailmujde
@ismailmujde 3 года назад
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.
@qus.9617
@qus.9617 5 лет назад
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 5 лет назад
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 5 лет назад
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 5 лет назад
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 5 лет назад
Yes, that is correct.
@anamfatima5491
@anamfatima5491 4 года назад
@@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
@henryotto9132
@henryotto9132 3 года назад
nice
@user-cm9yw1dh2n
@user-cm9yw1dh2n Год назад
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 года назад
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
@ASok-eo4zm
@ASok-eo4zm 5 лет назад
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 5 лет назад
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 5 лет назад
@@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?
@marcmontanaperramon9740
@marcmontanaperramon9740 4 года назад
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.
@YUVRAJSINGH-jo3wy
@YUVRAJSINGH-jo3wy 4 года назад
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
@faraznassar9823
@faraznassar9823 3 года назад
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
@echsankurniawan5161
@echsankurniawan5161 3 года назад
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
@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.
@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
@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 лет назад
+ayoub madrid, you may want to look on Mathworks File Exchange site.
@ayoubmadrid6976
@ayoubmadrid6976 7 лет назад
thanks
@danielgemayel7604
@danielgemayel7604 2 года назад
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.
@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.
@cristhianpettico3692
@cristhianpettico3692 4 года назад
why did you use "@(x)" in the objetive ?
@apm
@apm 4 года назад
It is an anonymous function in Matlab. Check out the course apmonitor.github.io/begin_matlab in the functions module.
@kaiser434
@kaiser434 4 года назад
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.
@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
@vasilikizarkadoula1027
@vasilikizarkadoula1027 3 года назад
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.
@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.
@srg25008
@srg25008 4 года назад
why do add the dott at 4.39?
@apm
@apm 4 года назад
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
@thanhthanh-vh5hu
@thanhthanh-vh5hu 2 года назад
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
@game_hard
@game_hard 5 лет назад
how to put multiple nonlinear constraints ?
@apm
@apm 5 лет назад
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
@othmanaljbory3649
@othmanaljbory3649 Год назад
I need bi-level programming please
@apm
@apm Год назад
See Bard, Practical Bilevel Optimization: Algorithms And Applications, Springer, 1998.
@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.
@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?
@deepocean8750
@deepocean8750 2 года назад
I STILL STRUGGLE XD
@user-ii2bu6wd4m
@user-ii2bu6wd4m 10 месяцев назад
3:29
@user-yn6bz9wq7t
@user-yn6bz9wq7t 4 года назад
I have your email
@apm
@apm 4 года назад
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
@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
Далее
Logical Conditions in Mathematical Optimization
11:04
Regression with MATLAB fmincon
17:52
Просмотров 30 тыс.
skibidi toilet 77 (part 1)
03:51
Просмотров 14 млн
Nonlinear Optimization
15:32
Просмотров 63 тыс.
MATLAB Tutorial for Engineering Optimization
16:05
Просмотров 90 тыс.
Design Optimization: What's Behind It?
29:25
Просмотров 15 тыс.
Constrained Optimization Problems with MATLAB
13:00
Просмотров 16 тыс.
How I mastered Leetcode the unfair way
8:02
Просмотров 21 тыс.
Application of Nonlinear Programming in Matlab
18:23
Просмотров 35 тыс.