Inspiration
Our project was inspired by the theme of "Double Major" where we were tasked with building software that helps students from a non CS major. Our tool is inspired by Simulink in MATLAB which engineers use, but every engineer HATES MATLAB and the interface sucks. Also, many of the other disciplines lack tools which is proprietary. Hence, we built something that can be used by all STEM students.
What it does
Our software enables drag drop components that model core physical components for modelling systems. For example, in mechanical engineering, there are masses, springs, dampers. In electrical engineering, there are batteries, resistors, capacitors etc. Our modelling system abstracts these components. Students may select a domain/field that represents their discipline and they will see components they are familiar with. They can use this tool to build up mathematical models block by block and simulate them. This helps with learning, understanding the physical model and in future collaboration between different disciplines to build things like robots, electrochemical cells etc which are based on multiple energy domains.
BTW: The source inputs (source flow and source effort) currently only work with constant input (not very interesting) and sinusoidal input.
How we built it
We built our frontend based on a core library called Drawflow.js and refactored in into React and built additional React components. The graph created in Drawflow.js is sent to the backend in which we created a Julia webserver using Genie.jl framework. The core library we use in Julia simulates the model via BondGraphs.jl which builds a graphical object, converts it into a system of differential-algebraic equations (DAEs) which are then solved and simulated. The results of the simulation are returned to the frontend and rendered by Plotly.js for visualisation.
Challenges we ran into
Our project initially started with python FastAPI backend but we couldn't get numerical and symbolic solvers to work so we moved to Julia. We faced SIGNIFICANT challenges dealing with Julia because no one on our team had ever used Julia before. We learnt a Julia web framework from scratch and battled with Julia's strict typing system. The most challenging thing was that our library had to precompile which took more than 5minutes every single time. So if we hit a bug, we had to recompile and this made development EXTREMELY frustrating and slow.
We also faced SIGNIFICANT challenges dealing with CORS in Julia and deploying our backend. We found some solutions through NGrok.
Accomplishments that we're proud of
We are super proud to actually deliver what we set out to achieve. We literally pulled an all nighter and slept over at uni.
What we learned
We learnt a shit tonne about Julia language quirks since we were broken so many times during our development. We also learnt a lot of physics and maths.
What's next for System Interactive Modelling (SIM) GUI
- We will add in additional source inputs functions, allowing users to define the input using maths. Currently we have only implemented constant inputs and sine inputs, but technically any arbitrary function of time can be used as input.
- We will enable multiple users to collaborate in the workspace in future using Websockets
- We will improve on the simulation performance and ability to handle concurrent requests on the server. - - We will improve on UI to inform users that they may need to wait for the simulation to complete. We can also return the simplified differential equations from the backend in LaTeX
Built With
- bondgraphs.jl
- drawflow.js
- genie.jl
- julia
- ngrok
- plotly.js
- vercel
- vite+react.js
Log in or sign up for Devpost to join the conversation.