pybamm-team / PyBaMM

Fast and flexible physics-based battery models in Python
https://www.pybamm.org/
BSD 3-Clause "New" or "Revised" License
1.09k stars 537 forks source link

You can do that using post-processed variables after you have solved your `simulation`. Then, you can define your post-processed variable as #1498

Closed ssingh-ipa closed 3 years ago

ssingh-ipa commented 3 years ago

You can do that using post-processed variables after you have solved your simulation. Then, you can define your post-processed variable as

c_n_surf = simulation.solution["Negative particle surface concentration [mol.m-3]"]

and you can find all the variables you can call in this notebook.

This returns an object c_n_surf which is an interpolant. Then, we can call that object and evaluate it at any point by doing

c_n_surf(x = 1e-5, t = 100)

Because this is a surface concentration, it only depends on x and t. If we chose the concentration in the particles it would depend on r, x and t and thus we would have to evaluate it for the three variables. Note that you can pass time as a vector to evaluate the variable at multiple times.

Originally posted by @brosaplanella in https://github.com/pybamm-team/PyBaMM/discussions/1295#discussioncomment-200716

valentinsulzer commented 3 years ago

Did you mean to open this as an issue?

ssingh-ipa commented 3 years ago

I meant top pose questions on a resolved issue.

From: Valentin Sulzer @.> Sent: Wednesday, June 2, 2021 7:32 PM To: pybamm-team/PyBaMM @.> Cc: Singh, Soumya @.>; Author @.> Subject: Re: [pybamm-team/PyBaMM] You can do that using post-processed variables after you have solved your simulation. Then, you can define your post-processed variable as (#1498)

Did you mean to open this as an issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/pybamm-team/PyBaMM/issues/1498#issuecomment-853243871, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APRHTSP7NJSIUGMWBG5TVDTTQZTHNANCNFSM457DL3KA.