Creating a custom DFN model with custom parameters #1468
-
Hi, I have a simple question about how to create a custom DFN model similar to what is explained in the Is there a way to add parameters as well one by one like for cathode, anode, separator and sei/no sei? Secondly, is there a way to extract all the input parameters as a csv file, that can be read as an input to create a new model? I tried Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Look out for #1458 which when it is done should answer all your questions (@Saransh-cpp ) The model only needs the parameters that are actually in the model. So if you use the no_sei model and don't give any SEI parameters, it shouldn't error. Parameters are defined separately for each part (though we call it negative electrode instead of anode). You can pick and choose different components. Also, once you have created the Not sure what you mean for the last one. You can save the parameters dictionary to a csv using inbuilt python functions, but it won't include functions. Why do you need to go via the csv? Can you give an example? |
Beta Was this translation helpful? Give feedback.
-
Hi Saransh,
Thank you for your email and working on the issue. However, I tried to run
some example scripts and it throws an error message during solving. The
error comes in the "casadi.py" file with the following error message:
AttributeError: 'DM' object has no attribute '__isnan__'
Let me know if I am missing something. This error I got even when trying
the simplest example script of "DFN.py"
Thanks for your response in advance.
Regards,
Vishank
…On Fri, May 14, 2021 at 11:14 AM Saransh Chopra ***@***.***> wrote:
@vishankkumar <https://github.com/vishankkumar> now that #1471
<#1471> is merged, could you
please try running your script again after pulling the latest code from the
develop branch? Let us know if you face any issues.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1468 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHVFG6WVKHM4YFE5SCXZ66DTNTSXLANCNFSM43VBRO2Q>
.
|
Beta Was this translation helpful? Give feedback.
-
Sure,
Here is the full error I got:
File
"/home/vishank-hp/miniconda3/lib/python3.7/site-packages/casadi-3.5.2b1-py3.7-linux-x86_64.egg/casadi/casadi.py",
line 83, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" %
(class_type.__name__, name))
AttributeError: 'DM' object has no attribute '__isnan__'
Let me know if you need some other details to resolve this issue. Just FYI,
I pulled the latest version of "develop" branch and recompiled by using
"python setup.py develop"
Regards,
Vishank
…On Fri, May 21, 2021 at 10:22 PM Saransh Chopra ***@***.***> wrote:
Could you paste the whole error here? I tried running the script on my
side and everything worked fine.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1468 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHVFG6RFLV4XVIOAVVJ22I3TO26HXANCNFSM43VBRO2Q>
.
|
Beta Was this translation helpful? Give feedback.
-
Hello Valtentin,
Thank you for your reply, I did pip install -e ., but still the same error. pip
show pybamm gave the following message:
Name: pybamm
Version: 0.4.0
Summary: Python Battery Mathematical Modelling.
Home-page: https://github.com/pybamm-team/PyBaMM
Author: None
Author-email: None
License: UNKNOWN
Location: /home/vishank-hp/github/PyBaMM
Requires: numpy, scipy, pandas, anytree, autograd, scikit-fem, casadi, jax,
jaxlib, jupyter, pybtex, matplotlib
Required-by:
Let me know if I am making a mistake.
Thanks and regards,
Vishank
…On Tue, May 25, 2021 at 5:52 PM Valentin Sulzer ***@***.***> wrote:
If you do pip install -e . you don't need to recompile every time you
pull changes from develop
That looks like an old error. What does pip show pybamm give?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1468 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHVFG6WEESSFLMDX3IHAEITTPPBVTANCNFSM43VBRO2Q>
.
|
Beta Was this translation helpful? Give feedback.
Look out for #1458 which when it is done should answer all your questions (@Saransh-cpp )
The model only needs the parameters that are actually in the model. So if you use the no_sei model and don't give any SEI parameters, it shouldn't error.
Parameters are defined separately for each part (though we call it negative electrode instead of anode). You can pick and choose different components. Also, once you have created the
ParameterValues
object, you can update any individual parameters using.update
Not sure what you mean for the last one. You can save the parameters dictionary to a csv using inbuilt python functions, but it won't include functions. Why do you need to go via the csv? Can…