# Seconds, minutes or hours for year-long SIMULINK simulation?

54 visualizaciones (últimos 30 días)
Ulrik el 5 de Dic. de 2022
Comentada: Ulrik el 7 de Dic. de 2022
I want to model a physical system, a renewable energy production device (several megawatts) that reacts to environmental forces and I want to understand its behavior over a year or more. I think Simscape is the right tool for this.
I understand SIMULINK/Simscape's time unit is dimensionless. However, there seem to be aspects of SIMULINK/Simscape programming that indicates it is designed for running only in seconds in real time. For example, the 256x max playback increase in the animation, and certain units for certain elements contain seconds (like the damping coefficient of a Revolut Joint being in N*m/(deg/s)).
What is best practice? To keep everything in seconds and just set time steps to be several seconds and stop times to be millions of seconds? Or should I convert everything to e.g. hours (meaning I need to multiply force in Newtons by 13M as it has units kg*m/s^2)?
I am asking now before I get too far along in developing the model at which point it might be very painful to convert (as I will likely miss some time unit in some subsystem of a subsystem and might spend days or weeks debugging during a conversion).
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Jim Riggs el 5 de Dic. de 2022
Editada: Jim Riggs el 5 de Dic. de 2022
There is a great risk of somthing going wrong if you use anything other than seconds in a physics model, since, as you pointed out, there are many physical parameters that we use that have implied units.
I have previously built simulations of planetary motion which run for years of simulation time, but the basic calculations were done in seconds. I define variables like minute = 60, hour = 60*minute and day = 24*hour, and then set my simulation time step = k * hour.
##### 5 comentariosMostrar 3 comentarios más antiguosOcultar 3 comentarios más antiguos
Jim Riggs el 6 de Dic. de 2022
It's always wise to do tests for accuracy when employing numerical methods. This is how you determine what basic step size is needed for the particular problem you are working. Also, in general, there is a great advantage to using higher-order numerical integration methods interms of accuracy and speed of computation, so these are worth becoming familiar with.
If you find my input helpful, it would be nice if you would "accept" my answer.
Thanks.
Ulrik el 7 de Dic. de 2022
Sorry for not accepting your answer - even gave you a vote in hopes that it further helps your standing in the community!

Iniciar sesión para comentar.

### Categorías

Más información sobre Troubleshooting en Help Center y File Exchange.

R2022b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by