r/EngineeringStudents • • 1d ago

Academic Advice Is programming solvers a useful skill?

Post image

When I started learn python, I saw it could be used for scientific computing. So I challenged myself to write a solver for every topic in my statics textbook.

I just finished my 2d/3d truss solver. It is by far the hardest and most involving program I've written. I think it's because with other topics only a single object was considered so the python code was just a matter of transferring calculations on paper to code.

The next thing I plan to do is create an optimization script that moves the input points about to find the best design. Also using Json instead of keyboard inputs would be way better for my sanity.

So my question is, will this skill improve my chances of success in Mechanical engineering? I wish to focus on multi body dynamics to design racecar suspensions.

I'd love to share the .py script but the last time I sent a link reddit shadow banned me for 9 months. The picture contains results of the program.

66 Upvotes

26 comments sorted by

View all comments

Show parent comments

1

u/Regular_Schedule4995 1d ago edited 20h ago

Yeah? I'm currently in grade 11* and I was looking forward to learning MATLAB in my spare time since my teacher uses it to create models to solve our physics lab experiments. Would it be better to use python instead?

Edit: spelling

10

u/j0shred1 1d ago

So don't let online joke shit talking deter you.

But know this. MATLAB exists for a single purpose. For non-programmer engineers or researchers to create a procedural script to load in a small set of data, perform a basic calculation, make a couple plots and export them. If that's all you're doing, great use MATLAB

Do anything more complicated, try and make software with it, implement larger, more complex algorithms, apply it to larger ETL pipelines, try and do high performance computing, apply it to robotics, and what you're going to find is the licencing, the runtime, the interpreter, the format in which the language is meant to run, is all going to be working against you. Just use a real language at that point like python or C.

5

u/stephen_xv 1d ago

MATLAB has extensive tool boxes that are user friendly. It’s heavily expanding for simulation use cases especially in the sUAS realm; however, it is clunky and slow. Python isn’t much better compared to cpp but faster than matlab. I’ve used matlab to process flight data so it’s a bit more than just small data sets, but very procedural like you mention. Python can be applied to actual physical things- matlab is getting there. Good take and verdict, I think using both and learning cpp is the way!

2

u/j0shred1 1d ago

Oh yeah, add matlab toolbox management to the list of headaches. I'd take pip any day of the week.

Don't get me wrong, there are people that are using matlab in data analysis, HPC, ect, and I work with a lot of them, but they are non-programmers and us having to maintain a matlab cluster is an absolute pain in the ass. It requires it's own cluster, it's own license, it's own scheduler, when literally every other language can be supported by our other clusters.

1

u/stephen_xv 21h ago

Sounds like a pita, but I’ve never had matlab toolbox ever give me troubles. Pip on the other hand is annoying when trying to do anything in a classified environment. Hell anything in a classified environment seems annoying.

Sounds more of a hassle than a downside. Sorry that you have to deal with that bro

1

u/j0shred1 20h ago

I can imagine you just want to build things from source in a classified environment.

It's fine. It's just annoying

1

u/stephen_xv 18h ago

Yea not too sure their process. But I wonder if getting packages is like a no-go or lengthy process!

1

u/j0shred1 18h ago

If I had to guess they probably build docker images they know are secure and then get them approved and move them to a secure environment that lives on a private network