Skip to content

How to evaluate a variable at a particular position/time #1295

Discussion options

You must be logged in to vote

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 eva…

Replies: 1 comment 4 replies

Comment options

brosaplanella
Dec 12, 2020
Maintainer Author Sponsor

You must be logged in to vote
4 replies
@ssingh-ipa
Comment options

@valentinsulzer
Comment options

@ssingh-ipa
Comment options

@valentinsulzer
Comment options

Answer selected by brosaplanella
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants