https://github.com/flutter-studio/rk4
The fourth order runge kutta method is used to solve the first and second order differential equations
https://github.com/flutter-studio/rk4
kutta rk rk4 runge rungekutta
Last synced: about 1 month ago
JSON representation
The fourth order runge kutta method is used to solve the first and second order differential equations
- Host: GitHub
- URL: https://github.com/flutter-studio/rk4
- Owner: flutter-studio
- License: other
- Created: 2019-12-03T09:47:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-04T12:37:37.000Z (over 6 years ago)
- Last Synced: 2025-08-03T21:41:22.652Z (10 months ago)
- Topics: kutta, rk, rk4, runge, rungekutta
- Language: Dart
- Size: 7.81 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
English | [简体中文](./README_zh-CN.md)
# rk4
[](https://pub.dartlang.org/packages/rk4)
The fourth order runge kutta method is used to solve the first and second order differential equations
## Usage
To use this plugin, add `rk4` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
## Example
``` dart
// Import package
import 'package:rk4/rk4.dart';
import 'package:flutter/material.dart';
RK4(
xInit: 0,
yInit: 0,
criticalValue: 1,
k1: (x, y) => 1 - y,
).run().forEach((rr) {
print("------ x: ${rr.x} y: ${rr.y}");
});
RK4
.second(
xInit: 0,
yInit: -0.4,
yDInit: -0.6,
l1: (x, y, yd) => pow(e, 2 * x) * sin(x) - 2 * y + 2 * yd,
criticalValue: 1,
)
.run()
.forEach((rr) {
print("------ x: ${rr.x} y: ${rr.y}");
});
```