A Trip Through the Mobile Multibody Dynamics YouTube Archive

Though I haven’t released an update to the Mobile Multibody Dynamics (MOMDYN) app in going on a year, it’s on my checklist of projects to return to it over the next few months, and improve it given some of my recently gained knowledge in SwiftUI. The app itself has its origins in a sabbatical that Rachel and I took in 2019-2020, during which I started writing MOMDYN having observed a lack of useful mechanical engineering apps on mobile. During that time, I’ve posted many videos demonstrating the app features to its YouTube page, which themselves tell a story of how it came to be what it is today.

iOS App Preview

Of course I should mention, before I go on this trip through the memory banks, you can download MOMDYN and try it yourself!

Link to Download MOMDYN on the App Store
Link to download MOMDYN from Google Play

The Kivy Years

During a six month travel sabbatical back in 2019, one of my goals was to take that time to learn Python. I’m a project-oriented learner, meaning to really pick up a new skill, I need to apply it something practical and in context of my own profession and experience. There are a couple of key Python modules that helped me along the way of creating my own mechanical engineering app:

  • Kivy, a multiplatform, multitouch application development framework.
  • SymPy, and its excellent mechanics module for symbolic math.

To this day, the analytical backend in MOMDYN uses Python analysis routines wrapped around SymPy mechanics, in what I call the Mechanism object. I had to write a few workarounds to make this all work on mobile, such as creating my own numerical Runge-Kutta integration routines. This is because SciPy, which wraps various FORTRAN-based numerical analysis functions, turns out to be nearly (but not completely) impossible to build for iOS. Python helped to expedite the process of creating a usable mechanical engineering modeling and simulation app.

Looking back at the YouTube videos from my “Kivy Era,” the line drawings and very rudimentary 3D rendering are pretty hilarious. But hey, it worked, and was published on the app stores for quite some time in this form.

My Very First Video
One of My Favorite Models
Adding 3D – My Most Popular Video

Going Native on Android …

One of the things I learned from my experience with Kivy is that, while it works, it is not “native” to the target operating systems, and for any everyday user of an Android device, the user interface (UI) simply doesn’t feel right. Adding to that, modern Android development in the Kotlin language is generally much more stable (fewer crashes) due to implementing null safety and compile-time checks, and is much faster and responsive.

The current version of the MOMDYN Android app is written in Kotlin and Jetpack Compose, and embeds a Google Filament view for 3D rendering. Thankfully, I can still call from the existing Python modules that I created for the Kivy version, thanks to the excellent Chaquopy add-on. This all makes for a much prettier and performant user experience on Android.

Vibration Tutorial on Android in Kotlin and Jetpack Compose
Double Pendulum Oh My God!

… and on iOS

For the same reason that I opted to create a native UI for Android, I created a fully native experience on iOS using SwiftUI and SceneKit. The downside of going native is that the two apps no longer are able to completely share a codebase, as they did with Kivy, however, I believe that the benefit to the end user outweighs that cost.

Unlike Android, there is no simple and well-supported add-on to include Python inside an iOS app that is written in SwiftUI. Therefore, to reuse the Python backing code, I had to find my own way, which I posted as a procedure on GitHub under the name BeeSwift. The name is a reference to the BeeWare Briefcase project, which enables development of a complete iOS app using Python, but using Python itself to write the interface, not SwiftUI. Given that I wanted some of the quality-of-life improvements provided by SwiftUI, like the null safety aspect similar to Android, and to be able to access native modules like SceneKit, developing this procedure truly was essential to creating this version of the app.

MOMDYN in SwiftUI and SceneKit
Rapid Fire 6DoF Model Building

Conclusion

MOMDYN is the single mobile application project that I have spent the most time on over the last 4-5 years, and I am happy to have native versions published for both Android and iOS. Going through the YouTube archives for MOMDYN is a good reflection on how it came to be what it is today. If these videos make you interested, please download from the stores using the links at the top (and add a review if you like it), or follow one of our social sites through the links below.

Leave a Reply

Your email address will not be published. Required fields are marked *