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

68 views (last 30 days)
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).

Accepted Answer

Jim Riggs
Jim Riggs on 5 Dec 2022
Edited: Jim Riggs on 5 Dec 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 Comments
Jim Riggs
Jim Riggs on 6 Dec 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
Ulrik on 7 Dec 2022
Sorry for not accepting your answer - even gave you a vote in hopes that it further helps your standing in the community!

Sign in to comment.

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!