I’m a lowly mechanical engineering lecturer. I use Jupyter notebooks to teach fluid mechanics[0]. I make videos of fluid flows with Blender and embed them with the notes along with some basic Python code examples so that students are aware of how basic code can make an Engineer’s life easier (even if Matlab is the standard platform).
I also embed simple 3D models with pyGEL3D[1]. It’s fine but very limited. I’m always blown away by this gentleman’s work when it comes up here on HN and would like to use JavaScript instead, but I’ve no idea where to start. Can anyone recommend a good book or online course that would put me on the right path?
Why learn JS? I guess it’s because I think it’ll be a useful skill that will allow me to do more in the future, not just find a better way to embed 3D models in a notebook.
It might be useful to build tools for research projects, interactive elements for assessment etc.
The bulk of my coding is work Matlab and an increasing amount of Python. JS would allow me to to more web based stuff.
There's other stuff like build tools, cross-browser, and other stuff, but that's likely to be confusing and not super necessary to begin with. The above should be enough to get you running with what it sounds like you want to do.
I appreciate you sharing those links. I'm trying to learn mechanical engineering stuff myself, if you have any further useful learning materials I would love to see them.
I wish there were more opportunities for people to learn via “cross training” like this.
I’d love to learn more about a number of engineering disciplines by helping people who know those fields, learn how to implement the algorithms and mathematical calculations they need in Python and simultaneously, learning more about those algorithms and calculations in order to best implement them and show how best to use Python for these tasks.
But unfortunately such opportunities are few and far between outside academia and other learning oriented environments in my experience.
I love this idea. The best way to get academics to buy in would be to have some clear outcome such as a publication or funding opportunity.
There are a lot of clunky engineering tools that would benefit greatly from professional software development. Computational Fluid Dynamics software in particular is just plain awful in terms of usability for beginners.
What are the names of some of this software that are a good example of in-use but are clunky/have awful usability? I ask because it sounds like an interesting area, and I would like to see for myself what you're working with.
On one hand there is Ansys. It’s a Frankenstein’s monster of a software suite for numerical simulation comprising several tools that have been acquired over the years. It’s frightfully expensive and there’s no incentive to make it more usable as there’s limited competition.
Then there’s OpenFOAM which is a fantastic open source alternative. It’s entirely command line based but there are UI derivatives and cloud based versions (SimScale). However it’s a nightmare of disjointed code, difficult to build and heavy on dependencies. You spend all your time dealing with endless problems related to defining simple geometries in the basic BlockMesh tool and then dealing with and compiling various solvers. It’s a research grade tool and not a polished piece of software. I won’t go into the various versions with incompatible differences.
Getting the most basic stuff working is tedious and frustrating in both.
After a few years of this masochism you just get on with it. However, when you are trying to guide students through the software for their final year project they spend about two thirds of their time just figuring out how to get something simple running and then never want to touch CFD ever again.
Then there’s Blender where I can install it in seconds and set up a simple flow simulation with a straightforward workflow. Sure the result is not remotely accurate but that’s just the solver, there is no reason for the complexity of the workflow in Ansys or OpenFOAM other than it was designed by (Mechanical) Engineers who know nothing about good software design.
Thanks for the info! Heh, if Blender is your only go to alternative for ease of simulations and usability, then there's definitely a need for improvement.
The speed and efficiency of Blender at creating geometry and timing animation is incredible. Doing mostly the same stuff in the aforementioned CFD tools is incredibly convoluted in comparison. It’s like trying to code in MS Word whereas Blender is like Vim.
I guess the person you replied to is saying that they are interested in teaching you JS, in exchange for you teaching them mechanical engineering fundamentals, assuming your schedule can allow that.
I recommend trying to get started with webGL Elm [0]. It's a language that compiles to JS to run in the browser. It's a functional language and saves you from having to deal with most of the historical baggage of JS.
There's an array of javascript libraries to choose from, but maybe you would find Observable (reactive javascript notebooks) to be a good substitute for Jupyter.
Observable is geared toward the use of d3.js (essentially a library for drawing charts and graphs) which can be a bit intimidating, but you can use other libraries as well. For 3D, regl seems to be a good option. It's a library which makes using WebGL a bit more convenient. Here's an example of an Observable notebook that uses regl: https://observablehq.com/@rreusser/contour-plots-with-d3-reg...
Check out R. Reusser's other notebooks too. My guess is that choosing a set of JS libraries/tools to learn is the hard part, here, once you've committed to javascript.
I use Jupyter because it’s something that the students are finding used more and more when they go on industrial placement. Matlab is extremely popular in engineering but Python is growing.
My notebooks are deliberately simple so it’s not I ntimidating for students who are frequently terrified by code. The point is to show them that some basic readable code can help them solve problems and avoid going too deep into the weeds.
I also embed simple 3D models with pyGEL3D[1]. It’s fine but very limited. I’m always blown away by this gentleman’s work when it comes up here on HN and would like to use JavaScript instead, but I’ve no idea where to start. Can anyone recommend a good book or online course that would put me on the right path?
[0] https://nbviewer.jupyter.org/github/nolankucd/MEEN20010/tree...
[1] http://www2.imm.dtu.dk/projects/GEL/PyGEL/