0:18

What we're going to discuss in this last lecture is

Â some practical issues that are involved in, in solving PDEs.

Â This was mentioned early on when, when PDEs were first

Â introduced the Huxley Model for propagating action potential, but as is

Â true with solving ODEs, it is also true that with

Â solving PDEs you have to convert the derivatives into discrete form.

Â But there's going to be a, a twist here, there's going to be a, a, an important

Â conceptual point that we need to make, which

Â is the difference between explicit solutions versus implicit solutions.

Â And we're not going to get into all the, all the details of, of the algorithms.

Â I feel like the algorithms that are involved in solving

Â partial differential equations are, are more appropriate for, for another class.

Â But, I do think, conceptually it's important to understand

Â what, what an explicit solution is and how that

Â is fundamentally different from implicit solutions and so this

Â lecturer is going to focus on this last part here.

Â The difference between that the two, which relates to the previous point,

Â what you do when you convert whatever it is into its discrete form.

Â 1:22

Here, once again, is a one dimensional

Â cable equation that we've encountered several times now.

Â Membrane capacitance times partial derivative of a

Â voltage with respect to time, is equal to

Â some constants times the second derivative of voltage

Â with respect to location, minus the ionic current.

Â And what we want to address in this last lecture, is.

Â What do you need to take into consideration and you

Â want to solve this a type of differential equation practice.

Â And we need to solve a partial differential equations

Â such as this partial differential equation that we see here.

Â As we've discussed the first thing we need to do

Â is we need to convert the derivatives into discrete forms.

Â Converting the time derivative into discrete forms we've already discussed.

Â Partial derivative of voltage with respect to time evaluated at node

Â j and evaluated at time t is approximately equal to voltage j

Â at future time t plus delta t minus voltage at node

Â j the current time t divided by the time step delta t.

Â 2:25

And then what about for the second derivative of

Â voltage with respect to x, with respect to the location?

Â If we evaluate that at node j, we've all, also discussed this approximation here.

Â So it's approximately equal to voltage of j plus 1, minus 2 times

Â voltage at j plus voltage j minus 1 divided by delta x squared.

Â But you notice here that we didn't specify what kind that

Â we are evaluation this second derivative of that, we have two

Â types we can choose from [UNKNOWN] choose time t or t

Â plus delta t and so that's what we have to address next.

Â Next what we have to address is when do we evaluate this spatial derivative.

Â I wrote this in a very generate form here I purposefully left off.

Â With time we are evaluating the second derivative at,

Â and depending on when we evaluate the second derivative, that's

Â going to dictate what kind of solution to our

Â partial differential equations that we're going to try to obtain.

Â And this is how we end up with this distinction

Â between explicit solutions versus implicit

Â solutions to partial differential equations.

Â It's this issue of when do we evaluate.

Â Of the derivative with respect to location.

Â 3:30

So, for explicit solutions, what you do is you solve for the

Â future value of voltage based on the current values of all your variables.

Â So when you evaluate the second derivative with respect to location over here on the

Â right-hand side of the equation, you see

Â that this approximation is implemented at time t.

Â So, these are all the current values of variables.

Â Similarly, we have to compute the ionic current.

Â We want to solve the cable equation.

Â And we compute the ionic current at time t.

Â So if with an explicit solution, what you do is evaluate your

Â second derivative with respect to location at the current time, at time t.

Â 4:06

If we make the other choice in terms of

Â when we evaluate the second derivative with respect to location.

Â If we evaluate this at the future time, then we end up with an implicit solution.

Â So, the difference between an explicit solution and an

Â implicit solution, can be seen on this slide here,

Â with an implicit we solve for the future values

Â of voltage, based on future values of a variables.

Â So what we've done in this case is we've evaluated a

Â second derivative with respect to location at time t plus delta t.

Â Similarly, we've calculated the ionic current at time t

Â plus delta t, at the future value of time.

Â So this is the fundamental difference between an explicit solution, like

Â we see here, and an implicit solution, like we see here.

Â What we're going to discuss next are some of the advantages and

Â disadvantages, of one category of solution versus the other category of solution.

Â There's a big advantage to explicit solutions, and that is

