You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
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
The text was updated successfully, but these errors were encountered: