Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- #include "Header.h"
- using namespace std;
- vector<vector<double> > solveByEiler(const double from, const double to, const double a, const int N) {
- vector<vector<double> > solution;
- double x = from;
- double y = a;
- const double h = (to - from)/(N-1);
- for(int i = 0; i < N; i++) {
- vector<double> temp;
- temp.push_back(x);
- temp.push_back(y);
- solution.push_back(temp);
- y += h*f(x, y);
- x += h;
- }
- return solution;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement