1

I am working on modeling and controlling of a hydraulic system. Modeling of the system is modeled in Matlab simscape in simulink environment which is looks like this System and for basic controlling to control the piston position (Piston Pos in figure) I have established simple feedback to check the position.

While I run the simulation when this comes to control the position Simulation takes too much time. For example if I gave desired piston position 300 mm than while output comes to around 290-294 mm simulation time reaches at around 5.18sec than it is stuck on that for longer time.

I want to know that, is there any way to speed up the simulation ?

I am using Matlab simulink solver ode23t due to simscape modeling.

Krunal V
  • 1,255
  • 10
  • 23
  • You give no information about anything related with time. What are your parameters off the simulation? What PC are you running this on? – Ander Biguri Feb 15 '17 at 12:06
  • I am using Windows 7-64 bit OS. On Intel i5-4570 CPU @3.20 GHz processor with 8 GB RAM. And i am not able to identify about parameter of the simulation. Are you (@Ander Biguri) asking about algebric loop, sample time all that stuff? – Krunal V Feb 15 '17 at 12:23

1 Answers1

1

Speeding up simulations in general is vast subject. It seems the issue here is an event which triggers multiple small time-step in the variable step solver. This can be perfectly normal, for example a clutch engaging, or a valve opening. To check whether or nor this is the case you can execute (make sure time-logging is enabled):

semilogy(tout(2:end), diff(tout))

Sharp downward spikes indicate small time-steps were taken. For a more in-depth analysis you can use the Solver Profiler:

https://www.mathworks.com/help/simulink/ug/examine-solver-behavior-using-solver-profiler.html

This will give you detailed information as to which components are causing solver resets. Such behavior can be difficult to debug if you're not used to the tool. I'd highly recommend getting in touch with MathWorks tech support if the behavior persists. They'll be able to look at your model and diagnose the issue.

ngautier
  • 86
  • 3
  • thanks for your help, all of the situation you mentioned are true for my simscape model. I am going to analyze those. – Krunal V Jul 12 '17 at 07:27