Jump to content

Runge-Kutta method: Difference between revisions

Line 253:
 
=={{header|C#}}==
<lang csCS>
using System;
 
Line 262:
static void Main(string[] args)
{
//Counter for time steps
decimal k = 0.0m;
decimal dk = 0.1m;
 
//Incrementers to pass into the known solution
double t = 0.0;
Line 311 ⟶ 307:
while (i < y.Length - 1)
{
 
k += dk;
 
dy1 = dt * equation(s[i], y[i]);
Line 342 ⟶ 336:
{
double y_prime;
 
return y_prime = t*Math.Sqrt(y);
}
Line 350 ⟶ 343:
{
double actual;
 
actual = Math.Pow((Math.Pow(t, 2) + 4), 2)/16;
 
return actual;
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.