differential.cpp

来自「四种方法求积分:runge-kutta法」· C++ 代码 · 共 35 行

CPP
35
字号
#include "iostream.h"
#include "euler.h"
#include "hieuler.h"
#include "runge-kutta.h"
#include "adamsbashforth.h"
#include "ab4-am4.h"
#include "hiab4-am4.h"

main()
{
	float x, y, xend, h;
	cout << "input x, y, xend and h\n";
	cin >> x;
	cin >> y;
	cin >> xend;
	cin >> h;
	euler(h, x, y, xend);

	cout << "comput by improved euler method" << endl;
	hieuler(h, x, y, xend);

	cout << "comput by conversional runge-kutta method" << endl;
	rungekutta(h, x, y, xend);
		
	cout << "comput by conversional adams-bashforth method" << endl;
	adamsbashforth(h, x, y, xend);

	cout << "comput by conversional ab4-am4 method" << endl;
	ab4am4(h, x, y, xend);

	cout << "comput by conversional hiab4-am4 method" << endl;
	hiab4am4(h, x, y, xend);

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?