Math question - Formula for Exponential Graph Calculation

  1. 2 months ago

    Steve K

    Oct 3 Melbourne, Australia
    Edited 2 months ago

    I have a known graph:
    -image-
    (Courtesy: Richard Nakka. http://www.nakka-rocketry.net)

    The graph shows pressure (in psi) compared to surface area (Kn). We can disregard MPa on the r/h side.

    My software calculates the Kn (which is shown along the X axis). The Kn determines the pressure.

    What I need to do is to determine the chamber pressure (Y axis) given the calculated Kn. If it was a straight line then I think that I've done something similar before, but this is a curve.

    I've tried to break it down it to segments:

    Select Case Kn
    Case 150 to 200
    Kn = Kn * 3
    End Select

    Ive used the number 3 (ratio?) because 600psi/200Kn = 3. But that doesn't work for the lower end: 150 x 3 = 450 which according to the graph should be 400psi. The ratio number does change over the scale, but what I've done so far is below reasonable, but better than nothing. I don't need it to be perfect either - just somewhere in-between is fine.

    The calculation in the end is about possible over-pressurisation and will give a recommendation. It doesn't need to be perfect but I'd like a bit more accuracy than I have.

    I thought I knew this sort of stuff (maybe once). I think I'm missing something simple, but I've spent a few hours trying to solve this, and I'm really stuck trying to work it out.

    [EDIT] I did look for solutions on the web but I couldn't understand the formulas.

    I don't think this is complicated :

    Public Function CalculatePo(Kn as Double) as Double
      dim result as Double
      
      result = 21.4 + (0.85*Kn) + (0.01197*Kn^2) - (0.00000909*Kn^3)
      
      Return result
    End Function

    this will give you a good approximation of Po depending on Kn

  2. Jean-Yves P

    Oct 3 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 2 months ago

    try

    Po = 21.4 + (0.85*Kn) + (0.01197*Kn^2) - (0.00000909*Kn^3)

    it better fits a polynom than an exponential.

  3. Hello Steve,

    To do this exactly "right" you would have to know the equation that describes the curve.
    That's how physics works. Unfortunately, you don't have the formula

    Now you could construct a table where you enter enough equal-distanced values from the graph,
    to get a reasonable approximation. But to be accurate enough this would be a tedious process.

    So in your case your table would look something like (50, 95), ... (400, 1660) etc.

    You could even use an integer-array for this. Values between the points in the table could then
    be interpolated .

    So if you had (50, 95) and (51, 98) the value at 50.5 would approximated by 96.5 etc.

  4. Steve,

    The website your graph is from provides the formulas for the KNSU propellant as well as several others. See . Would appear pretty straight forward to convert to code.

    Dennis

  5. Alberto D

    Oct 3 Pre-Release Testers, Xojo Pro

    From: https://www.nakka-rocketry.net/design1.html

    Kn Klemmung, Kn=Ab /At (Ratio of Burning surface area (Ab) to the nozzle throat cross-section area (At) )

    but you say Kn is surface area, sorry I don't understand.

  6. Markus W

    Oct 3 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

    @Alberto D;Poo From: https://www.nakka-rocketry.net/design1.html

    but you say Kn is surface area, sorry I don't understand.

    If the same noozzle throat cross-section is being used then that is a constant, and consequently it is proportional to the surface area.

  7. Alberto D

    Oct 3 Pre-Release Testers, Xojo Pro

    If the program can calculate Kn and it has all other values, I don't see a problem to calculate Po.
    There are some tables there but not for KNSU maybe Steve can ask the values.
    At first I thought that Kn were Kilonewton.

  8. Jean-Yves P

    Oct 3 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    @Dennis H Steve,

    The website your graph is from provides the formulas for the KNSU propellant as well as several others. See . Would appear pretty straight forward to convert to code.

    Dennis

    so it is not polynomial as I said, but really exponential.
    -image-
    the graph had so little resolution that it could appear as polynomial like that !

  9. Steve K

    Oct 4 Melbourne, Australia

    C'mon guys, this should be simple. It's not like it's rocket science... hang on... actually yes it is :)

    The calculations refer to solid fuel propellant motors, much like the now defunct space shuttle boosters.

    The Kn value is determined by dividing the current burn surface area by the nozzle area - it's a ratio, and proportional to the surface area as Markus correctly suggested.

    You can have various geometries in the shape of the core of the motor. The space shuttle boosters used a star shape, therefore giving max. thrust at take-off because the surface area of propellant burning was increased - then it leveled out (when the star points were burned, then increased again as the internal diameter increased for the final thrust into space. The design was carefully thought out. Absolutely Amazing!! Cutting corners was it's demise.

    But getting back to what I was asking. The formula posted by Jean-Yves is way beyond my needs and understanding. c* in that calculation requires a lot of "actual" testing. Different propellants have different characteristics.

    Richard Nakka has already done a lot of testing and is well regarded in the field amateur rocketry. I don't need to repeat the tests, I just need to convert my known calculated Kn value into a pressure value so the user has an approx. idea of the pressures involved. It's important to know the pressures involved because that will determine the strength (burst pressure) of the casing required.

    The casing is the structure that surrounds the motor. It has to withstand the pressure. It could be steel, aluminium, cardboard, pvc tube, etc.

    This is important because there a lots of young newbs/dudes out there that watch youtube videos and think that making a rocket motor is like baking a cake (possible poor metaphor). In any case, sometimes the consequences of failure can cause physical injuries, and even be fatal.

    This aspect of my software (if implemented) will allow you to design a rocket motor, calculate the Kn ratio and give approximate pressures involved. Therefore be alerted to a potential issue. More information is better than less.

    I guess I could ask Richard himself for the test data but that may open up a can of worms regarding proprietary information and other legal issues.

    Dunno.

    @ Alberto

    At first I thought that Kn were Kilonewton.

    Well, that would be a big one. Although, I reckon my software would be up to recording the event :)

  10. Jean-Yves P

    Oct 4 Pre-Release Testers, Xojo Pro Answer Europe (France, Besançon)
    Edited 2 months ago

    I don't think this is complicated :

    Public Function CalculatePo(Kn as Double) as Double
      dim result as Double
      
      result = 21.4 + (0.85*Kn) + (0.01197*Kn^2) - (0.00000909*Kn^3)
      
      Return result
    End Function

    this will give you a good approximation of Po depending on Kn

  11. Steve K

    Oct 4 Melbourne, Australia

    Thanks Jean-Yves,

    A good approximation is all I need. I didn't try your previous example because I thought you said it was incorrect.

    Well, it's approaching 11.30pm here, but I'm looking forward to testing your formula tomorrow. A much more interesting proposition than the usual boredom and insanity that tomorrow will bring.

  12. Steve,

    Before Jean-Yves posted, I had done a little work on this. This procedure can be used in many other cases.

    • Take a screen shot of the graph on the web page and save in a graphic format
    • Paste the saved graphic into a website that will do curve digitizing (https://automeris.io/WebPlotDigitizer/ is a good one).
    • Export the digitized points as a csv file and save. In the case the results were (using the psi Y-axis):

    57.6, 94.2
    75.0, 143.0
    92.1, 194.9
    109.7, 254.6
    127.0, 311.3
    144.3, 375.0
    161.7, 444.8
    179.0, 518.1
    196.3, 591.3
    213.7, 666.4
    231.0, 746.7
    248.4, 834.8
    265.7, 923.8
    283.5, 1015.7
    299.6, 1099.2
    319.3, 1204.8
    336.6, 1309.5
    353.5, 1403.5
    371.3, 1512.0
    387.1, 1608.0

    - Paste the csv file into a curve fitting website such as http://www.xuru.org/rt/TOC.asp . and try fitting several models.

    In my case, I used a curve fitting program I own and ran an exponential and 3rd degree polynomial. The polynomial was a better fit with a correlation coefficient of 0.999992. Using the code Jean-Yves posted and the coefficients from the curve fit:

    result = -37.533234 + (1.873185*Kn) + (0.007377*Kn^2) - (0.000003*Kn^3)

    Dennis

  13. Jean-Yves P

    Oct 4 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    @SteveKelepouris A good approximation is all I need. I didn't try your previous example because I thought you said it was incorrect.

    I used the graph you provided, approximating the different points you could get.
    then used a curve fit program to get the coeficcients.
    the program gave better fit with a polynomial than exponential
    after that we got the real formula, and it was an exponential !
    but as you may know, any function can be approximated with a taylor serie, that ressemble to a polynomial function.
    so my approximation is good, even with a polynomial.
    but I let you try my code above...

  14. Julen I

    Oct 5 Europe

    @SteveKelepouris c* in that calculation requires a lot of "actual" testing. Different propellants have different characteristics.

    Then,if I am understanding correctly that for each propellant the shape/position of the curve will be different, and if you want your application to correctly predict the pressure for different popellants, you can't use only one set of constants in that polynomial expression. You will need to fit the experimental data for each propellant.

    Julen

  15. Steve K

    Oct 5 Melbourne, Australia

    Well thanks Jean-Yves, your formula works brilliantly and beyond what I thought was achievable :) Dennis's formula also works and gives pretty much the same results - I really have no idea which is best but I've ended up using the one posted by Jean-Yves.

    Thank you both for doing that all work.

    @Julen I Uriguen Then,if I am understanding correctly that for each propellant the shape/position of the curve will be different, and if you want your application to correctly predict the pressure for different popellants, you can't use only one set of constants in that polynomial expression. You will need to fit the experimental data for each propellant.

    Julen

    That's absolutely correct Julen. It's a big issue that I'm aware of. I've used KNSU as an example because it's the most commonly used propellant for "Sugar Rockets" and the most 'energetic' in that group. But even this so called "standard" mix for KNSU can have many variables.

    So in the end, if this was implemented in my final application, then the best that could be said is that it's a "reasonable approximation" of the propellant KNSU, and if using a less energetic propellant, then the calculated chamber pressure has a safe(er) margin of error.

    Nevertheless, the fact that this problem can be "reverse engineered" in the way it has been done by Jean-Yves and Dennis - well, I really do love that sort of thing.

    The application that I've used this formula with is a FileMaker Application written some ten years ago. It nice to finally see the chamber pressure (shown near mid bottom):

    -image-

    The filemaker application has only been used for my own personal use and never released. It's certainly not sexy, but it serves a purpose.

    However, my current Xojo Application has a different purpose, although still related to rocketry and pyrotechnics. It records the thrust profile of a test motor attached to a test stand. Then shows the performance of the motor.

    -image-

    I could tie in both because they are related, but this is becoming a chronic example of "Scope Creep" as in "what If"... "It would be great to have this feature"... "What if the user wants"... etc... etc... etc...

    I'll put it this way:

    I'm not a software developer trying to create solutions for amateur rocketry/pyrotechnic enthusiasts.
    I'm an amateur rocketry/pyrotechnics enthusiast that enjoys programming, trying to create solutions for my ilk.

    Xojo is a great tool that has allowed me to create this solution and hopefully others into the future. Although I do hope to get some financial reward in the end.

    :)

  16. Julen I

    Oct 5 Europe

    If you are going to let other people use your application, and they will get an estimate of the pressure from it, which can be used to design critical parts of the rockets, and you know that estimate may not be good (thinking about the effect of people using different propellants), I would let the user know the estimate may be off significantly (if that's the case).

    Just in case.

    This looks like a fun project, by the way.

    Julen

  17. Steve,

    In case you are interested in including the chamber pressures from the other propellants on the page, I digitized and curve fit them. The results were:

    KNSB fine-grind
    result = -263.364815 + (9.336753*Kn) - (0.067671*Kn^2) + (0.000244*Kn^3)
    correlation coefficient = 0.998994

    KNSB granular
    result = -13.481586 + (1.101821*Kn) + (0.001619*Kn^2) - (0.000001*Kn^3)
    coefficient of correlation = 0.999997

    KNDX
    result = -805.695628 + (27.906111*Kn) - (0.294536*Kn^2) + (0.001434*Kn^3) - (0.000003*Kn^4)
    correlation coefficient = 0.998449

    KNER granular
    result = -19.268863 + (0.371073*Kn) + (0.001719*Kn^2)
    correlation coefficient = 0.999996

    Dennis

  18. Steve K

    Oct 9 Melbourne, Australia

    Thanks Dennis for doing all that.

    I can't get it all working though, and I'm not sure why. I don't want to seem ungrateful, but now that I see the potential, it's better than just having one propellant (KNSU).

    For a basic test, I'm using a Kn value of 252.78 very close to 250. The data is from previous worked tests.

    KNSB fine gound: 1713.8 (not correct)
    KNSB granular: 352.3 (looks correct)
    KNDX I get: -1658.4 (not correct)
    KNSU I get: 858.9 (looks correct)
    KNER 184.4 (looks correct)

    -image-

    I'm not sure if it's something I've done, or a limitation in FileMaker.

  19. Steve,

    You didn't do anything wrong. I too quickly leapt to the wrong conclusion based on a print out that rounded some coefficients to only 6 decimal places.

    Use the following:

    KNSB fine-grind
    result = -263.364815 + (9.336753*Kn) - (0.067671*Kn^2) + (2.439214*10^-4*Kn^3) - (3.607539*10^-7*Kn^4) + (1.86522*10^-10*Kn^5)

    KNDX
    result = -805.695628 + (27.906111*Kn) - (0.294536*Kn^2) + (1.434205*10^-3*Kn^3) - (3.031777*10^-6*Kn^4) + (2.320255*10^-9*Kn^5)

    Dennis

  20. Robert W

    Oct 9 Western Canada
    Edited 2 months ago

    I strongly advise against trying to use such a high order polynomial to fit so few data points. What you'll find is that the resulting function can and will do a lot of wiggling between your sample data points. It may fit the sampled points more accurately, but it won't fit the intermediate segment nearly as well. To fit such smooth curves as the original graphs, you shouldn't require anything more than a cubic (3rd order) polynomial. Also, do not try to extrapolate outside of the range of the original graph. High order polynomials tend to explode as soon as you get outside the fitted area.

    See Overfitting .

  21. Newer ›

or Sign Up to reply!