Â that explicit solutions of PDEs are very simple to implement.

Â We

Â 5:09

When we explicitly looked at our approximations to our derivatives.

Â And we can rearrange this with, you know, very simple algebra.

Â So that everything that's in the future is on the left-hand

Â side and everything that's in the present is on the right-hand side.

Â And when we look in the future, we

Â only have one variable that we need to calculate.

Â What's the voltage at node J?

Â At time t plus delta t.

Â And we can calculate what this is.

Â It's a function of all the stuff on the right-hand side, that's

Â all at the current time, so these are all things that we know.

Â And this gives us a relatively simple formula

Â for how we compute how the voltage evolves.

Â So in this case, we, you know, it's not just a voltage at node

Â j, we also have similar equations for the voltage at node j plus 1,.

Â Will J minus one ect.

Â But conceptually this is not very complicated.

Â This is just like an oilers message solution here.

Â What we've basically done with this particular

Â explicit solution is we've take our partial

Â differential equation and we've converted this into

Â a large system of ordinary differential equations.

Â 6:09

So when you.

Â Take this approximation here for the second

Â derivative of voltage with respect to location.

Â What you're basically doing is simply saying, okay, instead of

Â just solving, you know, one ODE for a single value of

Â voltage, now if I have 50 nodes, I'm going to solve for

Â 50 voltages, and now I'm going to convert that into 50 ODEs.

Â So we just convert our PDE.

Â Into a large system of ODEs.

Â 6:47

But there's a big disadvantage with these explicit solutions, is

Â that people who have done, you know, advanced numerical mathematics.

Â And analyze these types of algorithms very rigorously.

Â They've demonstrated, they've proven that for these sorts of solutions to be stable,

Â your time step has to scale with your your voltage step squared.

Â So let's say that you had a, a solution where you

Â said okay, how much how much spatial discretization do I need?

Â Do I need, is it okay to, to look at

Â how things vary in space over like a, a millimeter scale?

Â Well if you say a millimeter scale's okay, then

Â you, you say well okay, actually a millimeter's not enough.

Â I need to actually get a finer spacial resolution.

Â I need to look at like a micrometer.

Â Well a micrometer is a thousand times smaller than a millimeter.

Â And so, your time step.

Â If you went from a millimeter resolution to a micrometer resolution.

Â Your time step would have to get 1000 times

Â 1000, Or, in other words, a million times smaller.

Â And this is the biggest disadvantage

Â with explicit solutions of partial differential equations.

Â Is that, in a lot of, cases of biological interest, where

Â your spatial discretization has to be relatively relatively fine in order for

Â you to see the details that you want to see, then you

Â are, your time step has to get smaller and smaller and smaller.

Â And therefore the explicit solutions can take a very long time to run.

Â And the reason that explicit solutions of partial

Â differential equations can take so long to run.

Â It's because of this property here because the, the time step

Â has to scale with, the spatial discrimination raised to the second power.

Â 8:22

So, every time, you know, when you write a

Â partial differential equation, you might get a solution with

Â a, with a very coarse spacial discrimination and you

Â say to yourself, okay, I want that to be better.

Â I want to have a more resolution, and when you get more

Â resolution it comes at a great cost in terms of the computation time.

Â And that's the biggest disadvantage of explicit solutions.

Â Implicit solutions of PDEs, when we contrast them with

Â explicit solutions of PDEs, have basically opposite strengths and weaknesses.

Â One of the challenges of implicit solutions of PDEs is

Â that they're conceptually more difficult to wrap your head around.

Â Here we have a, a pure or

Â complete implicit discreditation of our cable equation.

Â Where we've evaluated our second derivative of voltage

Â with respect to location at t plus delta t.

Â And we are also computing the ionic current at t plus delta t.

Â And if we think about this last part here,

Â computing the ionic current, at t plus delta t.

Â We can see how, how challenging this would be, because if you want to compute

Â the ionic current at t plus delta t, then you need to know not just

Â what the voltage is going to be in the future, but you also need to

Â know what the m gate is going to be in the future, and the h gate.

Â And the n gate, and sort of figuring out

