#1
Hi,

Does anyone know how I would go about using python to solve the equation:

∂u/∂t = α ∂^2u/∂x^2 - Heat equation

I think I should use the finite difference method and could start by making partitions but i'm not sure how to start coding this?

Any help is greatly appreciated.
0
4 weeks ago
#2
(Original post by Blaze3211)
Hi,

Does anyone know how I would go about using python to solve the equation:

∂u/∂t = α ∂^2u/∂x^2 - Heat equation

I think I should use the finite difference method and could start by making partitions but i'm not sure how to start coding this?

Any help is greatly appreciated.
You must have some boundary conditions as well?
https://stackoverflow.com/questions/...h-python-numpy
Has a simple implementation
0
#3
(Original post by mqb2766)
You must have some boundary conditions as well?
https://stackoverflow.com/questions/...h-python-numpy
Has a simple implementation
Thanks for that,

I'm given the boundary conditions
u(0, t) = T0 and u(L, t) = TL
t ∈ [0, tmax]

and the initial conditions for time t = 0
u(x, t0) = I(x)
0
4 weeks ago
#4
(Original post by Blaze3211)
Thanks for that,

I'm given the boundary conditions
u(0, t) = T0 and u(L, t) = TL
t ∈ [0, tmax]

and the initial conditions for time t = 0
u(x, t0) = I(x)
Can you get going then?
0
#5
(Original post by mqb2766)
Can you get going then?
I tried to implement this but I recieve the error message
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

I'm trying to get this function to return a matrix
0
X

new posts
Back
to top
Latest
My Feed

### Oops, nobody has postedin the last few hours.

Why not re-start the conversation?

see more

### See more of what you like onThe Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

### University open days

• University of Stirling
Thu, 26 Sep '19
• Heriot-Watt University
Fri, 27 Sep '19
• Royal Holloway, University of London
Sat, 28 Sep '19

### Poll

Join the discussion

#### It is really important for me to be involved in helping make my university better

Strongly disagree (11)
9.17%
Disagree (6)
5%
Neither agree or disagree (40)
33.33%
Agree (46)
38.33%
Strongly Agree (17)
14.17%