0% found this document useful (0 votes)
110 views22 pages

Python Simulation - PARTIAL DIFFERENTIAL EQUATION

1. The document discusses partial differential equations and uses the heat equation as an example. It describes how the heat equation can be used to model how heat diffuses through a given region over time. 2. It explains how the finite difference technique can discretize space and time to compute the temperature at a point using the temperatures at nearby points in previous time steps. 3. The technique uses initial conditions to determine the starting spatial temperature distribution and boundary conditions to determine fixed temperatures at the edges to iteratively solve for the temperature at each point as time steps forward.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views22 pages

Python Simulation - PARTIAL DIFFERENTIAL EQUATION

1. The document discusses partial differential equations and uses the heat equation as an example. It describes how the heat equation can be used to model how heat diffuses through a given region over time. 2. It explains how the finite difference technique can discretize space and time to compute the temperature at a point using the temperatures at nearby points in previous time steps. 3. The technique uses initial conditions to determine the starting spatial temperature distribution and boundary conditions to determine fixed temperatures at the edges to iteratively solve for the temperature at each point as time steps forward.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Partial differential equation

Doan Tung Anh


Partial differential equation (PDE):
relations between the

various partial derivatives of a multivariable function.


Heat equation
how a quantity such as heat diffuses
through a given region
Wave equation
how a quantity such as heat diffuses
through a given region
We cover the heat equation as example:
the temperature at the location

and time

is computed from the temperature values at


three points of an earlier time.
The solid boxed nodes on top correspond to
the known initial condition,
while the starred nodes correspond to the
unchanging boundary conditions.
The finite difference technique discretizes space and time on a lattice
we know the spatial dependence of the solution at t = 0, we use a forward-difference
approximation for the time derivative incorporating the initial solution:
Because the boundary conditions provide the spatial variation of the temperature along the
entire top row and the left and right sides, we can use the more accurate central-difference
approximation for the space derivative.
Because the boundary conditions provide the spatial variation of the temperature along the
entire top row and the left and right sides, we can use the more accurate central-difference
approximation for the space derivative.
Because the boundary conditions provide the spatial variation of the temperature along the
entire top row and the left and right sides, we can use the more accurate central-difference
approximation for the space derivative.

3. Reorder into the form of an algorithm in which T can be stepped forward in time t = j∆t for
all of space x = i∆x starting with the initial conditions:
We cover the heat equation as example:

When the time and space derivatives are approximated in terms of finite differences, the

PDE becomes the finite difference equation:


You are given an aluminum bar of length L = 1 m and width w aligned along the
x axis. It is insulated along its length though not at its ends. Initially the entire
bar is at a uniform temperature of , and then both ends are placed in contact
with ice water at . Heat flows through the noninsulated ends only. Determine
how the temperature varies along the length of the bar as a function of time
Analytic solution:
Numerical approach solution:
MONTE CARLO METHOD
Coin Flip Example:

The probability of head for a fair coin is 1/2.

However, is there any way we can prove it

experimentally? In this example, we are going to

use the Monte-Carlo method to simulate the coin-

flipping iteratively 5000 times to find out why the

probability of a head or tail is always 1/2. If we

repeat this coin flipping many, many more times,

then we can achieve higher accuracy on an exact


Coin Flip Example:
Coin Flip Example:

You might also like