transcribe

Chapter 10.1 - Time and Space Stepping Schemes

Nathan Kutz · 16m · transcribed Jul 2026
More from Nathan Kutz Business
𝕏 Share ▶ YouTube 📥 PDF 🤖 .md

Section Insights

# 0:07

Introduction to Time and Space Stepping Schemes

What are time and space stepping schemes?

Time and space stepping schemes are solution techniques for partial differential equations that allow us to march solutions forward in time.

  • Focus on marching solutions forward in time.
  • The method of lines is a key technique.
  • Considerations include accuracy and stability.
# 0:51

Historical Context of Calculus in Physics

How has calculus influenced the representation of physics?

Calculus, established by Newton and Leibniz, provides a language for expressing physics through relationships among derivatives.

  • Calculus enables the discussion of derivatives in physics.
  • Key equations like Maxwell's and Schrödinger's are based on derivatives.
  • Understanding derivatives is crucial for expressing physical laws.
# 0:33

Basic Time Stepping Schemes

What are the initial steps in constructing time stepping schemes?

Start with basic time stepping schemes, focusing on the heat equation, which has one time derivative and two space derivatives.

  • The heat equation is a simple starting point for time stepping.
  • Stability is crucial when constructing schemes.
  • Not all schemes are stable; careful construction is needed.
# 0:44

Discretization and Data Organization

How should data be organized for time stepping schemes?

Data should be organized into vectors and matrices, with periodic boundary conditions considered for the discretized spatial domain.

  • Data organization is essential for effective computation.
  • Periodic boundary conditions simplify the model.
  • Discretization impacts the choice of time steps.
# 0:45

Constructing the Differentiation Matrix

What is the role of the differentiation matrix in time stepping?

The differentiation matrix captures the second derivatives needed for the time stepping scheme, structured with specific values for stability.

  • The differentiation matrix is key for calculating derivatives.
  • Structure of the matrix affects stability and accuracy.
  • Understanding matrix construction is vital for solving PDEs.
# 0:44

Choosing Time Steps for Stability

How does the choice of delta x affect time stepping?

The choice of delta x significantly impacts the allowable delta t for stable solutions when marching forward in time.

  • Delta x and delta t are interdependent for stability.
  • Careful selection of discretization parameters is crucial.
  • Stable schemes yield accurate solutions.
# 0:51

Extending to Higher Dimensions

How do time stepping schemes apply to higher dimensions?

The principles of time stepping schemes extend to higher dimensions, requiring larger matrices and careful organization of data.

  • Higher dimensions increase computational complexity.
  • Matrix size grows with the square of the number of points.
  • Organization remains critical in multi-dimensional problems.
# 0:38

Method of Lines Explained

What is the method of lines in time stepping?

The method of lines involves updating solutions along a line in time, using neighboring points to calculate future values.

  • The method of lines discretizes both time and space.
  • Neighboring points are essential for updating solutions.
  • Stability and accuracy are primary concerns in this method.
# 0:56

Key Issues in Time-Space Stepping Schemes

What are the key considerations for time-space stepping schemes?

Key considerations include ensuring stability and accuracy in the representation of solutions as time progresses.

  • Stability is crucial for faithful solution representation.
  • Accuracy is a primary goal in time-stepping schemes.
  • Understanding key issues helps in constructing effective schemes.

Transcript

0:07 We're going to start talking about time and space stepping schemes. So this is basically solution techniques for partial differential equations. And what we really want to focus in on now is how do you march solutions forward in time. So this is called the method of lines in which we're going to construct progressively the solution at one time point which is we're going to call a line. advance the solution delta t into the future and that's going to be the line of delta t in the future. Advance it again to the future delta t. So now we're two delta t into the future and so forth and so on. There's a lot of considerations in how you might develop time stepping schemes. in fact we're going to show quite a diversity of ways you can develop time stepping schemes.

0:50 And one of the big primary considerations or there's two naturally that we want to consider. One is accuracy and the other is stability. You can't just simply make an iteration scheme and expect that it will actually be stable. In fact, many of the numerical stepping schemes we're going to consider are unstable. And so part of our job is to think about how do we construct stable schemes to march forward into the future. So I'm going to just remind you that since Newton and calculus so Newton laid down this foundation and livenets about how we take differentials and then within the context of this calculus two basic quantities of calculus which is differentiation and integration. We were able to construct the laws of physics.

