Quantitative Performance Analysis of Spring-Mass-Damper Control Systems
A Comparative Implementation in Python and R
Abstract
The numerical simulation of control of spring-mass-damper (SMD) systems offer critical insights into dynamical systems and computational methodologies. This study provides a comprehensive comparative analysis of implementing SMD systems across two prominent open-source scientific computing platforms: Python and R. By examining both open-loop and closed-loop system configurations, the research investigates the computational performance, numerical accuracy, and implementation characteristics of these platforms. Utilizing an idealized one-dimensional SMD system with a Proportional-Integral-Derivative (PID) controller, the study conducted extensive numerical simulations and statistical performance analyses. Results revealed Python's significant advantages in execution speed, achieving up to 63.57% reduction in runtime for controlled system simulations, while R demonstrated superior consistency in execution and memory usage. The controlled system demonstrated exceptional performance, with a final position error of merely 0.4% and enhanced damping characteristics. This work not only bridges theoretical stability analysis with empirical performance insights but also promotes reproducibility and transparency in computational dynamics research by leveraging open-source platforms.
Downloads
References
[2] Fraser, N., Brierley, L., Dey, G., Polka, J.K., P´alfy, M., Nanni, F., Coates, J.A.: The evolving role of preprints in the dissemination of COVID-19 research and their impact on the science communication landscape. PLoS Biology 19(4), 3000959 (2021) https://doi.org/10.1371/journal.pbio.3000959
[3] Sugimoto, C.R., Work, S., Larivi`ere, V., Haustein, S.: Scholarly use of social media and altmetrics: A review of the literature. Journal of the Association for Information Science and Technology 68(9), 2037–2062 (2017) https://doi.org/10. 1002/asi.23833
[4] Harris, C., Millman, K., Walt, S., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N., Kern, R., Picus, M., Hoyer, S., Kerk- wijk, M., Brett, M., Haldane, A., R´ıo, J., Wiebe, M., Peterson, P., Oliphant, T.: Array Programming with NumPy. Nature 585(7825), 357–362 (2020) https://doi.org/10.1038/s41586- 020-2649-2
[5] Virtanen, P., Gommers, R., Oliphant, T.E., Haberland, M., Reddy, T., Courna- peau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., Walt, S.J., Brett, M., Wilson, J., Millman, K.J., Mayorov, N., Nelson, A.R.J., Jones, E., Kern,
R., Larson, E., Carey, C.J., Polat, , Feng, Y., Moore, E.W., VanderPlas, J., Lax- alde, D., Perktold, J., Cimrman, R., Henriksen, I., Quintero, E.A., Harris, C.R., Archibald, A.M., Ribeiro, A.H., Pedregosa, F., Mulbregt, P.: SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods 17(3), 261–272 (2020) https://doi.org/10.1038/s41592-019-0686-2
[6] McKinney, W.: Data Structures for Statistical Computing in Python. In: Walt, S., Millman, J. (eds.) Proceedings of the 9th Python in Science Conference, pp. 51–56 (2010). https://doi.org/10.25080/majora-92bf1922-00a
[7] Soetaert, K., Petzoldt, T., Setzer, R.W.: Solving Differential Equations in R: Package deSolve. Journal of Statistical Software 33(9), 1–25 (2010) https://doi.org/10.18637/jss.v033.i09
[8] Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L.D., Fran¸cois, R., Grolemund, G., Hayes, A., Henry, L., Hester, J., Kuhn, M., Pedersen, T.L., Miller, E., Bache, S.M., M¨uller, K., Ooms, J., Robinson, D., Seidel, D.P., Spinu, V., Takahashi, K., Vaughan, D., Wilke, C., Woo, K., Yutani, H.: Welcome to the Tidyverse. Journal of Open Source Software 4(43), 1686 (2019) https://doi.org/10.21105/joss.01686
[9] Ogata, K.: Modern Control Engineering. Prentice Hall, Upper Saddle River, NJ, USA (2010)
[10] Khalil, H.K.: Nonlinear Systems. Prentice Hall, Upper Saddle River, New Jersey, USA (2002)
[11] Dorf, R.C., Bishop, R.H.: Modern Control Systems. Prentice Hall, Upper Saddle River, NJ, USA (2011)
[12] Nise, N.S.: Control Systems Engineering. John Wiley & Sons, New York City, NY, USA (2020)
[13] Franklin, G.F., Powell, J.D., Emami-Naeini, A.: Feedback Control of Dynamic Systems. Pearson, Upper Saddle River, NJ, USA (2015)
[14] ˚Astr¨om, K.J., Murray, R.M.: Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press, Princeton, NJ, USA (2008)
[15] Chen, C.-T.: Linear System Theory and Design. Oxford University Press, Oxford, UK (1995)
[16] Waskom, M.L.: Seaborn: Statistical Data Visualization. Journal of Open Source Software 6(60), 3021 (2021) https://doi.org/10.21105/joss.03021
[17] Georges, A., Buytaert, D., Eeckhout, L.: Statistically Rigorous Java Performance Evaluation. ACM SIGPLAN Notices 42(10), 57–76 (2007) https://doi.org/10.1145/1297105.1297033
[18] Thompson, S.K.: Sampling. Wiley Series in Probability and Statistics, New York City, NY, USA (2012) https://doi.org/10.1002/9781118162934
[19] Herho, S., Anwar, I., Herho, K., Dharma, C., Irawan, D.: COMPARING SCIENTIFIC COMPUTING ENVIRONMENTS FOR SIMULATING 2D NONBUOYANT FLUID PARCEL TRAJECTORY UNDER INERTIAL OSCILLATION: A PRELIMINARY EDUCATIONAL STUDY. Indonesian Physical Review 7(3), 451–468 (2024) https://doi.org/10.29303/ipr.v7i3.335
[20] Herho, S., Fajary, F., Herho, K., Anwar, I., Suwarman, R., Irawan, D.: Reappraising Double Pendulum Dynamics across Multiple Computational Platforms. Preprints (2024) https://doi.org/10.20944/preprints202405.0232.v1
[21] Herho, S., Kaban, S.N., Irawan, D.E., Kapid, R.: Efficient 1D Heat Equation Solver: Leveraging Numba in Python. Eksakta : Berkala Ilmiah Bidang MIPA (2024) https://doi.org/10.24036/eksakta/vol25-iss02/487
[22] Jain, R.: The Art of Computer Systems Performance Analysis: Techniques for Experimental Design, Measurement, Simulation, and Modeling. John Wiley & Sons, New York, USA (1991)
[23] Brown, R.J.C., Brown, R.F.C.: Statistical Analysis of Measurement Data. Royal Society of Chemistry, London, United Kingdom (1998)
[24] Hoaglin, D.C., Mosteller, F., Tukey, J.W.: Understanding Robust and Exploratory Data Analysis. Wiley-Interscience, Hoboken, NJ, USA (2000)
[25] Mostafavi, S., Hakami, V., Paydar, F.: Performance Evaluation of Software Defined Networking Controllers: A Comparative Study. Computer and Knowledge Engineering 2(2), 63–73 (2020) https://doi.org/10.22067/cke.v2i2.84917
[26] Montgomery, D.C.: Design and Analysis of Experiments. John Wiley & Sons, New York City, NY, USA (2017)
[27] Bulmer, M.G.: Principles of Statistics. Dover Publications, New York, USA (1979)
[28] Razali, N.M., Wah, Y.B.: Power Comparisons of Shapiro-Wilk, KolmogorovSmirnov, Lilliefors and Anderson-Darling Tests. Journal of Statistical Modeling and Analytics 2(1), 21–33 (2011)
[29] Siegel, S.: Nonparametric Statistics for the Behavioral Sciences. McGraw-Hill, New York City, NY, USA (1956)
[30] Wilcoxon, F.: Individual Comparisons by Ranking Methods. Biometrics Bulletin 1(6), 80–83 (1945) https://doi.org/10.2307/3001968
[31] Levene, H.: Robust Tests for Equality of Variances. In: Olkin, I. (ed.) Contributions to Probability and Statistics, pp. 278–292. Stanford University Press, Stanford, California, USA (1960)
[32] Brown, M.B., Forsythe, A.B.: Robust Tests for the Equality of Variances. Journal of the American Statistical Association 69(346), 364–367 (1974) https://doi.org/10.1080/01621459.1974.10482955
[33] Sullivan, G.M., Feinn, R.: Using Effect Size—or Why the P Value is Not Enough. Journal of Graduate Medical Education 4(3), 279–282 (2012) https://doi.org/10.4300/JGME-D-12-00156.1
[34] Cohen, J.: Statistical Power Analysis for the Behavioral Sciences. Routledge, New York City, NY, USA (1988). https://doi.org/10.4324/9780203771587
[35] Sawilowsky, S.S.: New Effect Size Rules of Thumb. Journal of Modern Applied Statistical Methods 8(2), 597–599 (2009) https://doi.org/10.22237/jmasm/1257035100
[36] Iglewicz, B., Hoaglin, D.C.: Volume 16: How to Detect and Handle Outliers. ASQC Quality Press, Milwaukee, WI, USA (1993)
[37] Chandola, V., Banerjee, A., Kumar, V.: Anomaly Detection: A Survey. ACM Computing Surveys 41(3), 1–58 (2009) https://doi.org/10.1145/1541880.1541882
[38] Rousseeuw, P.J., Croux, C.: Alternatives to the Median Absolute Deviation. Journal of the American Statistical Association 88(424), 1273–1283 (1993) https: //doi.org/10.1080/01621459.1993.10476408
[39] Tukey, J.W.: Exploratory Data Analysis. Addison-Wesley, Reading, MA, USA (1977)
[40] Aggarwal, C.C.: Outlier Analysis. Springer, New York City, NY, USA (2013). https://doi.org/10.1007/978-1-4614-6396-2
[41] Mytkowicz, T., Diwan, A., Hauswirth, M., Sweeney, P.F.: Producing Wrong Data Without Doing Anything Obviously Wrong! ACM SIGARCH Computer Architecture News 37(1), 265–276 (2009) https://doi.org/10.1145/2528521.1508275
[42] Altman, D.G., Machin, D., Bryant, T.N., Gardner, M.J.: Statistics with Confidence: Confidence Intervals and Statistical Guidelines. BMJ Books, London, UK (2013)
[43] Masini, S., Bientinesi, P.: High-Performance Parallel Computations Using Python as High-Level Language. In: Guarracino, M.R., Vivien, F., Tr¨aff, J.L., Cannatoro, M., Danelutto, M., Hast, A., Perla, F., Kn¨upfer, A., Di Martino, B., Alexander, M. (eds.) Euro-Par 2010 Parallel Processing Workshops, pp. 541–548. Springer, Berlin, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21878-1 66
[44] Raschka, S., Patterson, J., Nolet, C.: Machine Learning in Python: Main Developments and Technology Trends in Data Science, Machine Learning, and Artificial Intelligence. Information 11(4), 193 (2020) https://doi.org/10.3390/info11040193
[45] Watson, A., Babu, D.S.V., Ray, S.: Sanzu: A data science benchmark. In: 2017 IEEE International Conference on Big Data (Big Data), pp. 263–272 (2017). https://doi.org/10.1109/BigData.2017.8257934
Copyright (c) 2025 Indonesian Journal of Applied Mathematics

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.