nasa / prog_models

The NASA Prognostic Model Package is a Python framework focused on defining and building models for prognostics (computation of remaining useful life) of engineering systems, and provides a set of prognostics models for select components developed within this framework, suitable for use in prognostics applications for these components.
123 stars 50 forks source link

314 Auto step for piecewise loading profile #542

Closed teubert closed 1 year ago

teubert commented 1 year ago

Two related changes:

  1. Added a new loading scheme that defines the logic for piecewise loading profiles
  2. Added "stop points". These are points where the simulation will be sure to stop if using "auto" dt. This is important if there are point in the loading profile that you want to capture
  3. Will automatically grab the inflection points of the piecewise scheme as stop points (if using "auto" dt)
github-actions[bot] commented 1 year ago

Thank you for opening this PR. Each PR into dev requires a code review. For the code review, look at the following:

github-actions[bot] commented 1 year ago
Benchmarking Results From: Test Time (s)
import main 0.1537621
import thrown object 0.6062300999999999
model initialization 0.1423979000000002
set noise 0.7719074999999997
simulate 0.34292349999999994
simulate with saving 1.0761016999999997
simulate with saving, dt 1.1999733999999993
simulate with printing results, dt 1.4443402
Plot results 17.7884369
Metrics 0.042736099999999055
Surrogate Model Generation 3.7738382
surrogate sim 1.2432507999999984
surrogate sim, dt 3.3896939000000046
To: Test Time (s)
import main 0.15799910000000006
import thrown object 0.6209585
model initialization 0.14355700000000038
set noise 0.7779303
simulate 0.3621411000000001
simulate with saving 1.1484831000000004
simulate with saving, dt 1.2272678999999993
simulate with printing results, dt 1.5042803999999999
Plot results 17.7216396
Metrics 0.04383550000000014
Surrogate Model Generation 3.9756144000000013
surrogate sim 1.2518706999999978
surrogate sim, dt 3.4229404000000017
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.17272320000000008
import thrown object 0.6548961999999998
model initialization 0.1601596999999999
set noise 0.8580565
simulate 0.38464699999999974
simulate with saving 1.1968689999999995
simulate with saving, dt 1.3661443000000002
simulate with printing results, dt 1.6677601000000006
Plot results 17.9012846
Metrics 0.04266150000000124
Surrogate Model Generation 3.7771588000000023
surrogate sim 1.2653497999999992
surrogate sim, dt 3.4258430000000004

To:

Test Time (s)
import main 0.17017559999999987
import thrown object 0.6386399
model initialization 0.14835660000000006
set noise 0.8472294000000002
simulate 0.37026950000000003
simulate with saving 1.2000061000000004
simulate with saving, dt 1.3134587
simulate with printing results, dt 1.5758315000000005
Plot results 18.0212329
Metrics 0.043040200000000084
Surrogate Model Generation 3.922702000000001
surrogate sim 1.3951382000000017
surrogate sim, dt 3.7976031000000035
codecov-commenter commented 1 year ago

Codecov Report

Merging #542 (8febff5) into dev (8febff5) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 8febff5 differs from pull request most recent head 58c3f1a. Consider uploading reports for the commit 58c3f1a to get more accurate results

@@           Coverage Diff           @@
##              dev     #542   +/-   ##
=======================================
  Coverage   80.31%   80.31%           
=======================================
  Files          30       30           
  Lines        2444     2444           
=======================================
  Hits         1963     1963           
  Misses        481      481           
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.17194510000000007
import thrown object 0.6253575
model initialization 0.18285830000000014
set noise 0.856811
simulate 0.43933240000000007
simulate with saving 1.3678087000000003
simulate with saving, dt 1.4699933000000005
simulate with printing results, dt 1.8873282000000007
Plot results 21.5118401
Metrics 0.048631400000001435
Surrogate Model Generation 4.4247007000000025
surrogate sim 1.5971516999999977
surrogate sim, dt 3.8874232000000006

To:

Test Time (s)
import main 0.1697592000000001
import thrown object 0.6506822000000001
model initialization 0.1701997000000004
set noise 0.822244
simulate 0.4329752
simulate with saving 1.3433099999999998
simulate with saving, dt 1.4760913999999996
simulate with printing results, dt 1.8190838999999999
Plot results 21.194498199999998
Metrics 0.0517778999999976
Surrogate Model Generation 4.443295500000001
surrogate sim 1.5774361
surrogate sim, dt 3.9781211000000027
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.1746356
import thrown object 0.6202713000000002
model initialization 0.17673439999999996
set noise 0.8496142999999998
simulate 0.41936209999999985
simulate with saving 1.3568512999999998
simulate with saving, dt 1.4546858
simulate with printing results, dt 1.8994686000000005
Plot results 21.7841191
Metrics 0.046236100000001557
Surrogate Model Generation 4.490914200000002
surrogate sim 1.6667131999999967
surrogate sim, dt 4.111645700000004