1:34 Up to that point what we had was geometry and algebra. But now that we have calculus, we can start talking about we have a whole new language for representing physics. And in fact, all of physics engineering really is relationships among derivatives, both time and space. And that's how we express physics in these days. So let's give you an example. Here's Maxwell's equations for electronamics. so here's electric field E and the magn magnetic inductance B. And this is related to the electric magnetic field H. and so here are these quantities and how they evolve in time and in space. You can see the time derivatives are here and the space derivatives are basically in these curls and dots here divergences and curls. And so when we think about electromagnetism, it is a relationship among spacetime dictated by these derivative relationships. That's one way to think about it and Schroinger equation in the same way. This is the the underpinnings of quantum mechanics and how we evolve probability distributions in time and space for the location of of an electron for instance.

2:50 Navier Stokes same thing. How do we start talking about fluid packets conservation of mass and momentum? and then what we have here is again time derivative along with the quantities of interest is interest that we want to look at. So again all of this is relationships among derivatives and what we're going to focus in now is how do we evolve things forward in time. Okay in the last set of lectures we talked about all the things that you have to start thinking about once you do discretization. And so now let's start think about the things we're going to have to really consider when we're going to march forward in time.

3:31 So the place that we're going to start, we're going to start with some really basic timestepping schemes. Build from there towards how you can construct time stepping schemes and what their stability properties are. Those are the important things to be considering when you choose a scheme. Easiest place to start is the heat equation. It's got one time derivative, two space derivatives. So, seems very easy to handle, but we'll see that you can't just make up any scheme to make this thing march forward in time stably. So, we're going to talk about how you might construct schemes and what will happen. So, let's do the first basic scheme. we might look at is something like this where what we're going to do is take the second derivative and use a center difference formula second order center difference formula which says if you take two derivatives the derivative formula says you have minus2 of the current point you're at one of the point in front one of the point behind okay so x plus delta x x - delta x and this is how you compute a second derivative immediately what we've done here is a discretization where we're going Look at this along the x direction with a grid size of delta x. We've already talked about discretization and all the things that discretization implies, but now we're going to use this for this time stepping scheme. Okay, once you've got this, we're going to organize the data. So let's go back to our discretization scheme here. Organization of the data is we're going to make a vector u. And u will contain all the points from going from negative L negative L plus delta X negative L plus 2 delta X all the way to U of L which is the end point here which is the input point. We're going to have periodic boundary conditions on this to start with. So first is the organization of the data and the data matrix here U gives you all the discrete points in the spatial domain of U. Okay. So this going to be a vector. Everything is going to be discretized into vectors and matrices. So once we have this vector formulation of the heat equation, in other words, we've discretized this. Now we start to figure out how do we represent this in terms of differential equations.

5:45 So here's the equation again. And now the claim is that once you've done this, this second order derivative just turns out to be a differentation matrix A. And so in fact remember that we take the difference divided by delta x squ. So there's the d delta x squ here is the diffusion constant. The matrix a itself takes this structure here. It's -2 along the diagonal. So you can see that here that if you walk down this diagonal right you're going to have -2s and then one on the off diagonals on either side.

6:17 And that's just due to the structure of this formula here. -2 one and one. So what that's what you have in terms of this partial differential equation turning into a differential equation of size n. Okay. And the size n is just simply based upon how you discretise the size of of your domain. Now it turns out picking the delta x that you might have here has an enormous impact on the time step you're going to have to take here when you march forward in time. You might be tempted to say, "Oh, I could just, you know, use an OD solver here."

6:56 In fact, you could. But we're going to talk a little bit more care in more detail that you can't you have to be very careful what you do at this next step in terms of picking out your time step after you've discretized. So let's first of all build a little code for how we might in fact solve this. So first you're going to define the the domain. So some t-span on which I'm going to solve this from zero to you know I'm going to solve this from 0 to two and steps of 0 2. So this is where I'm going to write out the data. Okay.

