Tuesday, October 27, 2020

How About a Nice Curve Fit?

I've been meaning to do this for some time. That is developing a Windows based system for fitting equation of state terms to experimental data, rather then relying on other people's fitting routines. One of the more common equations of state (P-v relationship) people like to use in the explosives world is the Jones-Wilkins-Lee (JWL) equation of state. There are others but I won't go into them for now. One form of the JWL equation of state for the products of detonation is given by:



The data to fit to has to be in an Excel file and can be imported directly into the application. The data file needs to be in the form displayed. The pressure units are in GPa.




Partial P-v Input Deck.

The application is used in the following way.  First hit the Get Data Button. That brings up a file navigator. Find your file and double click it or single click then Open. Once the data is loaded you'll see some trial fit parameters. Go ahead and hit Plot Data. Push the JWL Fit button and the curve fitting routine will be engaged. When it's done the fit parameters are displayed and you can inspect the fit with the Plot Fit button.  You can clear the data and the plot with the Clear Data button and enter a new file to fit.

You can save the graph in PNG format by right clicking. The plotting routine I got from nuget.org and is called ScottPlot. It's a pretty good routine. Below is a fit to some old data of mine.


I've added a category to my Google drive for executable files. The debug version is there under JWLForm.exe. A P-v Excel file is also there for trial. As always this is not really a executable that's bulletproof. You will get some exceptions thrown and the program will give up the ghost if you don't use it in the order I've outlined.


No comments:

Post a Comment