To:

Test Time (s)
import main 0.16628379999999998
import thrown object 0.6593656999999999
model initialization 0.1712180000000001
set noise 0.8414695000000001
simulate 0.42920999999999987
simulate with saving 1.3966314999999998
simulate with saving, dt 1.4806461000000004
simulate with printing results, dt 1.8582192999999991
Plot results 21.549768
Metrics 0.04532959999999875
Surrogate Model Generation 4.572632300000002
surrogate sim 1.6315585000000041
surrogate sim, dt 4.0283175
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.13065649999999995
import thrown object 0.5079442000000001
model initialization 0.12366919999999992
set noise 0.6434981
simulate 0.3012686000000002
simulate with saving 0.9570566
simulate with saving, dt 1.0451486999999995
simulate with printing results, dt 1.2476085999999995
Plot results 14.8847129
Metrics 0.03663020000000117
Surrogate Model Generation 3.291631200000001
surrogate sim 1.1073598000000011
surrogate sim, dt 3.021931200000001

To:

Test Time (s)
import main 0.12851279999999998
import thrown object 0.5047165
model initialization 0.12112389999999995
set noise 0.6665430999999999
simulate 0.2994721
simulate with saving 0.9420647
simulate with saving, dt 1.0345371
simulate with printing results, dt 1.2559104000000003
Plot results 14.883751700000001
Metrics 0.035860499999998297
Surrogate Model Generation 3.3390669000000024
surrogate sim 1.0904797999999971
surrogate sim, dt 2.9561787000000024
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.1644002
import thrown object 0.6321089
model initialization 0.17514660000000015
set noise 0.8119300000000003
simulate 0.42718190000000034
simulate with saving 1.3453078000000005
simulate with saving, dt 1.4645598
simulate with printing results, dt 1.861378199999999
Plot results 21.7570274
Metrics 0.04691520000000082
Surrogate Model Generation 4.355067000000002
surrogate sim 1.6596609999999998
surrogate sim, dt 4.0488789999999995

To:

Test Time (s)
import main 0.16532360000000001
import thrown object 0.6080352999999998
model initialization 0.18673790000000023
set noise 0.8522939999999997
simulate 0.41391389999999983
simulate with saving 1.3963706000000005
simulate with saving, dt 1.4132907000000001
simulate with printing results, dt 1.8372109000000005
Plot results 20.894350600000003
Metrics 0.04584270000000146
Surrogate Model Generation 4.4198637000000005
surrogate sim 1.5830085999999994
surrogate sim, dt 3.907677100000001
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.12620229999999988
import thrown object 0.5060377999999999
model initialization 0.11810239999999994
set noise 0.6777063999999999
simulate 0.2965266
simulate with saving 0.9082571000000002
simulate with saving, dt 1.0268905
simulate with printing results, dt 1.2465462
Plot results 13.988912200000001
Metrics 0.039248299999997016
Surrogate Model Generation 3.1340289000000006
surrogate sim 0.9891867999999988
surrogate sim, dt 2.8629849000000007

To:

Test Time (s)
import main 0.1267543
import thrown object 0.5024862999999999
model initialization 0.11578869999999997
set noise 0.6689723999999999
simulate 0.30452060000000003
simulate with saving 0.9306486999999999
simulate with saving, dt 1.0420281999999998
simulate with printing results, dt 1.2637721000000006
Plot results 13.923174999999999
Metrics 0.04172110000000018
Surrogate Model Generation 3.238303300000002
surrogate sim 0.991364100000002
surrogate sim, dt 2.8763239000000027
github-actions[bot] commented 1 year ago
Benchmarking Results [Update] From: Test Time (s)
import main 0.12865309999999985
import thrown object 0.5015416000000001
model initialization 0.11779739999999994
set noise 0.6680122999999998
simulate 0.3007624
simulate with saving 0.912912
simulate with saving, dt 1.0340257999999998
simulate with printing results, dt 1.2602794
Plot results 14.251669
Metrics 0.03901679999999885
Surrogate Model Generation 3.1925966000000017
surrogate sim 1.001777899999997
surrogate sim, dt 2.9014550999999997

To:

Test Time (s)
import main 0.12625949999999997
import thrown object 0.5086248
model initialization 0.11518169999999994
set noise 0.6676116000000001
simulate 0.30421070000000006
simulate with saving 0.9193648999999997
simulate with saving, dt 1.0380224000000005
simulate with printing results, dt 1.2541556000000007
Plot results 14.0697842
Metrics 0.04006959999999893
Surrogate Model Generation 3.2969414000000015
surrogate sim 0.9963742000000018
surrogate sim, dt 2.8629419000000027