Write a base class which will implement a forward euler method for a system of t
ID: 3838999 • Letter: W
Question
Write a base class which will implement a forward euler method for a system of two ordinary differential equations, dx/dt = f(x, y), dy/dt = g (x, y) the class should store function pointers to f and g, and include a runsim function which will run the euler time step for 20 time units (N = 20 * (1/dt)) Then write a class inherited Class which will inherit from the base class you've written which will implement the 4th-order Runge Kutta method, modify the runSim function in the inherited class so the user can choose which method to run. Both classes should save the trajectory of the system and save figures of the trajectory by either calling Python or R to save the plots as .png files.Explanation / Answer
#include #include #include #include #include using namespace std; int baseHit=0; char inningIsOver; int hit; int batterIsOver; int game(); int run=0; int main () { int exit; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.