Ax_xiom
- 69
- 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 - 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:
- 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
- Pros:
- 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