7:26 I'm going to break it up into 100 points. I'm going to pick the diffusion constant be one and domain length to be 20. So this is what I've got here. And so first I define my domain. Then it's going to be a linear space goes from negative L /2 to L /2 in N plus1 points. Remember I'm going to do periodic boundary conditions. So the last point is the same as the first and that's what I've done here is I've just taken the first n points and my dx is just the difference between the two points themselves. So I've set up my domain and my discretization and again this choice here of you know of picking the number of points I have which is 100 determines the delta x right so once I've decided a domain size and if I cut it into 100 points that determines the delta x turns out that delta x will have a big impact on how we choose to time step forward and how big of delta t's we can take marching forward to get stable solutions and that's really what we're concentrating on on these next set of lectures is how do you set up stable schemes for yourself so that you can get accurate solutions that are true and faithful solutions to the system and not blow up or go unstable.

8:43 So let's now build that matrix A. The matrix has -2 on the diagonals, one on the off diagonals. Again, we're going to use the SB diag which is the sparse diagonal matrix structure. So I'm going to make a vector of ones and I'm going to tell it what I want to do is put ones -2 one and where I'm going to put them is on the off diagonal the diagonal and the off diagonal. So this is where I'm going to what I'm going to put down where I'm going to put it down and here is the simple matrix that I'm going to use for this and it's an n byn. So once I have that I've got my basic matrix structure I put in the boundary conditions here due to periodic boundaries. So one on each corner of that matrix. And now what I have is my differentiation matrix. And this takes two derivatives in space with periodic boundary conditions. So if I take a vector and multiply by this matrix, it takes two derivatives subject to periodic boundary conditions. So I've got all the ingredients I need to now solve this system of differential equations, which was the originally the PTE is now OD set. And so I can just basically take this for instance and if you are going to use an OD solver all you have to do is define the right hand side which is k over dx^2 a * u and you just call this od solver where you put in you call the right hand side give it an initial condition give it a t-span the arguments you want to send in. So this in other words this is sort of framing it the way we've already talked about ODEs and now this is framing it back in terms of a simply a classic OD we od way of thinking about it if you want to step this forward so but what's disguised here is what about the stability properties how do we start thinking about if I pick a dx what does that mean for my dt because there's big implications they are not separate they are intimately entwined in terms of building stable stepping schemes.

10:44 By the way, this whole flow that we've done here follows through directly to if you go to higher dimensions. So for instance, I want to just show you what happens in 2D. So here's the 2D heat equation and the 2D heat equations. You have two derivis x, t twoism y. We've already seen how to discretise this matrix in our previous lectures to make a matrix A that when you organize the data it takes two derivis in X and two Y. But let's go and walk through a little bit here how it would look like.

11:14 Essentially when you do this you're going to discretize again into this matrix right into this OD solve right here which is U is a vector of all my points. a is the matrix that takes two deriv two deriv. I have a k and delta squar here and this is how I've arranged my data. Now we've already shown how to do this. So again goes back to organizational principles. It is your job to organize all this data in a meaningful way and this is how we're going to organize the data into a vector. So in other words, even though it's two-dimensional or you solve threedimensional problems, you're always going to organize it into a vector. And then derivatives are simply going to be matrix multiplies.

11:59 First derivative, second derivative, two deriv x and y. You're going to construct these matrices that act on the vector to produce the derivatives you want. Okay, so this is the organization of the data. Let's talk about how we might do this in practice for coding. So you might define an x domain, a y domain, in this case each 20. You decide the discretization in each domain. Here it is 100 in each domain. And what we know is we're going to have the total size of this matrix is going to be nx * n y. So if I've chopped this up into 100 points in x, 100 points in y, then the whole the all the the number of ods I'm solving for is 100 squared, right? So 100 points in one direction another I've got myself a 10,000x 10,000 system of equations to solve with my OD solver. So you can see as I make it more and more refined in space and in space as I discretise finer and finer I get a larger and larger system of differential equation that goes like the square of the number of points. So keep that in mind because that's your computational cost you have to deal with. now. Okay. So, that's important when you think about it because partly what you'd like to do is solve the sol get the solution as quickly as possible, as accurately as possible. And so, making good choices here, make good choices really important. Okay, so that's how we think about it. and then I can decide on sort of how to define the domains. Here's the x domain.

