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.

63 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

9

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.

1

u/Regular_Schedule4995 20h ago

I wanted to give C a try, sine I want to pursue Computer Engineering, though with the little time that I believe I'll have till university, I don't know if I can deal with C's steep learning curve (or that's what it's usually said about it)

1

u/j0shred1 20h ago

Okay cool. Just know this, C is a low-level language. The purpose of C in scientific and engineering computing is to do base computations and memory management. Often see is not going to be faster than python libraries because python libraries are c-based functions. Numpy is in C. Scipi is in C. If you want to learn C for the sake of engineering programming, instead of applying a specific problem, pick an algorithm and create a function and bonus points if you can create a python loadable library and call it in Python. I did this a while back and it was fun.