Question
I am trying to write a program in c++. I have already got some but wondering if I could get help. I am not very
I am trying to write a program in c++. I have already got some but wondering if I could get help. I am not very skilled at programming.
// Example program #include using namespace std;
void EulerF(float x0, float y0, float h, float x) { //Euler method for f(x)
while (x0
y0 = (2 * y0) + (y0 * h) ; //df/dx = 2f x0 = x0 + h; cout
}
}
void EulerR(float t0, float s0, float k, float t) { //Euler method for r(t)
while (x0
s0 = (10 * s0) - 2 * Euler(x0, y0, h, x) ; //dr/dt = 10r - 2f t0 = t0 + k; cout
}
}
int main() {
float x0 = 0;//initial x value float t0 = 0; float y0 = 5; //initial y value float s0 = 100; float h,k = 1; // mesh size float x; float s;
cin >> x; cin >> s;
EulerF(x0, y0, h, x); EulerR(t0, s0, k, t); return 0;
}
(0) 100. f(0) = 5Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started