13:38 So in other words, I'd break chop it up into X into 100 101 points and I just take the first 100. Remember, I'm assuming periodic boundary conditions. Same same for the Y. And then I mesh grid it to get a two-dimensional representation. And then I pick an initial condition. I reshape this. So that's the important thing. At the end, I'm going to reshape all my all my two-dimensional data into 1D. And I already would have the matrix A that we built in the last set of lectures which takes two derivis X two deris Y with periodic boundary conditions. And so once I have that when I call the OD solver it's exactly like the 1D case except for now the matrix A is much bigger. The m the initial condition U is much bigger because now I'm in two dimensions. So instead of a 100 points coming in when I discretize I have now 10,000 ODEs I'm solving simultaneously.

14:33 So ba basically what we're philosophically doing is the reason this is called the method of lines is because what we start with is at time zero the solution along this line here which is the t0 line. Okay. And what we do is we update solution. We're using our neighbors because it's a second derivative. And the second finite difference scheme we use for the second derivative relies on neighbors to update the future point. And so that's what this means here. So as I update to the next line of solutions, which is T1, I'm using at each point the previous history of neighbors of two neighbors plus the point itself to get T1. I advance it again to the next line, the next line, and so forth. So I march the solution forward in time along these different timelines. Okay, so time is discretized, space is discretized. We've spent a lot of time already talking about spatial discretization and looking at how you would take care of and handle the commitment to discretizing space. And now we're going to focus in on this process of marching forward in time. So that's the basic structure here. and the con the where we really want to spend our effort is thinking about a stability of schemes when we march forward in time. We want to make sure we have a faithful representation of the solution. and of course we want as accurate a solution as possible as well.

16:07 So we're going to cover some of the key issues we have to think about in these time space stepping schemes here in what follows.

Summary

The discussion focuses on time and space stepping schemes for solving partial differential equations (PDEs), particularly through the method of lines. This approach involves advancing solutions in time while considering accuracy and stability, crucial for ensuring that numerical methods yield reliable results.

- The method of lines constructs solutions progressively in time, advancing by a time step (Δt).
- Key considerations for developing time stepping schemes include accuracy and stability; many naive schemes can be unstable.
- Calculus, particularly differentiation and integration, provides the framework for expressing physical laws through derivatives.
- Examples from physics, such as Maxwell's equations and the Schrödinger equation, illustrate the relationship between time, space, and derivatives.
- The heat equation serves as a foundational example for constructing basic time stepping schemes, emphasizing the importance of discretization.
- The choice of spatial discretization (Δx) significantly impacts the allowable time step (Δt) for stability in numerical solutions.
- The organization of data into vectors and matrices is essential for implementing numerical methods, especially in higher dimensions.
- The computational cost increases with finer discretization, as the number of equations to solve grows quadratically with the number of spatial points.

Questions Answered

What are time and space stepping schemes?

Time and space stepping schemes are solution techniques for partial differential equations that allow us to march solutions forward in time.

How has calculus influenced the representation of physics?

Calculus, established by Newton and Leibniz, provides a language for expressing physics through relationships among derivatives.

What are the initial steps in constructing time stepping schemes?

Start with basic time stepping schemes, focusing on the heat equation, which has one time derivative and two space derivatives.

How should data be organized for time stepping schemes?

Data should be organized into vectors and matrices, with periodic boundary conditions considered for the discretized spatial domain.

What is the role of the differentiation matrix in time stepping?

The differentiation matrix captures the second derivatives needed for the time stepping scheme, structured with specific values for stability.

How does the choice of delta x affect time stepping?

The choice of delta x significantly impacts the allowable delta t for stable solutions when marching forward in time.

How do time stepping schemes apply to higher dimensions?

The principles of time stepping schemes extend to higher dimensions, requiring larger matrices and careful organization of data.

What is the method of lines in time stepping?

The method of lines involves updating solutions along a line in time, using neighboring points to calculate future values.

What are the key considerations for time-space stepping schemes?

Key considerations include ensuring stability and accuracy in the representation of solutions as time progresses.

© transcribe · For agents Built with care and craft by Gokul Rajaram