Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one-dimensional heat equation #720

Closed
adlermaus opened this issue Aug 17, 2023 · 0 comments
Closed

one-dimensional heat equation #720

adlermaus opened this issue Aug 17, 2023 · 0 comments

Comments

@adlermaus
Copy link

Hi, I would like to solve the heat equation ( du(x, t)/dt = a * d^2u(x, t)/dx^2 ) with an initial gaussian function. An analytical solution would be: u_analytical(x, t) = 1/(2 * sqrt(π * a * (t - t0))) * exp(-(x)^2 / (4 * a * (t - t0))). If t0 is 0, then the initial condition would be a delta distribution, if t0 < 0 then it's a gaussian function.

So the problem to solve would be:
PDE: d/dt [u(x, t)] = a * d^2/dx^2 [u(x, t)]
initial condition: u(x, 0) = 1/(2 * sqrt(π * a * ( - t0))) * exp(-(x)^2 / (4 * a * ( - t0)))
boundarie conditions: u(x_min, t) = 1/(2 * sqrt(π * a * (t - t0))) * exp(-(x_min)^2 / (4 * a * (t - t0)))
u(x_max, t) = 1/(2 * sqrt(π * a * (t - t0))) * exp(-(x_max)^2 / (4 * a * (t - t0)))
For this problem, the analytical solution u_analytical should be unique, right? I didn't manage to get a good solution. I tried to overweight the initial/boundary conditions with "NonAdaptiveLoss", but that didn't work (attached is my code). Am I missing something? Thanks a lot in advance!

heat equation.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant