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
// Calculate the next y-value using the weighted average of the four slopes
20
+
returnyCurrent+(1/6)*(k1+2*k2+2*k3+k4);
21
+
}
22
+
23
+
/**
24
+
* @description Runge-Kutta method for solving ordinary differential equations (ODEs) with a given initial value. It is a numerical procedure for solving ODEs. The method proceeds in a series of steps. At each step the y-value is calculated by evaluating the differential equation at the previous step, multiplying the result with the step-size and adding it to the last y-value.
25
+
* @param {number} xStart - The starting x-value
26
+
* @param {number} xEnd - The ending x-value
27
+
* @param {number} stepSize - The step size
28
+
* @param {number} yStart - The starting y-value
29
+
* @param {function} differentialEquation - The differential equation to solve
30
+
* @returns {Array} - An array of points (x, y) for the complete iteration from xStart to xEnd
0 commit comments