-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Issue 685 casadi interpolation #714
Conversation
…ssue-685-casadi-interpolation
Codecov Report
@@ Coverage Diff @@
## master #714 +/- ##
==========================================
+ Coverage 98.17% 98.18% +0.01%
==========================================
Files 176 175 -1
Lines 9135 9089 -46
==========================================
- Hits 8968 8924 -44
+ Misses 167 165 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, thanks @tinosulzer !
@@ -22,7 +22,7 @@ | |||
"\n", | |||
"In this notebook we will use the SPM as the example model, and change the input current from the default option. If you are not familiar with running a model in PyBaMM, please see [this](./models/SPM.ipynb) notebook for more details.\n", | |||
"\n", | |||
"In PyBaMM, the current function is set using the parameter \"Current function\". By default this is set to be a constant current provided by the class [`pybamm.GetConstantCurrent`](https://pybamm.readthedocs.io/en/latest/source/parameters/standard_current_functions/get_constant_current.html). This class takes a single optional argument \"current\" which is the size of the current in Amperes. If no argument is passed, the value of the current is set by the parameter \"Typical current [A]\" (see [this](parameter-values.ipynb) notebook for more information about parameters).\n", | |||
"In PyBaMM, the current function is set using the parameter \"Current function\". By default this is set to be a constant current provided by the class [`pybamm.ConstantCurrent`](https://pybamm.readthedocs.io/en/latest/source/parameters/standard_current_functions/get_constant_current.html). This class takes a single optional argument \"current\" which is the size of the current in Amperes. If no argument is passed, the value of the current is set by the parameter \"Typical current [A]\" (see [this](parameter-values.ipynb) notebook for more information about parameters).\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the read the docs link now be constant_current instead of get_constant_current?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just looking at it now I can't find the page this was supposed to link to anyway. Getting rid of it in #699 so just going to leave it for now. We should look into finding a way to test hyperlinks in markdown/notebooks to make sure they exist
@@ -240,14 +212,14 @@ | |||
"source": [ | |||
"## Adding your own current function <a name=\"function\"></a>\n", | |||
"\n", | |||
"A user defined current function can be passed to any model using the class [`pybamm.GetUserCurrent`](https://pybamm.readthedocs.io/en/latest/source/parameters/standard_current_functions/get_user_current). The class takes in a method, which returns the current as a function of time, followed by any keyword arguments required by the method. \n", | |||
"A user defined current function can be passed to any model using the class [`pybamm.UserCurrent`](https://pybamm.readthedocs.io/en/latest/source/parameters/standard_current_functions/get_user_current). The class takes in a method, which returns the current as a function of time, followed by any keyword arguments required by the method. \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same re read the docs link here
@@ -479,3 +479,15 @@ def check_variables(self): | |||
var | |||
) | |||
) | |||
|
|||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@@ -34,8 +34,22 @@ def default_geometry(self): | |||
|
|||
@property | |||
def default_var_pts(self): | |||
# Choose points that give uniform grid for the standard parameter values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense. is this the case for li-ion too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought I needed this to make one of the tests work but it turned out to be an issue with the solver. I guess we could add functionality so that the user can pass in grid points for, say, x_n, and then "uniform" for the other two, and it automatically selects the right number of points to make the grid uniform?
Description
Fixes #685
Should allow fixing #463 by testing examples both with and without the optional solvers (requires changing scikits dae solver example to casadi, or skipping).
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: