Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct constraint equation 30 to be upper bound #3041

Conversation

timothy-nunn
Copy link
Contributor

@timothy-nunn timothy-nunn commented Jan 31, 2024

Description

Corrects constraint equation 30 to be an upper bound.

Checklist

I confirm that I have completed the following checks:

  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@timothy-nunn
Copy link
Contributor Author

Before the change:

  • large-tokamak with f-values: pinjmw = 75.398
  • large-tokamak without f-values: does not converge unless fpinj=0.25

After the change:

  • large-tokamak with f-values: pinjmw = 80.143
  • large-tokamak without f-values: pinjmw = 85.831

NOTE: the large-tokamak regression test converges on a different (still valid) point, I presume due to the solver taking a slightly different path.

@timothy-nunn
Copy link
Contributor Author

@timothy-nunn timothy-nunn marked this pull request as ready for review February 1, 2024 16:44
@timothy-nunn timothy-nunn requested a review from kj5248 February 1, 2024 16:45
kj5248
kj5248 previously approved these changes Feb 1, 2024
@timothy-nunn timothy-nunn requested a review from kj5248 February 1, 2024 16:46
@timothy-nunn timothy-nunn removed the request for review from kj5248 February 1, 2024 16:46
@timothy-nunn timothy-nunn marked this pull request as draft February 1, 2024 16:46
@timothy-nunn
Copy link
Contributor Author

New solution found:

WARNING  scenario:scenario.py:223 Variable                     Ref             New        Diff (%)
WARNING  scenario:scenario.py:226 ------------------------------------------------------------
WARNING  scenario:scenario.py:229 xcm001                      1.14            1.12           -1.38
WARNING  scenario:scenario.py:229 xcm002                      1.07            1.08            0.09
WARNING  scenario:scenario.py:229 xcm003                       0.5           0.508            1.45
WARNING  scenario:scenario.py:229 xcm004                     0.532            0.54            1.45
WARNING  scenario:scenario.py:229 xcm005                     0.998           0.999            0.09
WARNING  scenario:scenario.py:229 xcm006                      1.63            1.67            2.77
WARNING  scenario:scenario.py:229 xcm007                     0.377           0.401            6.29
WARNING  scenario:scenario.py:229 xcm009                      1.03            1.02           -1.15
WARNING  scenario:scenario.py:229 xcm010                     0.861            0.87            1.08
WARNING  scenario:scenario.py:229 xcm011                      1.36            1.35           -0.68
WARNING  scenario:scenario.py:229 xcm012                     0.844           0.926            9.62
WARNING  scenario:scenario.py:229 xcm013                     0.931           0.903           -3.00
WARNING  scenario:scenario.py:229 xcm014                      1.08            1.05           -2.56
WARNING  scenario:scenario.py:229 xcm015                       1.1             1.1           -0.01
WARNING  scenario:scenario.py:229 xcm016                     0.999           0.958           -4.02
WARNING  scenario:scenario.py:229 xcm017                     0.999           0.958           -4.02
WARNING  scenario:scenario.py:229 xcm018                     0.998           0.996           -0.18
WARNING  scenario:scenario.py:229 xcm019                     0.984           0.997            1.31
WARNING  scenario:scenario.py:229 xcm020                     0.999           0.997           -0.22
WARNING  scenario:scenario.py:229 xcm021                     0.713           0.719            0.89
WARNING  scenario:scenario.py:229 xcm022                     0.439            0.43           -2.04
WARNING  scenario:scenario.py:229 xcm023                      0.93           0.901           -3.08
WARNING  scenario:scenario.py:229 xcm025                     0.963               1            3.87
WARNING  scenario:scenario.py:229 xcm026                     0.998           0.997           -0.17
WARNING  scenario:scenario.py:229 xcm027                     0.849           0.852            0.33
WARNING  scenario:scenario.py:229 xcm028                     0.919           0.929            1.08
WARNING  scenario:scenario.py:229 xcm030                      1.04            1.04            0.41
WARNING  scenario:scenario.py:229 xcm031                      1.09            1.08           -0.52
WARNING  scenario:scenario.py:229 xcm033                      1.11            1.15            3.52
WARNING  scenario:scenario.py:229 xcm034                      1.02            1.03            0.99
WARNING  scenario:scenario.py:229 xcm035                      1.01           0.993           -1.96
WARNING  scenario:scenario.py:229 xcm036                      1.05            1.08            3.24
WARNING  scenario:scenario.py:229 xcm037                     0.701           0.737            5.11
WARNING  scenario:scenario.py:229 xcm038                     0.535           0.564            5.52
WARNING  scenario:scenario.py:229 xcm039                         1               1            0.01
WARNING  scenario:scenario.py:229 xcm040                      1.05            1.05            0.04
WARNING  scenario:scenario.py:229 xcm041                       1.3            1.38            5.88
WARNING  scenario:scenario.py:229 xcm042                     0.853            0.84           -1.56
WARNING  scenario:scenario.py:229 xcm043                     0.652           0.648           -0.57
WARNING  scenario:scenario.py:229 xcm044                      1.48             1.5            1.44
WARNING  scenario:scenario.py:229 xcm045                     0.999            1.01            0.89

@timothy-nunn
Copy link
Contributor Author

timothy-nunn commented Feb 8, 2024

Some of the large changes in the output (>5%) are:

WARNING  scenario:scenario.py:223 Variable                     Ref             New        Diff (%)
WARNING  scenario:scenario.py:226 ------------------------------------------------------------
WARNING  scenario:scenario.py:229 acstf                    0.00157          0.0017            8.29
WARNING  scenario:scenario.py:229 albusa                       679             718            5.87
WARNING  scenario:scenario.py:229 albuswt                      585             619            5.87
WARNING  scenario:scenario.py:229 auxiliary_cd            1.85e+04        2.39e+05         1191.70
WARNING  scenario:scenario.py:229 c223                         226             240            6.30
WARNING  scenario:scenario.py:229 c2231                        226             240            6.30
WARNING  scenario:scenario.py:229 c22515                      33.3            35.3            5.87
WARNING  scenario:scenario.py:229 c22521                      2.79            2.96            6.07
WARNING  scenario:scenario.py:229 cpttf                   8.48e+04        8.98e+04            5.87
WARNING  scenario:scenario.py:229 cs_t2                   3.06e+07        2.61e+07          -14.86
WARNING  scenario:scenario.py:229 cs_t3                   3.06e+07        2.61e+07          -14.86
WARNING  scenario:scenario.py:229 divlife                      4.5            3.98          -11.53
WARNING  scenario:scenario.py:229 divlife.                     4.5            3.98          -11.53
WARNING  scenario:scenario.py:229 echpwr                      75.4            80.1            6.29
WARNING  scenario:scenario.py:229 echwpow                      151             160            6.29
WARNING  scenario:scenario.py:229 faccd                    0.00111          0.0144         1190.60
WARNING  scenario:scenario.py:229 fcohbof                    -0.17          -0.141           17.20
WARNING  scenario:scenario.py:229 icrit                   1.18e+05        1.25e+05            5.87
WARNING  scenario:scenario.py:229 insstrain               -0.00717        -0.00769           -7.22
WARNING  scenario:scenario.py:229 itfka                       84.8            89.8            5.87
WARNING  scenario:scenario.py:229 itvar007                   0.377           0.401            6.29
WARNING  scenario:scenario.py:229 itvar012                   0.507           0.555            9.62
WARNING  scenario:scenario.py:229 itvar038                   0.267           0.282            5.52
WARNING  scenario:scenario.py:229 itvar041                8.48e+04        8.98e+04            5.87
WARNING  scenario:scenario.py:229 jscoh_eof               4.01e+08        3.61e+08           -9.96
WARNING  scenario:scenario.py:229 jstrandoh_eof            1.2e+08        1.08e+08           -9.96
WARNING  scenario:scenario.py:229 ltfth                         33            30.2           -8.53
WARNING  scenario:scenario.py:229 n_cycle                      122             134            9.60
WARNING  scenario:scenario.py:229 pcurrentdrivemw            0.398            5.14         1192.87
WARNING  scenario:scenario.py:229 pfc0t4                  1.01e+06        9.28e+05           -8.06
WARNING  scenario:scenario.py:229 pfc1t4                 -1.46e+06       -1.58e+06           -8.52
WARNING  scenario:scenario.py:229 pfc4t1                  3.61e+05        3.26e+05           -9.57
WARNING  scenario:scenario.py:229 pfc5t1                  3.61e+05        3.26e+05           -9.57
WARNING  scenario:scenario.py:229 pheatingmw                   151             160            6.29
WARNING  scenario:scenario.py:229 pinjemw                     75.4            80.1            6.29
WARNING  scenario:scenario.py:229 pinjht                      75.4            80.1            6.29
WARNING  scenario:scenario.py:229 pinjmw                      75.4            80.1            6.29
WARNING  scenario:scenario.py:229 pinjmw.                     75.4            80.1            6.29
WARNING  scenario:scenario.py:229 pinjwp                       151             160            6.29
WARNING  scenario:scenario.py:229 ppfmw                       80.7            85.5            6.00
WARNING  scenario:scenario.py:229 ptfmw                       9.85            10.4            5.88
WARNING  scenario:scenario.py:229 qcl/1.0d6                 0.0185          0.0195            5.87
WARNING  scenario:scenario.py:229 r1dump                     0.118           0.102          -12.97
WARNING  scenario:scenario.py:229 rjohc                   4.03e+07        3.65e+07           -9.40
WARNING  scenario:scenario.py:229 rpower                      8.87            9.39            5.87
WARNING  scenario:scenario.py:229 rtfbus                   0.00123         0.00116           -5.55
WARNING  scenario:scenario.py:229 sig_tf_r_max(2)        -1.44e+08       -1.54e+08           -7.22
WARNING  scenario:scenario.py:229 tfacpd                      9.85            10.4            5.88
WARNING  scenario:scenario.py:229 tfpska                      89.1            94.3            5.87
WARNING  scenario:scenario.py:229 thkcas                     0.267           0.282            5.52
WARNING  scenario:scenario.py:229 vtfskv                      9.97            9.19           -7.86
WARNING  scenario:scenario.py:229 whtconsc                4.29e+03         4.7e+03            9.59

@timothy-nunn timothy-nunn force-pushed the 3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug branch from 3961135 to 28aa4e2 Compare February 8, 2024 10:51
@timothy-nunn timothy-nunn marked this pull request as ready for review February 8, 2024 10:53
@timothy-nunn timothy-nunn force-pushed the 3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug branch from 28aa4e2 to 8bbc1c7 Compare February 8, 2024 11:27
@timothy-nunn timothy-nunn requested a review from mkovari February 8, 2024 11:27
@timothy-nunn timothy-nunn merged commit 64885c2 into main Feb 8, 2024
20 checks passed
@timothy-nunn timothy-nunn deleted the 3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug branch February 8, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inequality constraint for injected power coded with the wrong sign[BUG]
3 participants