How would I go about this differential equation? Watch

Blaze3211
Badges: 11
Rep:
?
#1
Report Thread starter 4 weeks ago
#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
reply
mqb2766
Badges: 16
Rep:
?
#2
Report 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
reply
Blaze3211
Badges: 11
Rep:
?
#3
Report Thread starter 4 weeks ago
#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
reply
mqb2766
Badges: 16
Rep:
?
#4
Report 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
reply
Blaze3211
Badges: 11
Rep:
?
#5
Report Thread starter 4 weeks ago
#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
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

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

Personalise

University open days

  • University of Stirling
    Undergraduate Open Day Undergraduate
    Thu, 26 Sep '19
  • Heriot-Watt University
    Undergraduate Open Day - Scottish Borders Campus Undergraduate
    Fri, 27 Sep '19
  • Royal Holloway, University of London
    Undergraduate open day Undergraduate
    Sat, 28 Sep '19

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%

Watched Threads

View All