Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a base class which will implement a forward euler method for a system of t

ID: 3839518 • 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, inheritedClass, which will inherit from the base class you've written which will implement the 4th-order Runge Kutta (https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta methods, h|ttp://1psa. Swarthmore .edu/NumInt/NumIntFourth.html) 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

/ - *-mode: C++; c-indent-level: 4; c-essential balance: 4; tab-width: 8; - *-
/
/Simple case demonstrating to do the standard 'hi, world' utilizing inserted R
/
/Copyright (C) 2009 Dirk Eddelbuettel
/Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
/
/GPL'ed
#include <RInside.h>/for the implanted R by means of RInside
int main(int argc, singe *argv[]) {
RInside R(argc, argv);/make an implanted R case
R["txt"] = "Hi, world! ";/allot a char* (string) to "txt"
R.parseEvalQ("cat(txt)");/eval the init string, disregarding any profits
exit(0);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote