/differential-equations

Computer program in the C++ programming language that solves Differential Equations

Primary LanguageC++MIT LicenseMIT

Differential Equations

C++17

This was done as homework for Differential Equations course at Innopolis University.

Computational Practicum on 1st order ODE

Write a computer program in the C++ programming language that solves

Equation 1

on a given interval

Interval for equation 1

and provides the analysis of approximations.

  1. Implement in the code the numerical Euler's method

    Task 1 Point 1

  2. Implement in the code the numerical Improved Euler's method

    Task 1 Point 2

  3. Implement in the code the numerical Runge-Kutta method

    Task 1 Point 3

  4. Hardcode the function of the right-hand side of the equation

    Task 1 Point 4_1

    as well as initial conditions

    Task 1 Point 4_2

  5. Solve the equation manually, hardcore the function of the analytical solution

    Task 1 Point 5

  6. For each numerical method compose the array of the local errors

    Task 1 Point 6

    given the number n of grid points

  7. For each numerical method compose the array of the global errors for each number n of grid points within the range

    Task 1 Point 4_1

    Task 1 Point 4_2

  8. Provide the functionality of printing the arrays onto the console in the format

    • in the first line print the title of the array (e.g. "ti="),
    • in the second line print the values stored in the array formatted "f5" (%.f5), separated by spaces, without the space after the last item, with the "\n" at the end of line. Note that decimal separator is dot(.).

Computational practicum on systems of 2 ODE

Write a computer program in the C++ programming language that solves

Equation 2

Equation 2 Interval

  1. Implement Euler's method as described in tutorial

  2. Implement improved Euler's method as described in tutorial

  3. Implement Runge-Kutta method analogically

  4. Hard code the functions f(x,y,t) and g(x,y,t) as well as the initial conditions t0, x0, y0

  5. Provide the functionality of printing the arrays onto the console as in the previous task