MATLAB Genetic Algorithms with Stiff ODEs in Matlab

Click For Summary
Optimizing a system of 10-20 differential equations in Matlab using genetic algorithms is leading to issues with the ode solver getting stuck in an infinite loop. The solver appears to diverge without throwing an error, causing the genetic algorithm to halt progress. There is a need to determine if the ode solver is converging and to implement a mechanism that allows the genetic algorithm to explore alternative solutions if it is not. Similar convergence issues arise with pattern search methods, and the problem persists even in high-dimensional systems. While handling each element with a for loop yields results, vectorizing the operations leads to diverging solutions and NaN values.
mhmounty
Messages
10
Reaction score
0
I'm trying to optimize a system of 10-20 differential equations in Matlab using a genetic algorithm. The problem is, when I call the ode function, whether it be ode45, ode23, ode15, etc., it sometimes gets stuck in an infinite loop. The genetic algorithm no longer progresses and I have to Ctrl+C out of it.

My guess is that the ode solver is diverging, yet not throwing an error that it is stuck. It just gets stuck and doesn't timeout. I'm wondering if there is a way that I can test if the ode solver is converging, and if it isn't, force the GA solver to try a different point. The equations that I am trying to fit are all exponentials that range over 20 orders of magnitude or so, so there are many solution sets that won't converge.

This behavior isn't limited to only GA algorithms. I get the same behavior if I'm running a pattern search on the same set.

Any ideas?
 
Physics news on Phys.org
I have a similar problem with a system of hundreds of dimensions.

Thing is, it works fine if I handle each element with a for loop, but when I vectorize thee operations, I get diverging solutions that go NaN.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K