0

I am using OpenMDAO to carry out a simulation of a CNC turning process and want to implement my own 'executor(s)' for my Components - much like the car example in the older versions of OpenMDAO, where SimAcceleration driver is used to implement the way the Components will be executed.

However, I don't know how we can implement such an example in OpenMDAO 1.x, where we might want to implement custom logic to drive inputs to and fetch outputs from Components and/or Groups. Any pointers will be really helpful.

P.S. - I was thinking of wrapping my Components in a Problem and create an instance of it in another Component and put all the execution logic in its solve_nonlinear (as suggested here). But I'm not sure if this is the right approach to deal with this problem.

Community
  • 1
  • 1
Amogh Kulkarni
  • 95
  • 1
  • 11

1 Answers1

1

We've tended to model time integrations differently recently. Instead of using a driver, we now use a component that does the integration and outputs the whole time history as a big array. You can take a look at our code for doing that using a satellite design problem. But if you have a big model with lots of components that you want to integrate around, then either a nested problem or a custom driver would do the trick.

If you're going to do some optimization around it, I would try for the nested problem approach. You could make your model, wrap it up as a problem. Then give that problem to some kind of time integrator that you write as its own component. Alternatively, you can wrap the problem in a simple function and hand that function to one of the scipy integrators

If you just want to loop over the model in time a driver would work. I would try to start with one of the optimization drivers, and modify it with your own for-loops and such. This would work fine, and might make for an interesting driver.

Justin Gray
  • 5,605
  • 1
  • 11
  • 16