MATLAB Nonlinear Optimization with fmincon

  Рет қаралды 243,334

APMonitor.com

APMonitor.com

Күн бұрын

Пікірлер: 149
@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
@wondemsegegnzewdu8208
@wondemsegegnzewdu8208 7 жыл бұрын
Proffesor John D. Hedengren, Thank you very much. All your videos are very heplfu to me.
@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.
@lutherbrown8873
@lutherbrown8873 4 жыл бұрын
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.
@hakanberkcanpolat4408
@hakanberkcanpolat4408 Жыл бұрын
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 Жыл бұрын
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 жыл бұрын
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...
@MasetGaming
@MasetGaming Жыл бұрын
This video explains it better than my tutor... amazing! Thank your for your work
@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.
@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!
@ojadukwu7516
@ojadukwu7516 3 жыл бұрын
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
@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
@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!
@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.
@anjaliguli5419
@anjaliguli5419 2 жыл бұрын
This is amazing! I was struggling to find the right tutorial. 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
@DHIRAJGHOSH-e2u
@DHIRAJGHOSH-e2u Жыл бұрын
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
@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: kzbin.info/www/bejne/mImknKVtgrWZatk
@immortalmuffinz
@immortalmuffinz 5 жыл бұрын
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 жыл бұрын
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)
@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
@slippinchillin
@slippinchillin 4 жыл бұрын
Thank you sir! This tutorial helped a lot!
@beoptimistic5853
@beoptimistic5853 4 жыл бұрын
kzbin.info/www/bejne/joGmmHqKbqefqLM 👍💐
@vijaykumars5041
@vijaykumars5041 7 жыл бұрын
Thank a lot. It really helped me to solve my problem
@thegoosy69
@thegoosy69 5 жыл бұрын
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.
@李星-盲僧
@李星-盲僧 4 жыл бұрын
this video is very helpful, thanks so much
@faraznassar9823
@faraznassar9823 4 жыл бұрын
Can you please optimize the water filling algorithm using fmincon?
@apm
@apm 4 жыл бұрын
Here is something that may help: apmonitor.com/pdc/index.php/Main/LevelControl
@thetea-rexchannel8212
@thetea-rexchannel8212 5 жыл бұрын
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 5 жыл бұрын
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.
@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.
@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.
@I-Want-Guy-Plush
@I-Want-Guy-Plush 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
@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 жыл бұрын
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 жыл бұрын
@@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
@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.
@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.
@mah533
@mah533 7 жыл бұрын
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 7 жыл бұрын
+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
@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.
@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
@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.
@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.
@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.
@maroofmaroof3799
@maroofmaroof3799 6 жыл бұрын
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 6 жыл бұрын
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
@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
@shimabagherzade5302
@shimabagherzade5302 5 жыл бұрын
Thanks. It was very helpful.
@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.
@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
@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.
@srg25008
@srg25008 5 жыл бұрын
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
@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
@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
@edenhuang6659
@edenhuang6659 7 жыл бұрын
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 7 жыл бұрын
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 7 жыл бұрын
Hi, do you have example that directely call ipopt in matlab without linking APM?
@apm
@apm 7 жыл бұрын
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.
@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
@othmanaljbory3649
@othmanaljbory3649 Жыл бұрын
I need bi-level programming please
@apm
@apm Жыл бұрын
See Bard, Practical Bilevel Optimization: Algorithms And Applications, Springer, 1998.
@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
@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.
@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.
@nivedithaponnapureddy443
@nivedithaponnapureddy443 7 жыл бұрын
i need matlab coding with sub programs for crossover,mutation and selection so plzzz help with these 3
@apm
@apm 7 жыл бұрын
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
@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
@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
@GAment_11
@GAment_11 4 жыл бұрын
Brilliant. Subscribed.
@apm
@apm 4 жыл бұрын
Thanks Geoff!
@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?
@GangiGangan
@GangiGangan 4 жыл бұрын
Thank you for sharing! :)
@Priority9842
@Priority9842 3 жыл бұрын
King 👑 👑 👑
@atanusarkar4680
@atanusarkar4680 3 жыл бұрын
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 3 жыл бұрын
Sorry, I can't help with the many requests for individual support, especially those that may be related to homework.
@aimalrehman2961
@aimalrehman2961 6 жыл бұрын
Thank you very much
@NgọcKhôiĐặng-b7l
@NgọcKhôiĐặng-b7l Жыл бұрын
3:29
@dr.alikhudhair9414
@dr.alikhudhair9414 2 жыл бұрын
Wonderful
@jtshek8217
@jtshek8217 5 жыл бұрын
Thank you.
@romainpryckodko9031
@romainpryckodko9031 6 жыл бұрын
Thank you :)
@deepocean8750
@deepocean8750 2 жыл бұрын
I STILL STRUGGLE XD
@عبداللهعدنانالبياتي
@عبداللهعدنانالبياتي 5 жыл бұрын
I have your email
@apm
@apm 5 жыл бұрын
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
@knighttime19
@knighttime19 6 жыл бұрын
Thanks
@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
@henryotto9132
@henryotto9132 3 жыл бұрын
nice
Create HD Screencast for YouTube
6:25
APMonitor.com
Рет қаралды 1,4 М.
Constrained Optimization: Intuition behind the Lagrangian
10:49
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Regression with MATLAB fmincon
17:52
APMonitor.com
Рет қаралды 30 М.
Overview of Nonlinear Programming
20:17
Kody Powell
Рет қаралды 30 М.
Optimization with Python and SciPy: Constrained Optimization
7:41
Kody Powell
Рет қаралды 1,4 М.
Applied Optimization - Matlab 'fminsearch' with Two Variables
9:23
Approximating The Cos Function Challenge
6:29
SilentALume
Рет қаралды 94 М.