From 44aa54ef8d8fb7ad7c5cc404cf2da27ab2132a35 Mon Sep 17 00:00:00 2001 From: sanginnwoo Date: Sat, 13 Aug 2022 00:18:41 +0900 Subject: [PATCH] from SW --- .idea/SettlementPredictionCode_Step.iml | 2 +- .idea/misc.xml | 2 +- 1_S-12.csv | 144 ++++++++++++++++ 1_SP-11.csv | 45 +++++ 1_SP-17.csv | 164 +++++++++++++++++++ 1_SP-23.csv | 125 ++++++++++++++ 1_SP-28.csv | 205 +++++++++++++++++++++++ 3_SP3-65.csv | 183 +++++++++++++++++++++ 3_SP3-68.csv | 128 +++++++++++++++ 4_S-11.csv | 158 ++++++++++++++++++ settle_prediction_steps.py | 209 +++++++++++++++++++++--- 11 files changed, 1336 insertions(+), 29 deletions(-) create mode 100644 1_S-12.csv create mode 100644 1_SP-17.csv create mode 100644 1_SP-23.csv create mode 100644 1_SP-28.csv create mode 100644 3_SP3-65.csv create mode 100644 3_SP3-68.csv create mode 100644 4_S-11.csv diff --git a/.idea/SettlementPredictionCode_Step.iml b/.idea/SettlementPredictionCode_Step.iml index 3020696..dba70b9 100644 --- a/.idea/SettlementPredictionCode_Step.iml +++ b/.idea/SettlementPredictionCode_Step.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 330b8f6..7cdffb5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/1_S-12.csv b/1_S-12.csv new file mode 100644 index 0000000..6f61dd4 --- /dev/null +++ b/1_S-12.csv @@ -0,0 +1,144 @@ +Time,Settle,Surcharge +0,0,3.52 +2,1.2,3.52 +5,3.1,3.52 +8,5.4,3.52 +15,9.6,3.52 +21,21.5,4.835 +26,28.7,4.835 +28,31.4,4.835 +34,38.3,4.835 +37,41.7,4.835 +40,44.6,4.835 +43,47.3,4.835 +47,51.2,4.835 +50,54.1,4.835 +54,57.3,4.835 +57,59.7,4.835 +61,63,4.835 +64,64.7,4.835 +68,66.9,4.835 +70,68.2,4.835 +72,69.6,4.835 +75,71.5,4.835 +76,72.2,4.835 +77,72.9,4.835 +78,73.5,4.835 +79,74.1,4.835 +82,75.3,4.835 +83,75.7,4.835 +84,76.1,4.835 +85,76.5,4.835 +89,78.4,4.835 +90,78.9,4.835 +92,79.9,4.835 +96,81.8,4.835 +98,82.8,4.835 +99,83.2,4.835 +105,85.8,4.835 +106,86.2,4.835 +107,86.6,4.835 +110,87.8,4.835 +112,88.6,4.835 +114,89.4,4.835 +117,90.6,4.835 +119,91.4,4.835 +121,92.2,4.835 +128,95.2,4.835 +131,96.4,4.835 +134,97.6,4.835 +138,99,4.835 +140,99.6,4.835 +147,101.4,4.835 +149,102,4.835 +153,103.2,4.835 +155,103.8,4.835 +159,105.1,4.835 +162,106,4.835 +166,110.4,6.05 +167,111.3,6.05 +168,112.2,6.05 +169,113.1,6.05 +170,114,6.05 +173,116.7,6.05 +174,117.5,6.05 +177,119.9,6.05 +181,123.1,6.05 +182,123.9,6.05 +183,124.7,6.05 +184,125.4,6.05 +187,127.5,6.05 +188,128.1,6.05 +189,128.7,6.05 +190,129.2,6.05 +191,129.7,6.05 +194,131.2,6.05 +195,131.7,6.05 +196,132.2,6.05 +197,132.7,6.05 +198,133.1,6.05 +201,134.3,6.05 +202,134.7,6.05 +203,135.1,6.05 +204,135.5,6.05 +205,135.9,6.05 +208,137.1,6.05 +211,138.3,6.05 +215,139.5,6.05 +217,140.1,6.05 +219,140.7,6.05 +222,141.6,6.05 +225,142.5,6.05 +229,143.7,6.05 +233,144.9,6.05 +237,146.1,6.05 +239,146.7,6.05 +243,147.9,6.05 +246,148.8,6.05 +250,150,6.05 +253,150.9,6.05 +257,152.1,6.05 +261,153.3,6.05 +264,154.2,6.05 +267,155.1,6.05 +271,155.9,6.05 +275,156.7,6.05 +278,157.3,6.05 +281,157.9,6.05 +285,158.7,6.05 +292,160.1,6.05 +295,160.7,6.05 +299,161.5,6.05 +302,162.1,6.05 +306,162.9,6.05 +309,163.5,6.05 +313,164.3,6.05 +316,164.9,6.05 +320,165.7,6.05 +324,166.1,6.05 +327,166.4,6.05 +329,166.6,6.05 +334,167.1,6.05 +337,167.4,6.05 +341,167.8,6.05 +344,168.1,6.05 +348,168.5,6.05 +351,168.8,6.05 +355,169.2,6.05 +358,169.5,6.05 +362,169.9,6.05 +369,170.6,6.05 +372,170.9,6.05 +376,171.3,6.05 +380,171.7,6.05 +383,172,6.05 +386,172.3,6.05 +390,172.7,6.05 +393,173,6.05 +397,173.4,6.05 +400,173.7,6.05 +404,174,6.05 +407,174.2,6.05 +411,174.5,6.05 +414,174.7,6.05 +422,175.2,6.05 diff --git a/1_SP-11.csv b/1_SP-11.csv index 3b4d704..f333aa6 100644 --- a/1_SP-11.csv +++ b/1_SP-11.csv @@ -78,3 +78,48 @@ Time,Settle,Surcharge 280,356,4.095 286,358,4.095 294,360.9,4.095 +300,363,5.256 +301,363.4,5.256 +304,365.8,5.256 +305,366.5,5.256 +306,367.2,5.256 +307,367.9,5.256 +308,368.5,5.256 +311,369.5,5.256 +312,369.8,5.256 +313,370.1,5.256 +314,370.4,5.256 +327,377.4,5.256 +329,378.5,5.256 +336,381.8,5.256 +343,385.5,5.256 +350,388.4,5.256 +357,391.1,5.256 +364,394.1,5.256 +371,397.1,5.256 +377,399.5,5.256 +385,401.4,5.256 +388,402.3,5.256 +389,402.6,5.256 +390,402.9,5.256 +391,403.2,5.256 +392,403.5,5.256 +395,404.4,5.256 +397,405,5.256 +398,405.3,5.256 +402,406.5,5.256 +404,407.1,5.256 +405,407.4,5.256 +406,407.6,5.256 +409,408.2,5.256 +411,408.6,5.256 +419,410.2,5.256 +420,410.5,5.256 +425,411.5,5.256 +426,411.7,5.256 +434,413.3,5.256 +440,414.5,5.256 +447,415.9,5.256 +455,417.5,5.256 +461,418.7,5.256 +468,420,5.256 diff --git a/1_SP-17.csv b/1_SP-17.csv new file mode 100644 index 0000000..04b9bb1 --- /dev/null +++ b/1_SP-17.csv @@ -0,0 +1,164 @@ +Time,Settle,Surcharge +0,0,1.6 +3,11.4,1.6 +7,24.1,1.6 +9,34.3,1.6 +14,42.7,1.6 +16,51.4,1.6 +21,61.1,1.6 +23,71.2,1.6 +28,87.2,2.8 +30,95.7,3 +35,108.4,3.3 +38,113.3,3.3 +42,122.7,3.3 +44,126.2,3.3 +48,133.5,3.3 +51,138.5,3.3 +55,146.6,3.3 +58,152.4,3.3 +62,160.1,3.3 +66,164.8,3.3 +69,170.1,3.3 +73,175.8,3.3 +76,180.4,3.3 +79,184,3.3 +83,188.6,3.3 +86,193.5,3.3 +90,197.6,3.3 +93,201,3.3 +99,209,3.3 +100,210.3,3.3 +104,214.5,3.3 +107,217.4,3.3 +111,223.2,3.3 +114,226.5,3.3 +118,231.3,3.3 +121,232.8,3.3 +125,238.1,3.3 +128,240.5,3.3 +133,245.3,3.3 +136,247.8,3.3 +139,251,3.3 +142,252.3,3.3 +146,257.1,3.3 +150,260.3,3.3 +153,263.1,3.3 +156,263.4,3.3 +160,269,3.3 +163,269.8,3.3 +167,271.7,3.3 +170,273.7,3.3 +174,276.8,3.3 +177,278.3,3.3 +181,279.7,3.3 +184,281.9,3.3 +188,282.7,3.3 +191,284.5,3.3 +195,286.4,3.3 +199,289.3,3.3 +202,292.7,3.3 +205,294.3,3.3 +209,295.6,3.3 +212,297.5,3.3 +216,300,3.3 +219,301.7,3.3 +224,304,3.3 +226,305.1,3.3 +231,305.3,3.3 +234,305.7,3.3 +238,306.6,3.3 +241,307.4,3.3 +245,308.1,3.3 +248,309.3,3.3 +252,311.8,3.3 +255,314.8,3.3 +259,316.8,3.3 +262,319.3,3.3 +266,320.4,3.3 +269,321.3,3.3 +273,321.8,3.3 +276,323.1,3.3 +280,324,3.3 +283,324.7,3.3 +287,325.3,3.3 +290,326.1,3.3 +294,326.7,3.3 +297,327.7,3.3 +302,329,3.3 +309,329.5,3.3 +316,330.1,3.3 +323,331.5,3.3 +330,333,3.3 +395,365.4,3.3 +402,368,3.3 +429,373.2,3.3 +434,373.5,3.3 +436,373.7,3.3 +441,374,3.3 +444,374.2,3.3 +448,374.6,3.3 +451,374.8,3.3 +455,375.1,3.3 +462,375.2,3.3 +470,375.4,3.3 +484,380.3,3.3 +490,380.4,3.3 +497,380.5,3.3 +503,380.5,3.3 +511,381.6,3.3 +517,381.8,3.3 +525,382.1,3.3 +531,382.3,3.3 +538,382.6,3.3 +545,383,3.3 +552,383.2,3.3 +559,383.7,3.3 +569,383.8,3.3 +576,384.4,3.3 +583,385.1,3.3 +589,385.4,3.3 +596,385.8,3.3 +603,387.2,3.3 +610,388.4,3.3 +619,391,4.3 +626,392.6,4.3 +630,392.6,4.3 +637,393.1,4.3 +644,395,4.3 +653,396.9,4.3 +661,398.9,4.3 +667,400.2,4.3 +673,401.6,4.3 +681,404.5,4.3 +688,407.1,4.3 +694,409.2,4.3 +709,411.2,4.3 +715,413,4.3 +723,413.4,4.3 +730,413.9,4.3 +736,417.3,4.3 +742,417.9,4.3 +750,417.7,4.3 +757,419.1,4.3 +764,420.2,4.3 +771,422.1,4.3 +778,423.9,4.3 +785,424.6,4.3 +792,425.4,4.3 +797,425.9,4.3 +805,426.2,4.3 +812,426.5,4.3 +819,427.8,4.3 +825,428.6,4.3 +841,429.1,4.3 +848,430.2,4.3 +854,431.2,4.3 +862,431.6,4.3 +868,432,4.3 +875,431.5,4.3 +883,431.5,4.3 +890,431.5,4.3 +897,431.5,4.3 +904,431.5,4.3 +911,431.5,4.3 diff --git a/1_SP-23.csv b/1_SP-23.csv new file mode 100644 index 0000000..7ef06f8 --- /dev/null +++ b/1_SP-23.csv @@ -0,0 +1,125 @@ +Time,Settle,Surcharge +0,0,1.5 +5,6.7,1.5 +8,10.2,1.5 +14,20.5,1.5 +22,28.2,1.5 +29,43.2,1.5 +35,47.4,1.5 +43,57.1,1.5 +50,63.5,1.5 +57,70.5,1.5 +64,77.7,1.5 +70,83.5,1.5 +78,92.4,1.5 +85,97.6,1.5 +92,103.5,1.5 +99,108.4,1.5 +106,113.49,1.5 +113,118.4,1.5 +116,118.4,2.871 +120,122.8,2.871 +124,123,2.871 +125,125.2,2.871 +126,127.4,2.871 +127,129.6,2.871 +130,132.9,2.871 +131,134,2.871 +132,135.1,2.871 +133,136.2,2.871 +144,145.6,2.871 +145,146.5,2.871 +146,147.4,2.871 +147,148.3,2.871 +154,153.4,2.871 +161,159.2,2.871 +168,163.9,2.871 +175,169.8,2.871 +182,174.9,2.871 +189,180.7,2.871 +196,185.4,2.871 +203,191.2,2.871 +210,196.1,3.606 +218,201.7,3.606 +225,205.9,3.606 +232,210.1,3.606 +238,213.7,3.606 +246,217.9,3.606 +253,221.2,3.606 +260,225.2,3.606 +266,228.4,3.606 +281,239.2,3.606 +288,243.1,3.606 +295,246.6,3.606 +302,250.4,3.606 +309,254,3.606 +316,257.3,3.606 +323,260.5,3.606 +329,263.3,3.606 +337,266.4,3.606 +344,269,3.606 +350,271.2,3.606 +358,274,3.606 +361,275.2,3.606 +363,276,3.606 +371,279.2,3.606 +372,279.6,3.606 +377,281.1,3.606 +378,281.4,3.606 +383,282.9,3.606 +384,283.2,3.606 +385,283.5,3.606 +386,283.8,3.606 +389,284.7,3.606 +390,285,3.606 +391,285.4,3.606 +392,285.8,3.606 +397,287.4,3.606 +398,287.7,3.606 +399,288,3.606 +403,289.2,3.606 +404,289.5,3.606 +405,289.8,3.606 +406,290.1,3.606 +407,290.4,3.606 +410,291,3.606 +411,291.2,3.606 +413,291.6,3.606 +420,293.1,3.606 +421,293.4,3.606 +424,294.3,3.606 +431,296.4,3.606 +435,298.4,4.896 +438,302,4.896 +441,305.1,4.896 +445,309.4,4.896 +448,313.7,4.896 +455,320.1,4.896 +462,325.4,4.896 +469,330.9,4.896 +473,334.3,4.896 +475,335.8,4.896 +476,336.5,4.896 +477,337.2,4.896 +480,338.8,4.896 +481,339.3,4.896 +483,340.3,4.896 +488,343.6,4.896 +497,348.6,4.896 +502,351.6,4.896 +504,352.3,4.896 +509,354.8,4.896 +512,356.1,4.896 +516,358.7,4.896 +518,359,4.896 +525,362.6,4.896 +530,364.6,4.896 +532,365.7,4.896 +540,368.4,4.896 +544,369.4,4.896 +547,370.2,4.896 +550,371,4.896 +553,372.4,4.896 +560,374.1,4.896 +565,375.2,4.896 +568,375.5,4.896 diff --git a/1_SP-28.csv b/1_SP-28.csv new file mode 100644 index 0000000..39a546c --- /dev/null +++ b/1_SP-28.csv @@ -0,0 +1,205 @@ +Time,Surcharge,Settle +0,1.5,0 +8,1.5,13.7 +15,1.5,25.2 +18,1.5,30 +21,1.5,35.4 +28,1.5,44.5 +33,1.5,50.5 +36,1.5,54.1 +40,1.5,58.8 +42,1.5,61.1 +43,1.5,62.4 +46,1.5,66.3 +49,1.5,69.2 +53,1.5,71.2 +54,1.5,72.2 +55,1.5,73.1 +56,1.5,74 +60,2.942,105.8 +63,2.942,110.7 +67,2.942,118 +71,2.942,122.4 +75,2.942,129.2 +77,2.942,132.6 +81,2.942,139.1 +84,2.942,143.2 +91,2.942,152.6 +99,2.942,162.4 +106,2.942,171.9 +112,2.942,179.1 +119,2.942,185.8 +127,2.942,194.2 +132,2.942,199.1 +140,2.942,207.1 +148,2.942,214.5 +158,2.942,222.9 +161,2.942,225.4 +168,2.942,231.8 +175,2.942,237.6 +183,2.942,244 +189,2.942,248.2 +197,2.942,253.8 +203,2.942,258.2 +210,2.942,262.6 +217,2.942,265.6 +224,2.942,268.7 +231,2.942,272.5 +238,2.942,276.6 +245,2.942,280.6 +252,2.942,285.7 +263,2.942,291 +266,2.942,292.5 +273,2.942,295.3 +281,2.942,299.3 +288,2.942,301.8 +295,2.942,305.3 +303,2.942,309.3 +310,2.942,312.8 +312,2.942,313.8 +316,2.942,315.8 +323,2.942,318.5 +328,2.942,320.4 +330,2.942,321.2 +335,2.942,323.4 +337,2.942,324.2 +340,2.942,325.1 +343,2.942,326 +350,2.942,328.1 +356,2.942,329.9 +363,2.942,332.6 +369,2.942,334.4 +372,2.942,335.2 +375,2.942,336 +378,2.942,336.8 +382,2.942,337.6 +385,2.942,338.1 +389,2.942,338.4 +392,2.942,338.7 +396,3.43,340.3 +399,3.43,341.2 +403,3.43,342.3 +405,4.345,344 +407,4.345,345.5 +410,4.345,347.6 +411,4.345,348.2 +412,4.345,348.8 +413,4.345,349.4 +414,4.345,349.9 +417,4.345,351.3 +418,4.345,351.8 +419,4.345,352.3 +420,4.345,352.8 +424,4.345,354.9 +425,4.345,355.4 +427,4.345,356.4 +431,4.345,358.6 +433,4.345,359.6 +434,4.345,360.1 +440,4.345,362.9 +441,4.345,363.4 +442,4.345,363.9 +445,4.345,365.4 +447,4.345,366.4 +449,4.345,367.4 +452,4.345,368.9 +454,4.345,369.9 +456,4.345,371.4 +463,4.345,376.2 +466,4.345,378.1 +469,4.345,379.9 +473,4.345,381.9 +475,4.345,382.9 +482,4.345,385.7 +484,4.345,386.5 +488,4.345,388.1 +490,4.345,388.9 +494,4.345,390.8 +497,4.345,391.9 +501,6.619,398.6 +502,6.619,400.1 +503,6.619,401.6 +504,6.619,403 +505,6.619,404.4 +508,6.619,408.3 +509,6.619,409.6 +512,6.619,413.2 +516,6.619,418 +517,6.619,419.2 +518,6.619,420.4 +519,6.619,421.5 +522,6.619,424.8 +523,6.619,425.9 +524,6.619,426.9 +525,6.619,427.9 +526,6.619,428.9 +529,6.619,431.6 +530,6.619,432.5 +531,6.619,433.4 +532,6.619,434.2 +533,6.619,435 +536,6.619,437.1 +537,6.619,437.8 +538,6.619,438.5 +539,6.619,439.2 +540,6.619,439.8 +543,6.619,441.6 +546,6.619,443.4 +550,6.619,445.8 +552,6.619,446.8 +554,6.619,447.8 +557,6.619,449.3 +560,6.619,450.8 +564,6.619,452.8 +568,6.619,454.8 +572,6.619,456.8 +574,6.619,457.8 +578,6.619,459.4 +581,6.619,460.6 +585,6.619,462.2 +588,6.619,463.4 +592,6.619,465 +596,6.619,466.6 +599,6.619,467.8 +602,6.619,469 +606,6.619,470.6 +610,6.619,471.8 +613,6.619,472.7 +616,6.619,473.6 +620,6.619,474.8 +627,6.619,476.9 +630,6.619,477.8 +634,6.619,479 +637,6.619,479.9 +641,6.619,480.7 +644,6.619,481.3 +648,6.619,482.1 +651,6.619,482.7 +655,6.619,483.5 +659,6.619,484.3 +662,6.619,484.9 +664,6.619,485.3 +669,6.619,486.3 +672,6.619,486.9 +676,6.619,487.7 +679,6.619,488.3 +683,6.619,488.7 +686,6.619,489 +690,6.619,489.4 +693,6.619,489.7 +697,6.619,490.1 +704,6.619,490.8 +707,6.619,491.1 +711,6.619,491.5 +715,6.619,491.9 +718,6.619,492.2 +721,6.619,492.5 +725,6.619,492.9 +728,6.619,493.2 +732,6.619,493.6 +735,6.619,493.9 +739,6.619,494.2 +742,6.619,494.4 +746,6.619,494.7 +749,6.619,494.9 +757,6.619,495.4 diff --git a/3_SP3-65.csv b/3_SP3-65.csv new file mode 100644 index 0000000..e93e993 --- /dev/null +++ b/3_SP3-65.csv @@ -0,0 +1,183 @@ +Time,Settle,Surcharge +0,0,1.33 +4,7.7,1.33 +8,10.7,1.33 +11,20.4,1.33 +15,29.5,1.33 +17,36.5,1.33 +22,42.9,1.33 +24,48,1.33 +29,53.4,1.33 +31,58.6,1.33 +36,66,1.33 +38,69.5,1.33 +42,70.9,1.33 +45,77.7,1.33 +50,83.7,1.33 +53,89.2,1.33 +56,92.5,1.33 +59,95.4,1.33 +63,96.6,1.33 +66,97.4,1.33 +70,98.7,1.33 +73,100.6,1.33 +77,109.0583333,1.33 +80,115.825,1.33 +84,120.9,1.33 +87,122.6,1.33 +90,125.7,1.33 +94,129.7,1.33 +97,132.5,1.33 +100,135,1.33 +104,138,1.33 +107,141.5,1.33 +120,154.4,1.33 +122,156.2,1.33 +125,159.3,1.33 +128,162.2,1.33 +132,164.4,1.33 +135,167.3,1.33 +139,170.6,1.33 +142,173.3090909,1.33 +147,175.5,1.33 +150,177.6,1.33 +154,181.4,1.33 +156,183.8,1.33 +160,185.6,1.33 +163,188,1.33 +167,190.7,1.33 +170,192.6,1.33 +175,193.7,1.33 +178,195.2,1.33 +181,199.9,1.33 +184,201.9,1.33 +188,204,1.33 +191,205.9,1.33 +195,208.3,1.33 +198,210.3,1.33 +203,212.6,1.33 +207,214.3,1.33 +213,216.7,1.33 +216,218.5,1.33 +221,220.6,1.33 +224,222.3,1.33 +227,224.6,1.33 +230,226.4,1.33 +234,228.1,1.33 +238,230.4,1.33 +241,232.3,1.33 +245,233.9,1.33 +248,235,1.33 +252,236.9,1.33 +255,237.7,1.33 +258,239.2,1.33 +261,240.5,1.33 +265,242.2,1.33 +268,243.2,1.33 +272,244.4,1.33 +275,245.6,1.33 +279,247.1,1.33 +282,248,1.33 +286,249.3,1.33 +289,250.3,1.33 +293,252.1,1.33 +296,253.5,1.33 +300,255.4,1.33 +303,256.9,1.33 +308,259.2,1.33 +311,262.9,1.33 +315,268.3,1.33 +318,272.9,1.33 +322,279.5,1.33 +325,284.6,1.33 +328,288.7,1.33 +331,290.7,1.33 +338,292.9,1.33 +342,294.6,2.287 +345,295.9,2.287 +349,297.7,2.287 +352,299.2,2.287 +357,306.5,3.92 +361,311.9,3.92 +364,317,3.92 +367,321.9,3.92 +371,326.4,3.92 +374,329.9,3.92 +378,333.6,3.92 +381,336,3.92 +384,337.6,3.92 +387,338.9,3.92 +391,343.3,3.92 +394,346.1,3.92 +398,349.6,3.92 +401,352.7,3.92 +405,355.6,3.92 +408,357.5,3.92 +413,360.8,3.92 +415,362.1,3.92 +420,366.1,3.92 +423,368.3,3.92 +426,370.7,3.92 +429,372.7,3.92 +433,375.4,3.92 +436,377.4,3.92 +440,380,3.92 +444,382.3,3.92 +447,383.8,3.92 +450,385.5,3.92 +455,388.2,3.92 +457,389.1,3.92 +461,391.5,3.92 +464,393.2,3.92 +471,397.3,3.92 +475,399.8,3.92 +479,402.1,3.92 +483,404.2,3.92 +486,405.6,3.92 +489,407.3,3.92 +492,408.3,5.2 +496,412.3,5.2 +499,415.7,5.2 +504,418.7,5.2 +507,421,5.2 +511,423.7,5.2 +514,426,5.2 +517,428.6,5.2 +520,430.8,5.2 +525,433.7,5.2 +528,436.1,5.2 +532,437,5.2 +534,438.3,5.2 +538,440.8,5.2 +541,442,5.2 +545,444.1,5.2 +548,445.6,5.2 +552,448.1,5.2 +555,449.7,5.2 +559,451.9,5.2 +562,454.7,5.2 +566,456.5,5.2 +569,458.4,5.2 +573,460.2,5.2 +576,461.5,5.2 +580,463.2,5.2 +583,464.3,5.2 +588,468.2,5.2 +590,470.3,5.2 +595,470.7,5.2 +598,470.9,5.2 +602,471.9,5.2 +605,472.6,5.2 +609,473.8,5.2 +612,474.6,5.2 +615,475.2,5.2 +618,475.8,5.2 +623,476.8,5.2 +626,477.6,5.2 +629,478.3,5.2 +632,479.2,5.2 +636,480.6,5.2 +639,480.6,5.2 +643,480.7,5.2 +646,480.7,5.2 +650,480.7,5.2 diff --git a/3_SP3-68.csv b/3_SP3-68.csv new file mode 100644 index 0000000..e9dbb1e --- /dev/null +++ b/3_SP3-68.csv @@ -0,0 +1,128 @@ +Time,Settle,Surcharge +0,0,1.887 +3,41,1.887 +6,61.5,1.887 +10,73.1,1.887 +13,81.6,1.887 +17,86.9,1.887 +20,91.9,1.887 +23,96.7,1.887 +26,101.6,1.887 +30,107.7,2.94 +33,113,2.94 +37,119.4,2.94 +40,122.8,2.94 +44,128.4,2.94 +47,131.9,2.94 +52,139.5,2.94 +54,140.5,2.94 +59,148,2.94 +62,151,2.94 +65,153.8,2.94 +68,156.6,2.94 +72,160,2.94 +75,162.5,2.94 +79,166,2.94 +83,169.1,2.94 +86,172,2.94 +89,174.7,2.94 +94,180.3,2.94 +96,182.1,2.94 +100,185.5,2.94 +103,188.4,2.94 +110,195.8,2.94 +114,198.7,2.94 +118,201.1,2.94 +122,205,2.94 +125,206.9,2.94 +128,209.3,2.94 +131,211.8,2.94 +135,214.2,2.94 +138,216.2,2.94 +143,217.4,2.94 +146,218.3,2.94 +150,219.1,2.94 +153,219.9,2.94 +156,220.9,2.94 +159,222,2.94 +164,227.7,2.94 +167,230.7,2.94 +171,234.8,3.48 +173,236.5,3.48 +177,239.7,3.48 +180,241.8,3.48 +184,243.9,3.48 +187,246.3,3.48 +191,249.6,3.48 +194,252.1,3.48 +198,255.5,3.48 +201,258.9,3.48 +205,261.2,3.48 +208,263.4,3.48 +212,265.8,3.48 +215,267.1,3.48 +219,268.9,3.48 +222,270.2,3.48 +227,273.4,3.48 +229,275,3.48 +234,277.3,3.48 +237,278.1,3.48 +241,280,3.48 +244,281.2,3.48 +248,283.2,3.48 +251,284.6,3.48 +254,286.1,3.48 +257,287.5,3.48 +262,289.5,3.48 +265,290.7,3.48 +268,292,3.48 +271,293.2,3.48 +275,294.7,3.48 +278,295.3,3.48 +282,296.3,3.48 +285,296.7,3.48 +289,297.6,3.48 +292,298.5,3.48 +296,299.8,3.48 +299,300.6,3.48 +303,302.2,3.48 +306,303.5,3.48 +310,312.8,5.608 +313,318.1,5.608 +317,322.8,6.794 +320,328.9,6.794 +324,335.3,6.794 +328,340.5,6.794 +331,342.9,6.794 +334,345.5,6.794 +339,348,6.794 +342,350.6,6.794 +345,353.1,6.794 +348,355.6,6.794 +352,358.9,6.794 +355,361,6.794 +362,365.6,6.794 +367,369,6.794 +370,370.5,6.794 +373,372.2,6.794 +376,373.8,6.794 +381,376.4,6.794 +384,378.5,6.794 +387,380.4,6.794 +390,382.4,6.794 +394,385.8,6.794 +397,388,6.794 +402,389.9,6.794 +405,390.9,6.794 +409,392.6,6.794 +412,394,6.794 +415,396.7,6.794 +418,397.5,6.794 +422,398.7,6.794 +425,399.1,6.794 +429,399.8,6.794 +432,400.9,6.794 +436,403.6,6.794 +439,405.6,6.794 +443,408.2,6.794 +446,409.4,6.794 diff --git a/4_S-11.csv b/4_S-11.csv new file mode 100644 index 0000000..7d8184e --- /dev/null +++ b/4_S-11.csv @@ -0,0 +1,158 @@ +Time,Settle,Surcharge +0,0,3 +9,14.4,3 +14,31.4,3 +24,33.3,3 +27,34.1,3 +28,34.5,3 +29,34.7,3 +31,34.9,3 +34,35.3,3 +36,35.7,3 +38,36,3.5 +41,36.3,3.5 +43,45.8,3.5 +45,50.6,3.5 +48,55.3,3.5 +50,79.1,3.5 +52,91,3.5 +55,96.9,3.5 +57,99.9,3.5 +59,102.9,3.5 +66,134,3.5 +72,142,3.5 +78,150.7,3.5 +83,154.2,3.5 +84,155.9,3.5 +86,157.7,3.5 +90,160,3.5 +92,161.1,3.5 +94,162.3,3.5 +97,160.3,3.5 +98,159.3,3.5 +99,158.8,3.5 +101,158.3,3.5 +104,158.6,3.5 +106,158.6,3.5 +108,158.6,3.5 +111,158.7,3.5 +113,158.9,3.5 +115,160.2,3.5 +118,160.8,3.5 +120,161.5,3.5 +121,162.8,3.5 +122,164.2,3.5 +123,165.5,3.5 +125,166.9,3.5 +127,169.7,3.5 +127,176.6,4 +128,180.1,4 +129,181.9,4 +132,182.7,4 +134,183.6,4 +135,199.5,5.11 +136,207.5,5.11 +136,211.5,5.11 +139,213.5,5.11 +142,215.5,5.11 +143,219.8,5.11 +146,221.9,5.11 +148,224,5.11 +150,226.9,5.11 +153,228.4,5.11 +155,229.8,5.11 +157,236.7,5.11 +160,243.1,5.11 +161,249.1,5.11 +162,257.3,5.11 +163,261.6,5.11 +164,263.7,5.11 +167,264.7,5.11 +169,265.8,5.11 +171,272.2,5.11 +174,275.4,5.11 +176,278.6,5.11 +177,281.8,5.11 +178,283.4,5.11 +181,284.2,5.11 +182,285,5.11 +183,288.3,5.11 +184,289.9,5.11 +185,290.7,5.11 +188,291.1,5.11 +190,291.3,5.11 +192,291.5,5.11 +195,294.7,5.11 +197,297.9,5.11 +202,304.3,5.11 +210,309.3,5.11 +217,314.4,5.11 +224,321,5.11 +231,327.8,5.11 +246,336.9,5.11 +253,341.1,5.11 +259,344.7,5.11 +267,350.4,5.11 +273,354.5,5.11 +280,359,5.11 +287,363.3,5.11 +293,366.9,5.11 +301,371.1,5.11 +308,374.7,5.11 +318,379.7,5.11 +325,382.3,5.11 +332,384.8,5.11 +339,387.3,5.11 +346,389.8,5.11 +352,392.1,5.11 +356,395.3,5.11 +364,401.5,5.11 +373,408.3,5.11 +380,410.8,5.11 +386,413.5,5.11 +392,416.1,5.11 +399,419,5.11 +407,420.3,5.11 +412,421,5.11 +420,422,5.11 +428,423,5.11 +435,428.8,5.11 +440,431.4,5.11 +442,432.2,5.11 +444,433.7,5.61 +447,435,5.61 +448,435.3,5.61 +457,437.8,5.61 +464,439.6,5.61 +470,440.8,5.61 +476,441.8,5.61 +484,443.2,5.61 +491,444.3,5.61 +498,448.8,5.61 +505,453.3,5.61 +513,457.3,5.61 +520,459.5,5.61 +524,460.6,5.61 +531,461.9,5.61 +538,463.1,5.61 +546,464.4,5.61 +552,465.4,5.61 +560,466.7,5.61 +569,468,5.61 +576,469.1,5.61 +581,469.8,5.61 +591,471.3,5.61 +598,472.4,5.61 +605,473.5,5.61 +612,474.5,5.61 +619,475.3,5.61 +625,476.1,5.61 +631,476.9,5.61 +640,478,5.61 +644,478.4,5.61 +651,479,5.61 +658,479.6,5.61 +664,480.1,5.61 +672,480.7,5.61 +680,481.2,5.61 +689,481.7,5.61 diff --git a/settle_prediction_steps.py b/settle_prediction_steps.py index 5223530..6095859 100644 --- a/settle_prediction_steps.py +++ b/settle_prediction_steps.py @@ -1,3 +1,15 @@ +""" +Title: Soft ground settlement prediction considering the step loading +Main Developer: Sang Inn Woo, Ph.D. @ Incheon National University +Starting Date: 2022-08-11 +Abstract: +This main objective of this code is to predict +time vs. (consolidation) settlement of soft clay ground +under step loading conditions. +The methodologies used are 1) superposition of time-settlement curves +and 2) nonlinear regression for hyperbolic curves. +""" + # ================= # Import 섹션 # ================= @@ -5,7 +17,6 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt -from matplotlib import rcParams from scipy.optimize import least_squares @@ -26,49 +37,113 @@ def fun_hyper_nonlinear(px, pt, py): def fun_hyper_original(px, pt, py): return px[0] * pt + px[1] - pt / py +# RMSE 산정 +def fun_rmse(py1, py2): + mse = np.square(np.subtract(py1, py2)).mean() + return np.sqrt(mse) -# ================= -# 입력값 설정 -# ================= + +# ================================ +# 파일 설정 / Pre-processing (임시) +# ================================ + +# 파일명 설정 +#filename = "1_S-12.csv" +#filename = "1_SP-11.csv" +#filename = "1_SP-17.csv" +#filename = "1_SP-23.csv" +#filename = "3_SP3-65.csv" +#filename = "3_SP3-68.csv" +filename = "4_S-11.csv" + +# 성토 단계 시작 index 리스트 초기화 +step_start_index = [] + +# 성토 단계 끝 index + 1 리스트 초기화 +step_end_index = [] + +# 파일명에 따라서, 성토 단계 index 설정 +if filename == "1_S-12.csv": + step_start_index = [0, 56] + step_end_index = [56, 143] +elif filename == "1_SP-11.csv": + step_start_index = [0, 10, 37, 79] + step_end_index = [10, 37, 79, 124] +elif filename == "1_SP-17.csv": + step_start_index = [0, 122] + step_end_index = [122, 163] +elif filename == "1_SP-23.csv": + step_start_index = [0, 18, 40, 90] + step_end_index = [18, 40, 90, 124] +elif filename == "3_SP3-65.csv": + step_start_index = [0, 94, 136] + step_end_index = [ 94, 136, 182] +elif filename == "3_SP3-68.csv": + step_start_index = [0, 9, 48, 88] + step_end_index = [9, 48, 88, 127] +elif filename == "4_S-11.csv": + step_start_index = [0, 10, 46, 51, 120] + step_end_index = [10, 46, 51, 120, 157] + +# 성토 단계 횟수 파악 및 저장 +num_steps = len(step_start_index) + + + +# ==================== +# 파일 읽기, 데이터 설정 +# ==================== # CSV 파일 읽기 -data = pd.read_csv("1_SP-11.csv") +data = pd.read_csv(filename) # 시간, 침하량, 성토고 배열 생성 time = data['Time'].to_numpy() settle = data['Settle'].to_numpy() surcharge = data['Surcharge'].to_numpy() +# 마지막 계측 데이터 index + 1 파악 +final_index = time.size + # ================= # 성토 단계 구분 # ================= -# todo: 성토고 데이터를 분석하여, 각 단계 계측 시작일 / 끝일 파악해야함 +# todo: 성토고 데이터를 분석하여, 각 단계 계측 시작 및 끝일에 해당하는 인덱스 파악 필요 # 꼭 이전 단계 마지막 인덱스와 현재 단계 처음 인덱스가 이어질 필요는 없음 # (각 단계별 시간, 침하를 초기화 한후 예측을 수행하므로...) +# =========================== +# 최종 단계 데이터 사용 범위 조정 +# =========================== -# ================= -# (임시) 입력값 설정 -# ================= +# 최종 성토 단계의 데이터 사용 퍼센트 설정 : 사용자 입력값 +final_step_predict_percent = 60 -# 현재 아래 값은 입력값으로 각 데이터로부터 추출해야 함 -# todo: 단계성토 데이터 14곳에 대해서 아래 정보를 구축해서 정리할 것 -step_start_index = [0, 10, 37] # 성토 단계 시작 index -step_end_index = [10, 37, 65] # 성토 단계 끝 index + 1 --> max. index = 78 따라서 78 + 1 = 79 -final_index = time.size # 마지만 계측 데이터 index + 1 -num_steps = 3 # 성토 단계 횟수 +# 데이터 사용 퍼센트에 해당하는 기간 계산 +final_step_end_date = time[-1] +final_step_start_date = time[step_start_index[num_steps - 1]] +final_step_period = final_step_end_date - final_step_start_date +final_step_predict_end_date = final_step_start_date + final_step_period * final_step_predict_percent / 100 -# todo: 최종 단계에 대해서는 계측 데이터 활용 구간을 조정이 가능해야함 -# step_end_index의 마지막 값을 조정하여 마지막 성토 구간의 계측 데이터 사용 구간을 조정 가능 -# 본 입력 파일에서는 38 ~ 79 사이의 값을 활용구간에 따라 조정해야 함 +# 데이터 사용 끝 시점 인덱스 초기화 +final_step_predict_end_index = -1 -# todo: 예측 때 활용하지 않은 계측값에 대해서 RMSE 산정 +# 데이터 사용 끝 시점 인덱스 검색 +count = 0 +for day in time: + count = count + 1 + if day > final_step_predict_end_date: + final_step_predict_end_index = count - 1 + break + +# 마지막 성토 단계, 마지막 계측 시점 인덱스 업데이트 +step_end_index[num_steps - 1] = final_step_predict_end_index @@ -78,11 +153,11 @@ num_steps = 3 # 성토 단계 횟수 # ================= # 추가 예측 일 입력 -add_days = 500 +add_days = time[-1] # 마지막 성토고 및 마지막 계측일 저장 final_surcharge = surcharge[final_index - 1] -final_time = time[final_index -1] +final_time = time[final_index - 1] # 추가 시간 및 성토고 배열 설정 (100개의 시점 설정) time_add = np.linspace(final_time + 1, final_time + add_days, 100) @@ -102,7 +177,10 @@ final_index = time.size # ============================= # 예측 침하량 초기화 -sp = np.zeros(time.size) +sp_step = np.zeros(time.size) + +# 만일 계수 중에 하나가 음수가 나오면 에러 출력 +error_step = 0 # 각 단계별로 진행 for i in range(0, num_steps): @@ -112,7 +190,7 @@ for i in range(0, num_steps): sm_this_step = settle[step_start_index[i]:step_end_index[i]] # 이전 단계까지 예측 침하량 중 현재 단계에 해당하는 부분 추출 - sp_this_step = sp[step_start_index[i]:step_end_index[i]] + sp_this_step = sp_step[step_start_index[i]:step_end_index[i]] # 현재 단계 시작 부터 끝까지 시간 데이터 추출 tm_to_end = time[step_start_index[i]:final_index] @@ -142,12 +220,19 @@ for i in range(0, num_steps): x_step = res_lsq_hyper_nonlinear.x print(x_step) + # 만일 계수 중에 하나가 음수일 경우, 에러 메세지 출력하고 Break + #if x_step[0] < 0 or x_step[0] < 0 : + # print("More than one parameter is negative!") + # error_step = 1 + # break + # 현재 단계 예측 침하량 산정 (침하 예측 끝까지) sp_to_end_update = generate_data_hyper(x_step, tm_to_end) # 예측 침하량 업데이트 - sp[step_start_index[i]:final_index] = \ - sp[step_start_index[i]:final_index] + sp_to_end_update + s0_this_step + sp_step[step_start_index[i]:final_index] = \ + sp_step[step_start_index[i]:final_index] + sp_to_end_update + s0_this_step + # ========================================================= @@ -199,6 +284,28 @@ time_hyper = time_hyper + t0_hyper +# ========== +# RSME 산정 +# ========== + +# RMSE 계산 데이터 구간 설정 (계측, 단계, 비선형 쌍곡선, 기존 쌍곡선) +sm_rmse = settle[step_start_index[num_steps - 1]:final_step_predict_end_index] +sp_step_rmse = sp_step[step_start_index[num_steps - 1]:final_step_predict_end_index] +sp_hyper_nonlinear_rmse = sp_hyper_nonlinear[:final_step_predict_end_index - step_start_index[num_steps - 1]] +sp_hyper_original_rmse = sp_hyper_original[:final_step_predict_end_index - step_start_index[num_steps - 1]] + +# RMSE 산정 (단계, 비선형 쌍곡선, 기존 쌍곡선) +RMSE_step = fun_rmse(sm_rmse, sp_step_rmse) +RMSE_hyper_nonlinear = fun_rmse(sm_rmse, sp_hyper_nonlinear_rmse) +RMSE_hyper_original = fun_rmse(sm_rmse, sp_hyper_original_rmse) + +# RMSE 출력 (단계, 비선형 쌍곡선, 기존 쌍곡선) +print("RMSE(Nonlinear Hyper + Step): %0.3f" %RMSE_step) +print("RMSE(Nonlinear Hyperbolic): %0.3f" %RMSE_hyper_nonlinear) +print("RMSE(Original Hyperbolic): %0.3f" %RMSE_hyper_original) + + + # ===================== # Post-Processing # ===================== @@ -211,14 +318,14 @@ fig, axes = plt.subplots(2, 1, figsize=(10, 10), axes[0].plot(time, surcharge, color='black', label='surcharge height') # 성토고 그래프 설정 -axes[0].set_ylabel("Surcharge height (m)", fontsize=17) +axes[0].set_ylabel("Surcharge height (m)", fontsize=15) axes[0].set_xlim(left=0) axes[0].grid(color="gray", alpha=.5, linestyle='--') axes[0].tick_params(direction='in') # 계측 및 예측 침하량 표시 axes[1].scatter(time[0:settle.size], -settle, s=50, facecolors='white', edgecolors='black', label='measured data') -axes[1].plot(time, -sp, linestyle='-', color='blue', label='Nonlinear + Step Loading') +axes[1].plot(time, -sp_step, linestyle='-', color='blue', label='Nonlinear + Step Loading') axes[1].plot(time_hyper, -sp_hyper_nonlinear, linestyle='--', color='green', label='Nonlinear Hyperbolic') axes[1].plot(time_hyper, -sp_hyper_original, @@ -236,6 +343,54 @@ axes[1].tick_params(direction='in') # 범례 표시 axes[1].legend(loc=1, ncol=2, frameon=True, fontsize=12) +# 예측 데이터 사용 범위 음영 처리 - 단계성토 +plt.axvspan(0, final_step_predict_end_date, + alpha=0.2, color='grey', hatch='///') + +# 예측 데이터 사용 범위 음영 처리 - 기존 및 비선형 쌍곡선 +plt.axvspan(final_step_start_date, final_step_predict_end_date, + alpha=0.2, color='grey', hatch='///') + +# 예측 데이터 사용 범위 표시 화살표 세로 위치 설정 +arrow1_y_loc = 1.3 * min(-settle) +arrow2_y_loc = 1.4 * min(-settle) + +# 예측 데이터 사용 범위 화살표 처리 - 단계성토 +axes[1].arrow(0, arrow1_y_loc, final_step_predict_end_date, 0, + head_width=10, color='black', length_includes_head='True') +axes[1].arrow(final_step_predict_end_date, arrow1_y_loc, -final_step_predict_end_date, 0, + head_width=10, color='black', length_includes_head='True') + +# 예측 데이터 사용 범위 화살표 처리 - 기존 및 비선형 쌍곡선 +axes[1].arrow(final_step_start_date, arrow2_y_loc, + final_step_predict_end_date - final_step_start_date, 0, + head_width=10, color='black', length_includes_head='True') +axes[1].arrow(final_step_predict_end_date, arrow2_y_loc, + final_step_start_date - final_step_predict_end_date, 0, + head_width=10, color='black', length_includes_head='True') + +# Annotation 표시용 공간 설정 +space = max(time) * 0.01 + +# 예측 데이터 사용 범위 범례 표시 - 단계성토 +plt.annotate('Data Range Used (Nonlinear + Step Loading)', xy=(final_step_predict_end_date, arrow1_y_loc), + xytext=(final_step_predict_end_date + space, arrow1_y_loc), + horizontalalignment='left', verticalalignment='center') + +# 예측 데이터 사용 범위 범례 표시 - 기존 및 비선형 쌍곡선 +plt.annotate('Data Range Used (Nonlinear and Original Hyperbolic)', xy=(final_step_predict_end_date, arrow1_y_loc), + xytext=(final_step_predict_end_date + space, arrow2_y_loc), + horizontalalignment='left', verticalalignment='center') + +# RMSE 출력 +mybox = {'facecolor': 'white', 'edgecolor': 'black', 'boxstyle': 'round', 'alpha': 0.4} +plt.text(max(time), 0.25 * min(-settle), + " RMSE (Nonlinear + Step Loading) = %0.3f" % RMSE_step + + "\n" + " RMSE (Nonlinear Hyperbolic) = %0.3f" % RMSE_hyper_nonlinear + + "\n" + " RMSE (Original Hyperbolic) = %0.3f" % RMSE_hyper_original, + color='r', horizontalalignment='right', + verticalalignment='top', fontsize='12', bbox=mybox) + # 그래프 저장 plt.savefig('output.svg')