Best way to numericallty solve this system of equations

  • Context: Undergrad 
  • Thread starter Thread starter Ax_xiom
  • Start date Start date
Ax_xiom
Messages
67
Reaction score
4
TL;DR
I have a system of equations that I need solving numerically
So I'm working on a project where I am trying to work out what the ideal sizes of rocket stages are and I am using Excel to allow the user to interact with this quickly. The method I am using is derived from this video, and I end up with this system of equations: \begin{align}
1 - c_{1}\lambda + \frac{sN_{1}}{1 - sN_{1}} = 0 \\
1 - c_{2}\lambda + \frac{sN_{2}}{1 - sN_{2}} = 0 \\
c_{1}\ln(N_{1}) + c_{2}\ln(N_{2}) - V_{f} = 0 \end{align}
Where I am trying to solve for ##N_{1}## and ##N_{2}## The number of equations like (1) and (2) can be as many as 5, and the number of ##c_{n}\ln(N_{n})## terms in (3) is also variable. As far as I know, these equations cannot be solved analytically, so they must be solved numerically. Here are the options that I've considered:

  1. Newton's method with the entire system
    • Pros:
      • Easiest to think about conceptually
      • Converges quickly from a reasonable starting point
    • Cons:
      • Hard to implement a variable amount of stages
      • More work to set up
      • Have to consider the order of the columns and rows of the Jacobian
  2. Solve for ##\lambda## and ##N_{n}## after
    • It is possible to show that ## N_{n} = \frac{1-\frac{1}{c_{n}\lambda}}{s}##. Using this, it is possible to substitute these into equation (3) and numerically solve for ##\lambda## before solving for ##N_{n}## using the aforementioned expression.
    • Pros:
      • Less computation
      • Easier to adjust for different amounts of stages
    • Cons:
      • The resulting expression is extremely badly behaved, diverging to ##-\infty## when using Newton-Raphson unless given an extremely close guess
So what method should I use? Have I overlooked any methods that I may be better off using?
 
Physics news on Phys.org
I would try let computer draw three graphs (1)(2)(3) and observe crossing points, if not ask AI the solutions direct.
 
anuttarasammyak said:
I would try let computer draw three graphs (1)(2)(3) and observe crossing points.
A few problems:
  1. I want to implement up to 5 stages, which would result in 6 equations and 6 variables that would need to be graphed which would require a 6D space to visualise
  2. I'm not sure how easy that would be to use or how accurate it would be
  3. Can Excel even draw 3D graphs?
 
There are six kind of alphabets in your equations. 3 equations for 6 unknowns seems desperate. Which are numbers given for numerical calculation and which are parameters for which we would like to get solutions ?
 
anuttarasammyak said:
Which are numbers given for numerical calculation and which are parameters for which we would like to get solutions ?
From skimming through the video referenced by the OP, the known rocket parameters are:
  • ##c_n## is the exhaust velocity of the ##n^\text{th}-##stage rocket motor.
  • ##s_n## is the ##n^\text{th}-##stage structural factor (fraction of the total stage-mass that is not fuel).
  • ##V_f## is the desired final velocity of the last stage.
Unknowns to be solved for:
  • ##N_n## are mass ratios of the various stages. These values ultimately determine the mass of fuel in each stage that's required to achieve the final velocity.
  • ##\lambda## is a Lagrange-multiplier parameter.
But the OP is essentially reinventing the wheel: there's already a nice online calculator that already does what they want: https://space.geometrian.com/calcs/opt-multi-stage.php.
 
  • Like
Likes   Reactions: anuttarasammyak

Similar threads

  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 36 ·
2
Replies
36
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
3K