1

I want to minimize a cost function for a differential-nonlinear system (dynamic). Is it possible to use this software? How can I do it?

Best regards, Haniye

haniye
  • 11
  • 1
  • 1
    Hi haniye, and welcome to scicomp! It's a bit hard to give advice without having a few more details about the problem you're solving. Writing your objective and constraints explicitly will enable us to help you better. – Paul Feb 07 '14 at 21:20
  • Did you receive my answer? – haniye Feb 07 '14 at 21:26
  • the cost function to be minimized is "J=integral(t_f)" and the state equations are "X_dot = f(X,t) + B(X,t) u". I have just Initial condition with Final Constraints for states. – haniye Feb 07 '14 at 21:29
  • 2
    You haven't specified what software "this software" is? It sounds as though you have a particular software package in mind. – Brian Borchers Feb 07 '14 at 22:21
  • sorry. No, I mean MATLAB. – haniye Feb 08 '14 at 19:37

1 Answers1

0

In theory, you could do it in MATLAB. In practice, you probably can't, and shouldn't, because it would probably be prohibitively slow.

The two dominant approaches I'm aware of for dynamic optimization are:

  • collocation; fully discretize your differential equations using a collocation method (Radau collocation is a common approach) and then solve a very large linear program
  • interval arithmetic + automatic differentiation + branch-and-bound; essentially, use interval arithmetic and automatic differentiation to generate convex and concave relaxations of your dynamic optimization problem, and then use a branch-and-bound approach to solve

In practice, neither of these approaches is likely to be viable in MATLAB; the former approach is a more realistic possibility than the latter.

The large-scale nonlinear programming solver IPOPT was essentially written to solve nonlinear programs arising from collocation, and a compiled language was used (first Fortran, then C++) because large-scale nonlinear programs are computationally demanding. IPOPT does have a MATLAB interface affiliated with it, so if you were to try this approach in MATLAB, you might be able to use the interface and solve your problem. It's not clear that the interface is maintained; for instance, documentation suggests that it has been tested in MATLAB 7.2 (R2006a) to 7.7 (R2008b), which means it hasn't been tested against a version of MATLAB released in the past 5 years. If this interface works, it is probably your only viable approach for using MATLAB to solve a dynamic optimization problem.

The rigorous approach (interval arithmetic, etc.) is already time-consuming, even if everything is implemented in C++. Problems with 10 or so state variables take an hour or two to complete, and the algorithm scales exponentially with the number of state variables. Although interval arithmetic and automatic differentiation packages exist for MATLAB, you would probably have to write all of the remaining solver infrastructure (I'm not aware of any libraries that implement this approach). The performance of MATLAB is usually one to three orders of magnitude slower, assuming that you're not relying heavily on compiled libraries, so solving your problem would likely take an unacceptably long time (and that's assuming your problem is small enough for this approach).

Geoff Oxberry
  • 30,394
  • 9
  • 64
  • 127