how to output quantities involving time derivatives in pdepe
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
feynman feynman
el 13 de Feb. de 2024
Comentada: Torsten
el 13 de Feb. de 2024
pdeval only seems to output the solution and the spatial derivative of the solution via [~,dudx]=pdeval(m,x,sol(i,:,1),x). It seems it's no use putting dudt in as in [~,dudt]=pdeval(m,x,sol(i,:,1),x). How to output quantities involving time derivatives of the solution and the like?
0 comentarios
Respuesta aceptada
Torsten
el 13 de Feb. de 2024
Editada: Torsten
el 13 de Feb. de 2024
You don't have access to the spatial discretization of pdepe, thus no access to the exact time derivatives. But if you choose the output vector t fine enough, you can use the usual finite difference quotient in time:
dersol_t(i,:) = (sol(i+1,:,1)-sol(i,:,1))/(t(i+1)-t(i))
Maybe "deval" also works - I'm not sure. You can test it.
2 comentarios
Torsten
el 13 de Feb. de 2024
You can attain higher order accuracy if you use more accurate difference formulae than the simple Euler forward I suggested. I think "deval" can't do better - at least if the ode integrator with which the results were achieved is not known to "deval" by the sol structure.
Más respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!