r/AerospaceEngineering • • Feb 15 '23

Uni / College Python code

Post image

So my assignment problem is coding a program to find the mach number and total enthalpy using python/matlab. I prefer python coz of the vast possiblities in AI and Automation. Can someone please help me with this🫡

0 Upvotes

22 comments sorted by

View all comments

12

u/[deleted] Feb 15 '23

Assuming you know the brayton cycle it should be pretty straightforward to put it in code, i recommend using coolprop for thermo calcs.

-23

u/[deleted] Feb 15 '23

I have next to 0 knowledge in coding

42

u/[deleted] Feb 15 '23

and you will remain that way if somebody posts an entire code for you on reddit. If that's what you're after try chatGPT :) If you ask some more specific questions people may be able to help, what is the problem you're having? Have you tried learning basic syntax and writing some straightforward calculation scripts yet?

-16

u/[deleted] Feb 15 '23

I have a minimal bg in coding i had bio as my major in 12th grade💀. But yeah i do wanna learn pythons i just wanted to know the process,heard aerospace has serperate libraries in python and matlab from cs friends

19

u/8for8m8 Feb 15 '23

You don’t need libraries to do this…you need like 100 lines of matlab at most.

I’d strongly suggest you enroll in some basic coding class. Can’t get through an aero degree without this knowledge. My school had a 1 credit matlab for engineers class. Or you could do comp sci 101 for a bit more. If you need to teach yourself, time to visit youtube. codingbat is a good practice website.

Edit: It’s also comical to me that you are talking about AI and automation when you are struggling with this.

9

u/[deleted] Feb 15 '23

As a short aside, you should take everything your CS friends say about coding with a massive grain of salt, you and they exist in different universes, they know essentially nothing about the types of codes you will be writing as an engineer. As an engineer, the code you will be writing will by syntactically incredibly simple, and conceptually very complex. 90% of your codes will be completely done on paper before you write a single line, and then it becomes a formality. It is unlikely you will need to optimize the shit out of your codes, work with insanely large datasets, or write frameworks, interfaces, or applications. Likewise, most of them will not need to (or be able to) solve differential equations, thermo problems, discretized PDEs (the backbone of CFD), etc. Source: I lived with a 4.0 CS major for 4 years, at no point did he understand wtf was going on in my codes, and at no point did I understand wtf was going on in his.

-11

u/[deleted] Feb 15 '23

😭😭😭😭😭😭 i love how aerospace breaks my soul and my aim to break down boeing

5

u/[deleted] Feb 15 '23

Here's where you should start, do you understand the Brayton cycle? can you solve this problem on paper without python? If you do not know how to solve the problem on paper, you will not be able to write a code to solve it, you have to tell the computer exactly what to do at every single step. If the answer to both of those questions is yes, you should move on to learning basic python. Start with basic syntax, how to make functions and solve equations. Then move on to libraries, if you are just starting your engineering schooling you should primarily get to know numpy and matplotlib.pyplot as those are going to be your best friends. There is an insane amount of resources online for learning the fundamentals of python. For AERO you will likely benefit greatly from a thermo library like coolprop. You may need pandas or scipy eventually but outside of this you should be good for most all AERO applications.

As an exercise you should work through the entire problem and break it down into the most basic steps you can imagine, and try to only use variables and minimize real numbers (generally called hard-coding). Then when you code that, you will be able to solve any Brayton cycle instead of just this problem.

1

u/[deleted] Feb 15 '23

Thankkkk youuuuuu!!!!!!!!!!