UPDATE: I managed to get the model really close to realtime, if anyone else is wondering how, here are my steps.
- I set the solver to variable step size with ode23 solver and a minimum step size of 2e-4. This lead to a performance increase and as far as I can say it the simulation is stable with no unexpected behaviour.
- I tried simulating with a desktop processor with a bigger single thread performance at 4.6Ghz, this lead to a big improvement obviously.
- I removed the udp receiver block. This was definitely not obvious to me, but the udp receiver block kind of interrupted the simulation every 0.01s because of the sample time chose in it. I really thought the udp receiver would be executed in parallel but I was wrong. This leads to the question, how I can implement a udp receiver without delaying the simulation?