Hi,
I am trying to solve 2 simulations sequentially, and use an output from the first simulation as an input to the second. This output is a function of both space and time, j(x,t). I have 2 questions:
I’m trying to use an interpolant to do this, although this doesn’t seem ideal, since there is no need to interpolate in space, as the two simulations are defined on the same mesh - is there a better way to do this?
I’m getting errors using the interpolant, and I’m wondering if it’s not supposed to be used with a SpatialVariable? I am defining the interpolant as follows:
@isaac_basil the sim.solve function has a starting_sol argument which takes the final step of a previous solution and uses it as the first step of a new simulation. Is that what you’re looking for?
Hi @Marc thanks for your reply. Unfortunately I need access to the solution at all time steps, so I don’t think that will work for me. Essentially I need to be able to use my solution from Simulation 1 to define j(x,t) which I can use in Simulation 2.
In theory I should be able to do this all in a single simulation. But I’m having problems with that, so I am trying to split into 2 steps to debug.
Hi @Marc that’s a nice idea I will try that. On that note, I’m not sure where 17 has even come from, since I’m discretising the electrode using 40 nodes.
But how would you go about doing this @Marc ? I’ve only used concatenations to combine symbols that are defined on two different domains, so I’m not sure how I could apply that in this case, where each symbol is relevant to a particular x node.