From 3f90b849da4d36c3095efa73fee58d4df3ae00e1 Mon Sep 17 00:00:00 2001 From: Robert Gottlieb Date: Fri, 7 Apr 2023 15:37:31 -0400 Subject: [PATCH] Added example CSV files --- examples/explicit_kinetic_problem.jl | 8 +- examples/implicit_variable_bounds.csv | 1002 +++++++++++++++++++++++ examples/kinetic_intensity_data.csv | 201 +++++ examples/polynomial_pressure_data.csv | 51 ++ examples/polynomial_pressure_problem.jl | 43 +- 5 files changed, 1273 insertions(+), 32 deletions(-) create mode 100644 examples/implicit_variable_bounds.csv create mode 100644 examples/kinetic_intensity_data.csv create mode 100644 examples/polynomial_pressure_data.csv diff --git a/examples/explicit_kinetic_problem.jl b/examples/explicit_kinetic_problem.jl index 3f44aaa..41f3232 100644 --- a/examples/explicit_kinetic_problem.jl +++ b/examples/explicit_kinetic_problem.jl @@ -9,9 +9,13 @@ # Import the necessary packages using EAGO, JuMP, CSV, DataFrames, Symbolics, SourceCodeMcCormick, CUDA, BenchmarkTools +# Import the ParBB algorithm +include(joinpath(@__DIR__, "ParBB", "extension.jl")) +include(joinpath(@__DIR__, "ParBB", "subroutines.jl")) + # Import the kinetic intensity data -data = CSV.read("C:/Users/rxg20001/Documents/Github_Repositories/EAGO-GPU.jl/kinetic_intensity_data.csv", DataFrame) -bounds = CSV.read("C:/Users/rxg20001/Documents/Github_Repositories/EAGO-GPU.jl/implicit_variable_bounds.csv", DataFrame) +data = CSV.read(joinpath(@__DIR__, "kinetic_intensity_data.csv"), DataFrame) +bounds = CSV.read(joinpath(@__DIR__, "implicit_variable_bounds.csv"), DataFrame) # Define the constant terms in the expressions T = 273.0 diff --git a/examples/implicit_variable_bounds.csv b/examples/implicit_variable_bounds.csv new file mode 100644 index 0000000..c2bd71a --- /dev/null +++ b/examples/implicit_variable_bounds.csv @@ -0,0 +1,1002 @@ +species,time,index,lower,upper +A,0.01,1,0,140 +B,0.01,2,0,140 +D,0.01,3,0,140 +Y,0.01,4,0,0.4 +Z,0.01,5,0,140 +A,0.02,6,0,140 +B,0.02,7,0,140 +D,0.02,8,0,140 +Y,0.02,9,0,0.4 +Z,0.02,10,0,140 +A,0.03,11,0,140 +B,0.03,12,0,140 +D,0.03,13,0,140 +Y,0.03,14,0,0.4 +Z,0.03,15,0,140 +A,0.04,16,0,140 +B,0.04,17,0,140 +D,0.04,18,0,140 +Y,0.04,19,0,0.4 +Z,0.04,20,0,140 +A,0.05,21,0,140 +B,0.05,22,0,140 +D,0.05,23,0,140 +Y,0.05,24,0,0.4 +Z,0.05,25,0,140 +A,0.06,26,0,140 +B,0.06,27,0,140 +D,0.06,28,0,140 +Y,0.06,29,0,0.4 +Z,0.06,30,0,140 +A,0.07,31,0,140 +B,0.07,32,0,140 +D,0.07,33,0,140 +Y,0.07,34,0,0.4 +Z,0.07,35,0,140 +A,0.08,36,0,140 +B,0.08,37,0,140 +D,0.08,38,0,140 +Y,0.08,39,0,0.4 +Z,0.08,40,0,140 +A,0.09,41,0,140 +B,0.09,42,0,140 +D,0.09,43,0,140 +Y,0.09,44,0,0.4 +Z,0.09,45,0,140 +A,0.1,46,0,140 +B,0.1,47,0,140 +D,0.1,48,0,140 +Y,0.1,49,0,0.4 +Z,0.1,50,0,140 +A,0.11,51,0,140 +B,0.11,52,0,140 +D,0.11,53,0,140 +Y,0.11,54,0,0.4 +Z,0.11,55,0,140 +A,0.12,56,0,140 +B,0.12,57,0,140 +D,0.12,58,0,140 +Y,0.12,59,0,0.4 +Z,0.12,60,0,140 +A,0.13,61,0,140 +B,0.13,62,0,140 +D,0.13,63,0,140 +Y,0.13,64,0,0.4 +Z,0.13,65,0,140 +A,0.14,66,0,140 +B,0.14,67,0,140 +D,0.14,68,0,140 +Y,0.14,69,0,0.4 +Z,0.14,70,0,140 +A,0.15,71,0,140 +B,0.15,72,0,140 +D,0.15,73,0,140 +Y,0.15,74,0,0.4 +Z,0.15,75,0,140 +A,0.16,76,0,140 +B,0.16,77,0,140 +D,0.16,78,0,140 +Y,0.16,79,0,0.4 +Z,0.16,80,0,140 +A,0.17,81,0,140 +B,0.17,82,0,140 +D,0.17,83,0,140 +Y,0.17,84,0,0.4 +Z,0.17,85,0,140 +A,0.18,86,0,140 +B,0.18,87,0,140 +D,0.18,88,0,140 +Y,0.18,89,0,0.4 +Z,0.18,90,0,140 +A,0.19,91,0,140 +B,0.19,92,0,140 +D,0.19,93,0,140 +Y,0.19,94,0,0.4 +Z,0.19,95,0,140 +A,0.2,96,0,140 +B,0.2,97,0,140 +D,0.2,98,0,140 +Y,0.2,99,0,0.4 +Z,0.2,100,0,140 +A,0.21,101,0,140 +B,0.21,102,0,140 +D,0.21,103,0,140 +Y,0.21,104,0,0.4 +Z,0.21,105,0,140 +A,0.22,106,0,140 +B,0.22,107,0,140 +D,0.22,108,0,140 +Y,0.22,109,0,0.4 +Z,0.22,110,0,140 +A,0.23,111,0,140 +B,0.23,112,0,140 +D,0.23,113,0,140 +Y,0.23,114,0,0.4 +Z,0.23,115,0,140 +A,0.24,116,0,140 +B,0.24,117,0,140 +D,0.24,118,0,140 +Y,0.24,119,0,0.4 +Z,0.24,120,0,140 +A,0.25,121,0,140 +B,0.25,122,0,140 +D,0.25,123,0,140 +Y,0.25,124,0,0.4 +Z,0.25,125,0,140 +A,0.26,126,0,140 +B,0.26,127,0,140 +D,0.26,128,0,140 +Y,0.26,129,0,0.4 +Z,0.26,130,0,140 +A,0.27,131,0,140 +B,0.27,132,0,140 +D,0.27,133,0,140 +Y,0.27,134,0,0.4 +Z,0.27,135,0,140 +A,0.28,136,0,140 +B,0.28,137,0,140 +D,0.28,138,0,140 +Y,0.28,139,0,0.4 +Z,0.28,140,0,140 +A,0.29,141,0,140 +B,0.29,142,0,140 +D,0.29,143,0,140 +Y,0.29,144,0,0.4 +Z,0.29,145,0,140 +A,0.3,146,0,140 +B,0.3,147,0,140 +D,0.3,148,0,140 +Y,0.3,149,0,0.4 +Z,0.3,150,0,140 +A,0.31,151,0,140 +B,0.31,152,0,140 +D,0.31,153,0,140 +Y,0.31,154,0,0.4 +Z,0.31,155,0,140 +A,0.32,156,0,140 +B,0.32,157,0,140 +D,0.32,158,0,140 +Y,0.32,159,0,0.4 +Z,0.32,160,0,140 +A,0.33,161,0,140 +B,0.33,162,0,140 +D,0.33,163,0,140 +Y,0.33,164,0,0.4 +Z,0.33,165,0,140 +A,0.34,166,0,140 +B,0.34,167,0,140 +D,0.34,168,0,140 +Y,0.34,169,0,0.4 +Z,0.34,170,0,140 +A,0.35,171,0,140 +B,0.35,172,0,140 +D,0.35,173,0,140 +Y,0.35,174,0,0.4 +Z,0.35,175,0,140 +A,0.36,176,0,140 +B,0.36,177,0,140 +D,0.36,178,0,140 +Y,0.36,179,0,0.4 +Z,0.36,180,0,140 +A,0.37,181,0,140 +B,0.37,182,0,140 +D,0.37,183,0,140 +Y,0.37,184,0,0.4 +Z,0.37,185,0,140 +A,0.38,186,0,140 +B,0.38,187,0,140 +D,0.38,188,0,140 +Y,0.38,189,0,0.4 +Z,0.38,190,0,140 +A,0.39,191,0,140 +B,0.39,192,0,140 +D,0.39,193,0,140 +Y,0.39,194,0,0.4 +Z,0.39,195,0,140 +A,0.4,196,0,140 +B,0.4,197,0,140 +D,0.4,198,0,140 +Y,0.4,199,0,0.4 +Z,0.4,200,0,140 +A,0.41,201,0,140 +B,0.41,202,0,140 +D,0.41,203,0,140 +Y,0.41,204,0,0.4 +Z,0.41,205,0,140 +A,0.42,206,0,140 +B,0.42,207,0,140 +D,0.42,208,0,140 +Y,0.42,209,0,0.4 +Z,0.42,210,0,140 +A,0.43,211,0,140 +B,0.43,212,0,140 +D,0.43,213,0,140 +Y,0.43,214,0,0.4 +Z,0.43,215,0,140 +A,0.44,216,0,140 +B,0.44,217,0,140 +D,0.44,218,0,140 +Y,0.44,219,0,0.4 +Z,0.44,220,0,140 +A,0.45,221,0,140 +B,0.45,222,0,140 +D,0.45,223,0,140 +Y,0.45,224,0,0.4 +Z,0.45,225,0,140 +A,0.46,226,0,140 +B,0.46,227,0,140 +D,0.46,228,0,140 +Y,0.46,229,0,0.4 +Z,0.46,230,0,140 +A,0.47,231,0,140 +B,0.47,232,0,140 +D,0.47,233,0,140 +Y,0.47,234,0,0.4 +Z,0.47,235,0,140 +A,0.48,236,0,140 +B,0.48,237,0,140 +D,0.48,238,0,140 +Y,0.48,239,0,0.4 +Z,0.48,240,0,140 +A,0.49,241,0,140 +B,0.49,242,0,140 +D,0.49,243,0,140 +Y,0.49,244,0,0.4 +Z,0.49,245,0,140 +A,0.5,246,0,140 +B,0.5,247,0,140 +D,0.5,248,0,140 +Y,0.5,249,0,0.4 +Z,0.5,250,0,140 +A,0.51,251,0,140 +B,0.51,252,0,140 +D,0.51,253,0,140 +Y,0.51,254,0,0.4 +Z,0.51,255,0,140 +A,0.52,256,0,140 +B,0.52,257,0,140 +D,0.52,258,0,140 +Y,0.52,259,0,0.4 +Z,0.52,260,0,140 +A,0.53,261,0,140 +B,0.53,262,0,140 +D,0.53,263,0,140 +Y,0.53,264,0,0.4 +Z,0.53,265,0,140 +A,0.54,266,0,140 +B,0.54,267,0,140 +D,0.54,268,0,140 +Y,0.54,269,0,0.4 +Z,0.54,270,0,140 +A,0.55,271,0,140 +B,0.55,272,0,140 +D,0.55,273,0,140 +Y,0.55,274,0,0.4 +Z,0.55,275,0,140 +A,0.56,276,0,140 +B,0.56,277,0,140 +D,0.56,278,0,140 +Y,0.56,279,0,0.4 +Z,0.56,280,0,140 +A,0.57,281,0,140 +B,0.57,282,0,140 +D,0.57,283,0,140 +Y,0.57,284,0,0.4 +Z,0.57,285,0,140 +A,0.58,286,0,140 +B,0.58,287,0,140 +D,0.58,288,0,140 +Y,0.58,289,0,0.4 +Z,0.58,290,0,140 +A,0.59,291,0,140 +B,0.59,292,0,140 +D,0.59,293,0,140 +Y,0.59,294,0,0.4 +Z,0.59,295,0,140 +A,0.6,296,0,140 +B,0.6,297,0,140 +D,0.6,298,0,140 +Y,0.6,299,0,0.4 +Z,0.6,300,0,140 +A,0.61,301,0,140 +B,0.61,302,0,140 +D,0.61,303,0,140 +Y,0.61,304,0,0.4 +Z,0.61,305,0,140 +A,0.62,306,0,140 +B,0.62,307,0,140 +D,0.62,308,0,140 +Y,0.62,309,0,0.4 +Z,0.62,310,0,140 +A,0.63,311,0,140 +B,0.63,312,0,140 +D,0.63,313,0,140 +Y,0.63,314,0,0.4 +Z,0.63,315,0,140 +A,0.64,316,0,140 +B,0.64,317,0,140 +D,0.64,318,0,140 +Y,0.64,319,0,0.4 +Z,0.64,320,0,140 +A,0.65,321,0,140 +B,0.65,322,0,140 +D,0.65,323,0,140 +Y,0.65,324,0,0.4 +Z,0.65,325,0,140 +A,0.66,326,0,140 +B,0.66,327,0,140 +D,0.66,328,0,140 +Y,0.66,329,0,0.4 +Z,0.66,330,0,140 +A,0.67,331,0,140 +B,0.67,332,0,140 +D,0.67,333,0,140 +Y,0.67,334,0,0.4 +Z,0.67,335,0,140 +A,0.68,336,0,140 +B,0.68,337,0,140 +D,0.68,338,0,140 +Y,0.68,339,0,0.4 +Z,0.68,340,0,140 +A,0.69,341,0,140 +B,0.69,342,0,140 +D,0.69,343,0,140 +Y,0.69,344,0,0.4 +Z,0.69,345,0,140 +A,0.7,346,0,140 +B,0.7,347,0,140 +D,0.7,348,0,140 +Y,0.7,349,0,0.4 +Z,0.7,350,0,140 +A,0.71,351,0,140 +B,0.71,352,0,140 +D,0.71,353,0,140 +Y,0.71,354,0,0.4 +Z,0.71,355,0,140 +A,0.72,356,0,140 +B,0.72,357,0,140 +D,0.72,358,0,140 +Y,0.72,359,0,0.4 +Z,0.72,360,0,140 +A,0.73,361,0,140 +B,0.73,362,0,140 +D,0.73,363,0,140 +Y,0.73,364,0,0.4 +Z,0.73,365,0,140 +A,0.74,366,0,140 +B,0.74,367,0,140 +D,0.74,368,0,140 +Y,0.74,369,0,0.4 +Z,0.74,370,0,140 +A,0.75,371,0,140 +B,0.75,372,0,140 +D,0.75,373,0,140 +Y,0.75,374,0,0.4 +Z,0.75,375,0,140 +A,0.76,376,0,140 +B,0.76,377,0,140 +D,0.76,378,0,140 +Y,0.76,379,0,0.4 +Z,0.76,380,0,140 +A,0.77,381,0,140 +B,0.77,382,0,140 +D,0.77,383,0,140 +Y,0.77,384,0,0.4 +Z,0.77,385,0,140 +A,0.78,386,0,140 +B,0.78,387,0,140 +D,0.78,388,0,140 +Y,0.78,389,0,0.4 +Z,0.78,390,0,140 +A,0.79,391,0,140 +B,0.79,392,0,140 +D,0.79,393,0,140 +Y,0.79,394,0,0.4 +Z,0.79,395,0,140 +A,0.8,396,0,140 +B,0.8,397,0,140 +D,0.8,398,0,140 +Y,0.8,399,0,0.4 +Z,0.8,400,0,140 +A,0.81,401,0,140 +B,0.81,402,0,140 +D,0.81,403,0,140 +Y,0.81,404,0,0.4 +Z,0.81,405,0,140 +A,0.82,406,0,140 +B,0.82,407,0,140 +D,0.82,408,0,140 +Y,0.82,409,0,0.4 +Z,0.82,410,0,140 +A,0.83,411,0,140 +B,0.83,412,0,140 +D,0.83,413,0,140 +Y,0.83,414,0,0.4 +Z,0.83,415,0,140 +A,0.84,416,0,140 +B,0.84,417,0,140 +D,0.84,418,0,140 +Y,0.84,419,0,0.4 +Z,0.84,420,0,140 +A,0.85,421,0,140 +B,0.85,422,0,140 +D,0.85,423,0,140 +Y,0.85,424,0,0.4 +Z,0.85,425,0,140 +A,0.86,426,0,140 +B,0.86,427,0,140 +D,0.86,428,0,140 +Y,0.86,429,0,0.4 +Z,0.86,430,0,140 +A,0.87,431,0,140 +B,0.87,432,0,140 +D,0.87,433,0,140 +Y,0.87,434,0,0.4 +Z,0.87,435,0,140 +A,0.88,436,0,140 +B,0.88,437,0,140 +D,0.88,438,0,140 +Y,0.88,439,0,0.4 +Z,0.88,440,0,140 +A,0.89,441,0,140 +B,0.89,442,0,140 +D,0.89,443,0,140 +Y,0.89,444,0,0.4 +Z,0.89,445,0,140 +A,0.9,446,0,140 +B,0.9,447,0,140 +D,0.9,448,0,140 +Y,0.9,449,0,0.4 +Z,0.9,450,0,140 +A,0.91,451,0,140 +B,0.91,452,0,140 +D,0.91,453,0,140 +Y,0.91,454,0,0.4 +Z,0.91,455,0,140 +A,0.92,456,0,140 +B,0.92,457,0,140 +D,0.92,458,0,140 +Y,0.92,459,0,0.4 +Z,0.92,460,0,140 +A,0.93,461,0,140 +B,0.93,462,0,140 +D,0.93,463,0,140 +Y,0.93,464,0,0.4 +Z,0.93,465,0,140 +A,0.94,466,0,140 +B,0.94,467,0,140 +D,0.94,468,0,140 +Y,0.94,469,0,0.4 +Z,0.94,470,0,140 +A,0.95,471,0,140 +B,0.95,472,0,140 +D,0.95,473,0,140 +Y,0.95,474,0,0.4 +Z,0.95,475,0,140 +A,0.96,476,0,140 +B,0.96,477,0,140 +D,0.96,478,0,140 +Y,0.96,479,0,0.4 +Z,0.96,480,0,140 +A,0.97,481,0,140 +B,0.97,482,0,140 +D,0.97,483,0,140 +Y,0.97,484,0,0.4 +Z,0.97,485,0,140 +A,0.98,486,0,140 +B,0.98,487,0,140 +D,0.98,488,0,140 +Y,0.98,489,0,0.4 +Z,0.98,490,0,140 +A,0.99,491,0,140 +B,0.99,492,0,140 +D,0.99,493,0,140 +Y,0.99,494,0,0.4 +Z,0.99,495,0,140 +A,1,496,0,140 +B,1,497,0,140 +D,1,498,0,140 +Y,1,499,0,0.4 +Z,1,500,0,140 +A,1.01,501,0,140 +B,1.01,502,0,140 +D,1.01,503,0,140 +Y,1.01,504,0,0.4 +Z,1.01,505,0,140 +A,1.02,506,0,140 +B,1.02,507,0,140 +D,1.02,508,0,140 +Y,1.02,509,0,0.4 +Z,1.02,510,0,140 +A,1.03,511,0,140 +B,1.03,512,0,140 +D,1.03,513,0,140 +Y,1.03,514,0,0.4 +Z,1.03,515,0,140 +A,1.04,516,0,140 +B,1.04,517,0,140 +D,1.04,518,0,140 +Y,1.04,519,0,0.4 +Z,1.04,520,0,140 +A,1.05,521,0,140 +B,1.05,522,0,140 +D,1.05,523,0,140 +Y,1.05,524,0,0.4 +Z,1.05,525,0,140 +A,1.06,526,0,140 +B,1.06,527,0,140 +D,1.06,528,0,140 +Y,1.06,529,0,0.4 +Z,1.06,530,0,140 +A,1.07,531,0,140 +B,1.07,532,0,140 +D,1.07,533,0,140 +Y,1.07,534,0,0.4 +Z,1.07,535,0,140 +A,1.08,536,0,140 +B,1.08,537,0,140 +D,1.08,538,0,140 +Y,1.08,539,0,0.4 +Z,1.08,540,0,140 +A,1.09,541,0,140 +B,1.09,542,0,140 +D,1.09,543,0,140 +Y,1.09,544,0,0.4 +Z,1.09,545,0,140 +A,1.1,546,0,140 +B,1.1,547,0,140 +D,1.1,548,0,140 +Y,1.1,549,0,0.4 +Z,1.1,550,0,140 +A,1.11,551,0,140 +B,1.11,552,0,140 +D,1.11,553,0,140 +Y,1.11,554,0,0.4 +Z,1.11,555,0,140 +A,1.12,556,0,140 +B,1.12,557,0,140 +D,1.12,558,0,140 +Y,1.12,559,0,0.4 +Z,1.12,560,0,140 +A,1.13,561,0,140 +B,1.13,562,0,140 +D,1.13,563,0,140 +Y,1.13,564,0,0.4 +Z,1.13,565,0,140 +A,1.14,566,0,140 +B,1.14,567,0,140 +D,1.14,568,0,140 +Y,1.14,569,0,0.4 +Z,1.14,570,0,140 +A,1.15,571,0,140 +B,1.15,572,0,140 +D,1.15,573,0,140 +Y,1.15,574,0,0.4 +Z,1.15,575,0,140 +A,1.16,576,0,140 +B,1.16,577,0,140 +D,1.16,578,0,140 +Y,1.16,579,0,0.4 +Z,1.16,580,0,140 +A,1.17,581,0,140 +B,1.17,582,0,140 +D,1.17,583,0,140 +Y,1.17,584,0,0.4 +Z,1.17,585,0,140 +A,1.18,586,0,140 +B,1.18,587,0,140 +D,1.18,588,0,140 +Y,1.18,589,0,0.4 +Z,1.18,590,0,140 +A,1.19,591,0,140 +B,1.19,592,0,140 +D,1.19,593,0,140 +Y,1.19,594,0,0.4 +Z,1.19,595,0,140 +A,1.2,596,0,140 +B,1.2,597,0,140 +D,1.2,598,0,140 +Y,1.2,599,0,0.4 +Z,1.2,600,0,140 +A,1.21,601,0,140 +B,1.21,602,0,140 +D,1.21,603,0,140 +Y,1.21,604,0,0.4 +Z,1.21,605,0,140 +A,1.22,606,0,140 +B,1.22,607,0,140 +D,1.22,608,0,140 +Y,1.22,609,0,0.4 +Z,1.22,610,0,140 +A,1.23,611,0,140 +B,1.23,612,0,140 +D,1.23,613,0,140 +Y,1.23,614,0,0.4 +Z,1.23,615,0,140 +A,1.24,616,0,140 +B,1.24,617,0,140 +D,1.24,618,0,140 +Y,1.24,619,0,0.4 +Z,1.24,620,0,140 +A,1.25,621,0,140 +B,1.25,622,0,140 +D,1.25,623,0,140 +Y,1.25,624,0,0.4 +Z,1.25,625,0,140 +A,1.26,626,0,140 +B,1.26,627,0,140 +D,1.26,628,0,140 +Y,1.26,629,0,0.4 +Z,1.26,630,0,140 +A,1.27,631,0,140 +B,1.27,632,0,140 +D,1.27,633,0,140 +Y,1.27,634,0,0.4 +Z,1.27,635,0,140 +A,1.28,636,0,140 +B,1.28,637,0,140 +D,1.28,638,0,140 +Y,1.28,639,0,0.4 +Z,1.28,640,0,140 +A,1.29,641,0,140 +B,1.29,642,0,140 +D,1.29,643,0,140 +Y,1.29,644,0,0.4 +Z,1.29,645,0,140 +A,1.3,646,0,140 +B,1.3,647,0,140 +D,1.3,648,0,140 +Y,1.3,649,0,0.4 +Z,1.3,650,0,140 +A,1.31,651,0,140 +B,1.31,652,0,140 +D,1.31,653,0,140 +Y,1.31,654,0,0.4 +Z,1.31,655,0,140 +A,1.32,656,0,140 +B,1.32,657,0,140 +D,1.32,658,0,140 +Y,1.32,659,0,0.4 +Z,1.32,660,0,140 +A,1.33,661,0,140 +B,1.33,662,0,140 +D,1.33,663,0,140 +Y,1.33,664,0,0.4 +Z,1.33,665,0,140 +A,1.34,666,0,140 +B,1.34,667,0,140 +D,1.34,668,0,140 +Y,1.34,669,0,0.4 +Z,1.34,670,0,140 +A,1.35,671,0,140 +B,1.35,672,0,140 +D,1.35,673,0,140 +Y,1.35,674,0,0.4 +Z,1.35,675,0,140 +A,1.36,676,0,140 +B,1.36,677,0,140 +D,1.36,678,0,140 +Y,1.36,679,0,0.4 +Z,1.36,680,0,140 +A,1.37,681,0,140 +B,1.37,682,0,140 +D,1.37,683,0,140 +Y,1.37,684,0,0.4 +Z,1.37,685,0,140 +A,1.38,686,0,140 +B,1.38,687,0,140 +D,1.38,688,0,140 +Y,1.38,689,0,0.4 +Z,1.38,690,0,140 +A,1.39,691,0,140 +B,1.39,692,0,140 +D,1.39,693,0,140 +Y,1.39,694,0,0.4 +Z,1.39,695,0,140 +A,1.4,696,0,140 +B,1.4,697,0,140 +D,1.4,698,0,140 +Y,1.4,699,0,0.4 +Z,1.4,700,0,140 +A,1.41,701,0,140 +B,1.41,702,0,140 +D,1.41,703,0,140 +Y,1.41,704,0,0.4 +Z,1.41,705,0,140 +A,1.42,706,0,140 +B,1.42,707,0,140 +D,1.42,708,0,140 +Y,1.42,709,0,0.4 +Z,1.42,710,0,140 +A,1.43,711,0,140 +B,1.43,712,0,140 +D,1.43,713,0,140 +Y,1.43,714,0,0.4 +Z,1.43,715,0,140 +A,1.44,716,0,140 +B,1.44,717,0,140 +D,1.44,718,0,140 +Y,1.44,719,0,0.4 +Z,1.44,720,0,140 +A,1.45,721,0,140 +B,1.45,722,0,140 +D,1.45,723,0,140 +Y,1.45,724,0,0.4 +Z,1.45,725,0,140 +A,1.46,726,0,140 +B,1.46,727,0,140 +D,1.46,728,0,140 +Y,1.46,729,0,0.4 +Z,1.46,730,0,140 +A,1.47,731,0,140 +B,1.47,732,0,140 +D,1.47,733,0,140 +Y,1.47,734,0,0.4 +Z,1.47,735,0,140 +A,1.48,736,0,140 +B,1.48,737,0,140 +D,1.48,738,0,140 +Y,1.48,739,0,0.4 +Z,1.48,740,0,140 +A,1.49,741,0,140 +B,1.49,742,0,140 +D,1.49,743,0,140 +Y,1.49,744,0,0.4 +Z,1.49,745,0,140 +A,1.5,746,0,140 +B,1.5,747,0,140 +D,1.5,748,0,140 +Y,1.5,749,0,0.4 +Z,1.5,750,0,140 +A,1.51,751,0,140 +B,1.51,752,0,140 +D,1.51,753,0,140 +Y,1.51,754,0,0.4 +Z,1.51,755,0,140 +A,1.52,756,0,140 +B,1.52,757,0,140 +D,1.52,758,0,140 +Y,1.52,759,0,0.4 +Z,1.52,760,0,140 +A,1.53,761,0,140 +B,1.53,762,0,140 +D,1.53,763,0,140 +Y,1.53,764,0,0.4 +Z,1.53,765,0,140 +A,1.54,766,0,140 +B,1.54,767,0,140 +D,1.54,768,0,140 +Y,1.54,769,0,0.4 +Z,1.54,770,0,140 +A,1.55,771,0,140 +B,1.55,772,0,140 +D,1.55,773,0,140 +Y,1.55,774,0,0.4 +Z,1.55,775,0,140 +A,1.56,776,0,140 +B,1.56,777,0,140 +D,1.56,778,0,140 +Y,1.56,779,0,0.4 +Z,1.56,780,0,140 +A,1.57,781,0,140 +B,1.57,782,0,140 +D,1.57,783,0,140 +Y,1.57,784,0,0.4 +Z,1.57,785,0,140 +A,1.58,786,0,140 +B,1.58,787,0,140 +D,1.58,788,0,140 +Y,1.58,789,0,0.4 +Z,1.58,790,0,140 +A,1.59,791,0,140 +B,1.59,792,0,140 +D,1.59,793,0,140 +Y,1.59,794,0,0.4 +Z,1.59,795,0,140 +A,1.6,796,0,140 +B,1.6,797,0,140 +D,1.6,798,0,140 +Y,1.6,799,0,0.4 +Z,1.6,800,0,140 +A,1.61,801,0,140 +B,1.61,802,0,140 +D,1.61,803,0,140 +Y,1.61,804,0,0.4 +Z,1.61,805,0,140 +A,1.62,806,0,140 +B,1.62,807,0,140 +D,1.62,808,0,140 +Y,1.62,809,0,0.4 +Z,1.62,810,0,140 +A,1.63,811,0,140 +B,1.63,812,0,140 +D,1.63,813,0,140 +Y,1.63,814,0,0.4 +Z,1.63,815,0,140 +A,1.64,816,0,140 +B,1.64,817,0,140 +D,1.64,818,0,140 +Y,1.64,819,0,0.4 +Z,1.64,820,0,140 +A,1.65,821,0,140 +B,1.65,822,0,140 +D,1.65,823,0,140 +Y,1.65,824,0,0.4 +Z,1.65,825,0,140 +A,1.66,826,0,140 +B,1.66,827,0,140 +D,1.66,828,0,140 +Y,1.66,829,0,0.4 +Z,1.66,830,0,140 +A,1.67,831,0,140 +B,1.67,832,0,140 +D,1.67,833,0,140 +Y,1.67,834,0,0.4 +Z,1.67,835,0,140 +A,1.68,836,0,140 +B,1.68,837,0,140 +D,1.68,838,0,140 +Y,1.68,839,0,0.4 +Z,1.68,840,0,140 +A,1.69,841,0,140 +B,1.69,842,0,140 +D,1.69,843,0,140 +Y,1.69,844,0,0.4 +Z,1.69,845,0,140 +A,1.7,846,0,140 +B,1.7,847,0,140 +D,1.7,848,0,140 +Y,1.7,849,0,0.4 +Z,1.7,850,0,140 +A,1.71,851,0,140 +B,1.71,852,0,140 +D,1.71,853,0,140 +Y,1.71,854,0,0.4 +Z,1.71,855,0,140 +A,1.72,856,0,140 +B,1.72,857,0,140 +D,1.72,858,0,140 +Y,1.72,859,0,0.4 +Z,1.72,860,0,140 +A,1.73,861,0,140 +B,1.73,862,0,140 +D,1.73,863,0,140 +Y,1.73,864,0,0.4 +Z,1.73,865,0,140 +A,1.74,866,0,140 +B,1.74,867,0,140 +D,1.74,868,0,140 +Y,1.74,869,0,0.4 +Z,1.74,870,0,140 +A,1.75,871,0,140 +B,1.75,872,0,140 +D,1.75,873,0,140 +Y,1.75,874,0,0.4 +Z,1.75,875,0,140 +A,1.76,876,0,140 +B,1.76,877,0,140 +D,1.76,878,0,140 +Y,1.76,879,0,0.4 +Z,1.76,880,0,140 +A,1.77,881,0,140 +B,1.77,882,0,140 +D,1.77,883,0,140 +Y,1.77,884,0,0.4 +Z,1.77,885,0,140 +A,1.78,886,0,140 +B,1.78,887,0,140 +D,1.78,888,0,140 +Y,1.78,889,0,0.4 +Z,1.78,890,0,140 +A,1.79,891,0,140 +B,1.79,892,0,140 +D,1.79,893,0,140 +Y,1.79,894,0,0.4 +Z,1.79,895,0,140 +A,1.8,896,0,140 +B,1.8,897,0,140 +D,1.8,898,0,140 +Y,1.8,899,0,0.4 +Z,1.8,900,0,140 +A,1.81,901,0,140 +B,1.81,902,0,140 +D,1.81,903,0,140 +Y,1.81,904,0,0.4 +Z,1.81,905,0,140 +A,1.82,906,0,140 +B,1.82,907,0,140 +D,1.82,908,0,140 +Y,1.82,909,0,0.4 +Z,1.82,910,0,140 +A,1.83,911,0,140 +B,1.83,912,0,140 +D,1.83,913,0,140 +Y,1.83,914,0,0.4 +Z,1.83,915,0,140 +A,1.84,916,0,140 +B,1.84,917,0,140 +D,1.84,918,0,140 +Y,1.84,919,0,0.4 +Z,1.84,920,0,140 +A,1.85,921,0,140 +B,1.85,922,0,140 +D,1.85,923,0,140 +Y,1.85,924,0,0.4 +Z,1.85,925,0,140 +A,1.86,926,0,140 +B,1.86,927,0,140 +D,1.86,928,0,140 +Y,1.86,929,0,0.4 +Z,1.86,930,0,140 +A,1.87,931,0,140 +B,1.87,932,0,140 +D,1.87,933,0,140 +Y,1.87,934,0,0.4 +Z,1.87,935,0,140 +A,1.88,936,0,140 +B,1.88,937,0,140 +D,1.88,938,0,140 +Y,1.88,939,0,0.4 +Z,1.88,940,0,140 +A,1.89,941,0,140 +B,1.89,942,0,140 +D,1.89,943,0,140 +Y,1.89,944,0,0.4 +Z,1.89,945,0,140 +A,1.9,946,0,140 +B,1.9,947,0,140 +D,1.9,948,0,140 +Y,1.9,949,0,0.4 +Z,1.9,950,0,140 +A,1.91,951,0,140 +B,1.91,952,0,140 +D,1.91,953,0,140 +Y,1.91,954,0,0.4 +Z,1.91,955,0,140 +A,1.92,956,0,140 +B,1.92,957,0,140 +D,1.92,958,0,140 +Y,1.92,959,0,0.4 +Z,1.92,960,0,140 +A,1.93,961,0,140 +B,1.93,962,0,140 +D,1.93,963,0,140 +Y,1.93,964,0,0.4 +Z,1.93,965,0,140 +A,1.94,966,0,140 +B,1.94,967,0,140 +D,1.94,968,0,140 +Y,1.94,969,0,0.4 +Z,1.94,970,0,140 +A,1.95,971,0,140 +B,1.95,972,0,140 +D,1.95,973,0,140 +Y,1.95,974,0,0.4 +Z,1.95,975,0,140 +A,1.96,976,0,140 +B,1.96,977,0,140 +D,1.96,978,0,140 +Y,1.96,979,0,0.4 +Z,1.96,980,0,140 +A,1.97,981,0,140 +B,1.97,982,0,140 +D,1.97,983,0,140 +Y,1.97,984,0,0.4 +Z,1.97,985,0,140 +A,1.98,986,0,140 +B,1.98,987,0,140 +D,1.98,988,0,140 +Y,1.98,989,0,0.4 +Z,1.98,990,0,140 +A,1.99,991,0,140 +B,1.99,992,0,140 +D,1.99,993,0,140 +Y,1.99,994,0,0.4 +Z,1.99,995,0,140 +A,2,996,0,140 +B,2,997,0,140 +D,2,998,0,140 +Y,2,999,0,0.4 +Z,2,1000,0,140 +,,,, diff --git a/examples/kinetic_intensity_data.csv b/examples/kinetic_intensity_data.csv new file mode 100644 index 0000000..fd56fb5 --- /dev/null +++ b/examples/kinetic_intensity_data.csv @@ -0,0 +1,201 @@ +time,intensity +0.01,66.0952 +0.02,104.762 +0.03,110.333 +0.04,114.905 +0.05,122.238 +0.06,125.429 +0.07,125.429 +0.08,123.476 +0.09,121.286 +0.1,118.857 +0.11,117.667 +0.12,116.143 +0.13,113.857 +0.14,111.571 +0.15,108.81 +0.16,105.952 +0.17,104.048 +0.18,102.048 +0.19,100.143 +0.2,98.5238 +0.21,96.2381 +0.22,94.381 +0.23,91.6667 +0.24,89.5714 +0.25,87.1429 +0.26,84.8571 +0.27,83.4286 +0.28,81.1905 +0.29,78.9048 +0.3,77.0476 +0.31,75.4762 +0.32,73.4762 +0.33,71.8095 +0.34,70.6667 +0.35,68.381 +0.36,67.3333 +0.37,65.0952 +0.38,63.7143 +0.39,62.0476 +0.4,60.8571 +0.41,59.619 +0.42,58.2857 +0.43,57.4762 +0.44,56.4762 +0.45,55.8095 +0.46,54.5238 +0.47,53 +0.48,51.8571 +0.49,50.4286 +0.5,49.381 +0.51,47.9524 +0.52,47.3714 +0.53,46.8952 +0.54,46.4857 +0.55,45.9048 +0.56,45.0762 +0.57,44.3238 +0.58,43.4143 +0.59,43.5429 +0.6,42.3619 +0.61,41.8381 +0.62,40.2381 +0.63,39.1286 +0.64,38.7857 +0.65,37.081 +0.66,36.9524 +0.67,36.581 +0.68,36.281 +0.69,35.3476 +0.7,34.8905 +0.71,34.1667 +0.72,33.6714 +0.73,32.9667 +0.74,31.8429 +0.75,31.5429 +0.76,31.1476 +0.77,30.9905 +0.78,29.9571 +0.79,29.1333 +0.8,28.7857 +0.81,28.4429 +0.82,28.3476 +0.83,27.5429 +0.84,27.4333 +0.85,27.6048 +0.86,27.1762 +0.87,27.2 +0.88,26.4333 +0.89,25.7619 +0.9,24.8095 +0.91,24.7429 +0.92,24.2857 +0.93,24.1714 +0.94,23.5667 +0.95,23.5476 +0.96,23.3952 +0.97,22.919 +0.98,22.3095 +0.99,21.8048 +1,21.2857 +1.01,21.2048 +1.02,20.8429 +1.03,20.4429 +1.04,20.0048 +1.05,19.9381 +1.06,19.5 +1.07,19.8667 +1.08,18.9333 +1.09,19.1381 +1.1,18.9619 +1.11,18.5476 +1.12,17.9048 +1.13,17.7571 +1.14,18.5333 +1.15,18.3762 +1.16,18.3571 +1.17,18.3286 +1.18,18.2762 +1.19,18.3952 +1.2,17.5952 +1.21,18.1524 +1.22,18.1952 +1.23,17.8476 +1.24,17.9095 +1.25,17.5048 +1.26,17.5 +1.27,15.9619 +1.28,16.2095 +1.29,16.181 +1.3,15.6952 +1.31,15.7095 +1.32,15.4619 +1.33,15.9476 +1.34,16 +1.35,16.1952 +1.36,16.1143 +1.37,15.7429 +1.38,15.5762 +1.39,15.7048 +1.4,15.8095 +1.41,15.6667 +1.42,14.9048 +1.43,14.5857 +1.44,14.7524 +1.45,14.7571 +1.46,14.9762 +1.47,14.5333 +1.48,14.5524 +1.49,14.0143 +1.5,13.6286 +1.51,13.4429 +1.52,13.4667 +1.53,13.319 +1.54,12.9333 +1.55,13.1238 +1.56,12.7476 +1.57,12.9333 +1.58,13.0714 +1.59,13.0714 +1.6,12.7619 +1.61,12.4238 +1.62,12.5143 +1.63,12.9143 +1.64,12.5714 +1.65,13.3667 +1.66,13.2286 +1.67,13.7905 +1.68,13.7571 +1.69,13.5905 +1.7,12.9667 +1.71,12.981 +1.72,12.8857 +1.73,12.919 +1.74,13.0143 +1.75,13.0095 +1.76,12.3857 +1.77,12.5571 +1.78,12.3429 +1.79,12.7571 +1.8,12.681 +1.81,12.5429 +1.82,12.1857 +1.83,12.7905 +1.84,12.5571 +1.85,12.8429 +1.86,12.5476 +1.87,12.5714 +1.88,12.3762 +1.89,11.9952 +1.9,11.4571 +1.91,11.3 +1.92,11.1524 +1.93,11.681 +1.94,11.619 +1.95,11.9048 +1.96,12 +1.97,12.0762 +1.98,11.9143 +1.99,11.7619 +2,11.5333 diff --git a/examples/polynomial_pressure_data.csv b/examples/polynomial_pressure_data.csv new file mode 100644 index 0000000..01d594e --- /dev/null +++ b/examples/polynomial_pressure_data.csv @@ -0,0 +1,51 @@ +pressure,w,T +12.38,0.4992,333.15 +10.1,0.5991,333.15 +6.31,0.6997,333.15 +28.33,0.4994,353.15 +24.17,0.6,353.15 +18,0.7,353.15 +12.38,0.7493,353.15 +60.13,0.4997,373.15 +48.49,0.6006,373.15 +36.46,0.7003,373.15 +26.54,0.7495,373.15 +20.32,0.8,373.15 +13.61,0.8503,373.15 +118.57,0.5004,393.15 +92.9,0.6015,393.15 +70.48,0.7008,393.15 +53.49,0.75,393.15 +40.23,0.8004,393.15 +27.84,0.8506,393.15 +215.95,0.5014,413.15 +179.25,0.6033,413.15 +126.59,0.7017,413.15 +100.39,0.7508,413.15 +78.16,0.8011,413.15 +52.82,0.8511,413.15 +33.67,0.8998,413.15 +377.13,0.503,433.15 +292.92,0.6054,433.15 +220.38,0.7031,433.15 +175.32,0.752,433.15 +140.91,0.8022,433.15 +93.25,0.8519,433.15 +59.32,0.9003,433.15 +38.36,0.9501,433.15 +596.57,0.505,453.15 +496.87,0.6092,453.15 +361.58,0.7051,453.15 +288.22,0.7537,453.15 +229.18,0.8036,453.15 +159.01,0.8531,453.15 +101.2,0.9011,453.15 +63.43,0.9506,453.15 +920.02,0.5079,473.15 +789.6,0.6145,473.15 +564.39,0.7078,473.15 +451.19,0.756,473.15 +357.82,0.8056,473.15 +249.55,0.8547,473.15 +162.51,0.9022,473.15 +99.24,0.9512,473.15 diff --git a/examples/polynomial_pressure_problem.jl b/examples/polynomial_pressure_problem.jl index 4505042..8888d4b 100644 --- a/examples/polynomial_pressure_problem.jl +++ b/examples/polynomial_pressure_problem.jl @@ -12,6 +12,9 @@ using Symbolics, SourceCodeMcCormick, CUDA include(joinpath(@__DIR__, "ParBB", "extension.jl")) include(joinpath(@__DIR__, "ParBB", "subroutines.jl")) +# Import the pressure data for the polynomial equation +pressure_data = CSV.read(joinpath(@__DIR__, "polynomial_pressure_data.csv"), DataFrame) + # Adjust CUDA settings to make sure no scalar calculations occur CUDA.allowscalar(false) @@ -28,21 +31,11 @@ Symbolics.@variables calc, data SSE_cv, _ = convex_evaluator(((calc - data)/data)^2) # Set up the GPU-compatible L2norm calculation -function L2norm(p...) - pset = [12.38, 10.10, 6.31, 28.33, 24.17, 18.00, 12.38, 60.13, 48.49, 36.46, 26.54, 20.32, 13.61, - 118.57, 92.90, 70.48, 53.49, 40.23, 27.84, 215.95, 179.25, 126.59, 100.39, 78.16, 52.82, - 33.67, 377.13, 292.92, 220.38, 175.32, 140.91, 93.25, 59.32, 38.36, 596.57, 496.87, 361.58, - 288.22, 229.18, 159.01, 101.20, 63.43, 920.02, 789.60, 564.39, 451.19, 357.82, 249.55, 162.51, 99.24] - wset = [0.4992, 0.5991, 0.6997, 0.4994, 0.6000, 0.7000, 0.7493, 0.4997, 0.6006, 0.7003, 0.7495, - 0.8000, 0.8503, 0.5004, 0.6015, 0.7008, 0.7500, 0.8004, 0.8506, 0.5014, 0.6033, 0.7017, - 0.7508, 0.8011, 0.8511, 0.8998, 0.5030, 0.6054, 0.7031, 0.7520, 0.8022, 0.8519, 0.9003, - 0.9501, 0.5050, 0.6092, 0.7051, 0.7537, 0.8036, 0.8531, 0.9011, 0.9506, 0.5079, 0.6145, - 0.7078, 0.7560, 0.8056, 0.8547, 0.9022, 0.9512] - Tset = [333.15, 333.15, 333.15, 353.15, 353.15, 353.15, 353.15, 373.15, 373.15, 373.15, 373.15, - 373.15, 373.15, 393.15, 393.15, 393.15, 393.15, 393.15, 393.15, 413.15, 413.15, 413.15, - 413.15, 413.15, 413.15, 413.15, 433.15, 433.15, 433.15, 433.15, 433.15, 433.15, 433.15, - 433.15, 453.15, 453.15, 453.15, 453.15, 453.15, 453.15, 453.15, 453.15, 473.15, 473.15, - 473.15, 473.15, 473.15, 473.15, 473.15, 473.15] +L2norm(p...) = L2norm(pressure_data, p...) +function L2norm(pressure_data::DataFrame, p...) + pset = pressure_data.pressure + wset = pressure_data.w + Tset = pressure_data.T L = length(p[1]) SSEcv = CUDA.zeros(Float64, L) @@ -97,22 +90,12 @@ function L2norm(p...) end # CPU version of the function, to be used for IPOPT -function L2norm_cpu(p1::T, p2::T, p3::T, p4::T, p5::T, p6::T) where {T<:Real} +L2norm_cpu(p1::T, p2::T, p3::T, p4::T, p5::T, p6::T) where {T<:Real} = L2norm_cpu(pressure_data, p1, p2, p3, p4, p5, p6) +function L2norm_cpu(pressure_data::DataFrame, p1::T, p2::T, p3::T, p4::T, p5::T, p6::T) where {T<:Real} SSE = zero(T) - pset = [12.38, 10.10, 6.31, 28.33, 24.17, 18.00, 12.38, 60.13, 48.49, 36.46, 26.54, 20.32, 13.61, - 118.57, 92.90, 70.48, 53.49, 40.23, 27.84, 215.95, 179.25, 126.59, 100.39, 78.16, 52.82, - 33.67, 377.13, 292.92, 220.38, 175.32, 140.91, 93.25, 59.32, 38.36, 596.57, 496.87, 361.58, - 288.22, 229.18, 159.01, 101.20, 63.43, 920.02, 789.60, 564.39, 451.19, 357.82, 249.55, 162.51, 99.24] - wset = [0.4992, 0.5991, 0.6997, 0.4994, 0.6000, 0.7000, 0.7493, 0.4997, 0.6006, 0.7003, 0.7495, - 0.8000, 0.8503, 0.5004, 0.6015, 0.7008, 0.7500, 0.8004, 0.8506, 0.5014, 0.6033, 0.7017, - 0.7508, 0.8011, 0.8511, 0.8998, 0.5030, 0.6054, 0.7031, 0.7520, 0.8022, 0.8519, 0.9003, - 0.9501, 0.5050, 0.6092, 0.7051, 0.7537, 0.8036, 0.8531, 0.9011, 0.9506, 0.5079, 0.6145, - 0.7078, 0.7560, 0.8056, 0.8547, 0.9022, 0.9512] - Tset = [333.15, 333.15, 333.15, 353.15, 353.15, 353.15, 353.15, 373.15, 373.15, 373.15, 373.15, - 373.15, 373.15, 393.15, 393.15, 393.15, 393.15, 393.15, 393.15, 413.15, 413.15, 413.15, - 413.15, 413.15, 413.15, 413.15, 433.15, 433.15, 433.15, 433.15, 433.15, 433.15, 433.15, - 433.15, 453.15, 453.15, 453.15, 453.15, 453.15, 453.15, 453.15, 453.15, 473.15, 473.15, - 473.15, 473.15, 473.15, 473.15, 473.15, 473.15] + pset = pressure_data.pressure + wset = pressure_data.w + Tset = pressure_data.T for i = 1:length(pset) temp = exp(p1 + p2*wset[i] + p3*wset[i]^2 + (1/Tset[i])*(p4 + p5*wset[i] + p6*wset[i]^2))