Different answers each run halving step size, debugging code correctly

5 Ansichten (letzte 30 Tage)
al
al am 21 Jan. 2025
Kommentiert: Walter Roberson am 21 Jan. 2025
Hello,
I have a code computing a rockets trajectory using Rungekutta. The issue is computing error, I am trying to compute and estimated global error, by comparing two results with different step size. There is a while loop in the code, which halves the step size to compute local truncation error and minimize this. However, I descided to deactivate this, so the issue is not here. I have tried to search trough the code various times, but I can not seem to find an issue anywhere.
Any help is greatly appriciated
  1 Kommentar
Walter Roberson
Walter Roberson am 21 Jan. 2025
A common error in RK type of calculations is failing to multiply by the step size in all of the appropriate places.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by