473,569 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Solving for the zero of a difficult equation!

1 New Member
Hello all,

Looking for some advice on how to solve for the zeros of a particular variable in the equation below. I am new to Python, coming from MATLAB. I have a conceptual rocket propulsion sizing code from MATLAB that I am transcribing into Python since I am no longer a student and have no access to MATLAB since the license expired.


The equation: 0 = (1/M**2)*(((2/(ga+1))*(1+((ga-1)/2)*M**2))**((ga +1)/(ga-1)))-AR**2
where (just as an example):
ga = 1.147
AR = 45


Better reference here: http://www.joshtheengi neer.com/2016/11/16/solving-the-area-mach-number-relation/



Everything has been defined already except for the Mach number, M. What this step in the code does is just figure out what Mach number is required given the other predetermined parameters. Obviously it is quadratic, so there will be two solutions. One will be between 0 and 1, which would be the subsonic solution while the other is the supersonic solution. The supersonic solution will be anywhere from 1 to 5 ish. I just need assistance on how to have this equation solved for those two values of M, and give me the value that is greater than or equal to 1. I may technically be a rocket scientist, but we did not get enough exposure to complex mathematical coding in my Aerospace Engineering program.

Any help is greatly appreciated!
Apr 3 '21 #1
0 3911

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6044
by: Sven Dzepina | last post by:
Hello people =) Has somebody a nice script, which can solve equations ? It would be super, if someone has an idea where I can get such a script / code in php. Thanks. Gretting!
3
8018
by: greg.smith | last post by:
Hi there, I've been trying to solve this different via numerical methods(C programming) and it's driving me crazy.... I can't post my code because it's simply one big mess and doesn't work. d^2y/dx^2 - 1/(L^2)*y .... where L is just some arbitrary number......L = 0.2045....
5
2900
by: Tiza Naziri | last post by:
Hi, How to represent this matrix equation in C code: / a0 \ / 0 1 0 1 0 0 1 0 \/ b0 \ | a1 | | 0 0 1 0 1 0 0 1 || b1 | | a2 | | 1 0 0 1 0 1 0 0 || b2 | | a3 |=| 0 1 0 0 1 0 1 0 || b3 | | a4 | | 0 0 1 0 0 1 0 1 || b4 | | a5 | | 1 0 0 1 0 0 1 0 || b5 |
2
1446
by: Michael MacDonald | last post by:
I have written a simple program that calculates a running $ total. This program uses a checkbox to acknowledge that that version of the ticket is desired and it checks the Qty box to see how many tickets are desired. Based upon the checkbox being checked and the number of tickets desired directly affects the running grand total (of course!). ...
9
1821
by: TG | last post by:
Hi there. Anyone knows how to use numpy / scipy in order to solve this ? * A is an array of shape (n,) * X is a positive float number * B is an array of shape (n,) * O is an array of shape (n,) containing only zeros. A.X - B = O
6
2305
by: mismis | last post by:
HELP!..PLEASE..i have a project that asks to write a C++ program solving for the root of the equation (x*x*x)-(x*x)-(9x)+(9) ........huhuhu..please help..i really need to pass..please..
1
2988
by: candacefaye1 | last post by:
1. write a C++ program to decide if the coefficients of a quadratic equation have real roots. The three choices will be to write the message “zero divide” when A is zero, write the message “no real roots” if the discriminant is negative and find the two roots when there is no error condition. DO NOT FIND THE ROOT IF THERE IS AN ERROR CONDITION....
2
1409
by: purple | last post by:
Could you guys do me a favor for solving a equation set? Z=d/4*(1-SIN(X)/X) X=8q/(D^2*Y)+SIN(X) Y=1/n*Z^(2/3)*i^(1/2) In this equation set, X,Y&Z are the unkown parameters, the others say, d, q, n&i are known. SO in python, how to program it to represent X, Y and Z in the form of d, q, n and i?
1
1589
by: zufie | last post by:
This is my original equation: =(/)*100 When the denomimator is zero I am unable to calculate the percentage. I tried changing my equation to this format: =IIf( = 0, 0, / ) I also tried:
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.