Â what those values are going to be at the next

Â time stop.ho isn't easy, because those in turn are

Â going to depend on voltage, so, everything depends on one another.

Â Computing the ionic current in the future is, is a tremendous challenge.

Â 9:46

So, it's usually done in practice, is that the reaction term,

Â this ionic current over here, this reaction current is created explicitly.

Â What were evaluating the ionic current at time t.

Â And then the diffusion term is often treated implicitly.

Â 10:17

But even if we make the simplification where

Â we have, where we treat part of this implicitly

Â and we treat part of this explicitly, this,

Â we still have three unknowns in this equation here.

Â We want to rearrange this particular equation

Â here where we put all, everything that's in

Â the future on the left-hand side and everything

Â that's in the present on the right-hand side.

Â We end up with this equation here.

Â Where we have a bunch of consonants times the voltage and j plus 1.

Â If no j plus 1, then times t plus delta t.

Â 10:46

Some other consonants here times the voltage and no j at t plus delta t.

Â And then here we have voltage at j minus 1 and time t plus delta t.

Â So we still have this voltage.

Â And this voltage and this voltage that that are all unknowns,

Â and we only have these two terms over here on the right hand side.

Â So, we need to solve for this

Â voltage and this voltage and this voltage simultaneously.

Â We can't just make a very simple equation like

Â we did for the explicit solution where we said.

Â Future voltage depends on a lot of things that we know.

Â We have to solve for all three, voltages at the same time.

Â So to solve for the three unknown

Â simultaneously, we're going to have to invert

Â a matrix, and in the next slide i'll show you what we mean by that.

Â 11:31

If we wanted to to an implicit solution of the Hodgkin Huxley equation.

Â We'd end up with a matrix equation that looks something like this.

Â Where we have a vector here of all of our

Â voltages from the first node up to the last node.

Â We're only focusing on the ones that are in the

Â middle, j minus 1, j plus1, and we would have.

Â 11:52

These terms here that are multiplying each of our voltages.

Â So, the way that we do a matrix

Â multiplication in which we discussed before, is you take

Â this coefficient times this voltage plus this coefficient

Â times this one, plus this one times this one.

Â And then we would do a matrix multiplication here and then

Â we would say that, or the result of this matrix multiplication.

Â Would be capacitance over delta t times our vector of all of our cur,

Â current times minus the i in a current, all evaluated at, at the current time.

Â So our implicit solution of the Hodgkin Huxley equations would look like this.

Â And this is a matrix equation, we're

Â saying, so mars matrix a, that we've defined

Â here, times some vector ax, which is our unknown is equal to some other vector

Â B over here, which, which we're computing, based on what we know and this can

Â be solved by saying x is equal the inverse of a, times the vector b.

Â 12:52

But implicit solutions therefore involve inverting a

Â matrix, which can be a very complicated procedure.

Â So, this is the challenge of the implicit solutions, is

Â the fact that you have to solve for all of

Â your future variables at the same time, and that converts

Â it into a, into a very complex sort of matrix -.

Â 13:12

Equation format, rather than a relatively simple format

Â where you can say, I can compute my current

Â voltage at this particular node, in the future,

Â just based on a bunch things I already know.

Â This is again, just to reiterate the point

Â that we've made, which is that implicit solutions

Â are conceptually challenging even if they're, they can

Â be a lot faster than, than explicit solutions.

Â They involve solving for a lot of the variables

Â at the next time step, all at the same time.

Â 13:40

Therefore, to summarize this lecture on some practical

Â considerations, in solving partial differential equations, one thing

Â we've seen is that solving PDEs, just like

Â solving ODEs, requires converting derivatives into a discrete form.

Â 13:55

And we have also seen that a spatial derivatives are evaluated

Â at the current time, this implies an explicit solution of the PDE.

Â These are evaluated at a future time, this is

Â what will give us an implicit solution of the PDE.

Â And finally we see that explicit solutions are conceptually rather

Â straight forward, but these can be very slow to run.

Â Implicit solutions can be faster than explicit solutions,

Â but they are a lot more challenging, to implement.

Â [BLANK_AUDIO]

Â