Using the backward Euler and upwinding to solve the viscous Burgers equation

I wish to solve the following partial differential equation:
I have had some success using the backward Euler method for other linear equations and the upwinding approach. When I have tried it for the viscous burgers equation, it seems to have failed after the first step, and I have no idea why.
Can anyone point to where it seems to have gone wrong?

 채택된 답변

Mat Hunt
Mat Hunt 2023년 7월 14일
This issue was the size of b, I reduced this and it worked perfectly. I find this odd as backward Euler is touted to be unconditionally convergent.

추가 답변 (1개)

Torsten
Torsten 2023년 7월 14일
이동: Torsten 2023년 7월 14일
Why don't you use ode15s to solve the semi-discretized system of ordinary differential equations ?
Look up "method-of-lines" for more details.
Or even better: "pdepe" is your friend.

댓글 수: 5

Unfortunately this solution needs to be a bit more robust that the use of ODE15. I'm aware of the method od lines, and have tried to use these methods to solve the more heavy duty equations only to have ode15 fall flat on it's face. All the things you have suggested work fine if the equation is simple, but fail when they get harder. So that's why I have not considered them for this particular problem.
Torsten
Torsten 2023년 7월 14일
편집: Torsten 2023년 7월 14일
Unfortunately this solution needs to be a bit more robust that the use of ODE15. I'm aware of the method od lines, and have tried to use these methods to solve the more heavy duty equations only to have ode15 fall flat on it's face. All the things you have suggested work fine if the equation is simple, but fail when they get harder. So that's why I have not considered them for this particular problem.
Self-written integrators often hide inherent difficulties while solving the equations because they simply integrate from tstart to tend "regardless of the consequences". So what you call "more robust" is simply the fact that they won't stop if difficulties in the equations would make it necessary to reduce the stepsize or even to give up.
As I said before, I haven't had much success with ODE15. I know this technique has worked so far and I am slowly adding to the complexity of this equation to get something that works at each stage and I can make sure that things are working nicely. By putting something in a blackbox solver like ODE15, you really have no idea what is causing the issue because you can't see what is going on.
Torsten
Torsten 2023년 7월 14일
편집: Torsten 2023년 7월 14일
Advanced integration methods make the solvers more sensitive, and they might give up even if continuing would still yield a good solution. But integrating without adaptive stepsize to control the error you make in the solution is no alternative in my opinion.
But I don't want to critisize your coding - I have the impression that you work responsibly :-)
Coding up is not the problem, it's the numerical method that is the thing which is somewhat elusive.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2023년 7월 14일

댓글:

2023년 7월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by