Giter VIP home page Giter VIP logo

scientificcpp's Introduction

ScientificCPP

Functions

  • Essentials-

    • vector<double> zeros(unsigned ): This would return a column vector with all zeros.
    • vector<double> ones(unsigned ): This would return a column vector with all ones.
    • vector<double> display(vector<double> ): Given a vector as an input, it would display its contents.
    • void plot(vector<double> , vector<double> ): Given two vector it would make a plot x vs y.
    • vector<double> stepFill(double start, double step, double end ): This would return a column vector from start to end endwith a step size step
  • Matrix Operations-

    • vector<double> GaussElimination(vector< vector<double> > A, vector<double> b): Given the inputs it would output x column vector as the solution of the equation Ax=b
    • vector< vector<double> > transpose(vector< vector<double> >): This would return the transpoe of a given matrix.
    • vector< vector<double> >inverse(vector< vector > )` : This would return the inverse of the given matrix.
  • Interpolation

    • vector<double> equiInterpolation(double start, double end, unsigned , function<double(double)>): Given a function and the start and end points it would interpolate equisapced points from start to end. And it would return the coefficients of the polynomials where the value of the i th power of x.
    • vector<double> legendreGaussInterpolation(double start, double end, unsigned n, function<double(double)>): Given a function and the start and end points it would interpolate using n+1 Legendre Gauss points from start to end. And it would return the coefficients of the polynomials where the value of the i th power of x.
    • vector<double> loabattoInterpolation(double start, double end, unsigned n, function<double(double)>): Given a function and the start and end points it would interpolate using the n+1 Lobatto nodes from start to end.
    • vector<double> lobattoNodes(unsigned n): This would return the Lobatto Nodes is the computational space.
    • vector<double> legendreGaussNodes(unsigned n): This would return the Legendre Gauss Nodes is the computational space.
    • vector<double> legendreGaussWeights(unsigned n): This would return the weights corresponding to the Legendre Gauss Nodes.
    • vector<double> lobattoWeights(unsigned n): This would return the weights corresponding to the Lobatto Nodes.
  • Integration

    • double legendreGaussIntegration(double start, double end, unsigned n, function<double(double)>): Given a function and the start and end points it would integrate it using n+1 Legendre Gauss points from start to end.
    • double loabattoIntegration(double start, double end, unsigned n, function<double(double)>): Given a function and the start and end points it would integrate it using the n+1 Lobatto nodes from start to end.
  • Polynomials

    • double polyEval(vector<double> Poly, double x) :This would return the value of the polynomial at the point x . This uses the Horner's scheme for evaluating the values of the polynomial.
    • vector<double> polyDeriv(vector<double> Poly) :This would return the derivative of the polynomial in the polynomial form.
    • vector<double> synthDiv(vector<double> Poly, double root) :This would return the coefficients of the polynomial after dividing the given polynomial using its root .
    • vector<double> legendrePolynomial(unsigned n) :This would return the coefficients of the Legendre polynomial of degree n .
  • Root Finding.

    • double newtonRaphson(function<double(double)> f, double x0) :This would return the result of the Newton Raphson method of finding the root given an intial guess x0.
  • Galerkin Methods:

    • vector< vector<double> > massMatrix(vector<double> Points) : Given the points as a vector form, it would give us the Mass Matrix corresponding to the Lagrange Polynomials made usgin the given points.
    • vector< vector<double> > derivativeMatrix(vector<double> Points) : Given the points as a vector form, it would give us the Derivative Matrix in the strong form corresponding to the Lagrange Polynomials made usgin the given points. Note: The derivative matrix in weak form can be made simply using the transpose function described earlier.
    • vector< vector<double> > fluxMatrix(vector<double> Points): Given the points as a vector form, it would give us the Flux Matrix corresponding to the Lagrange Polynomials made usgin the given points.
    • Continuous Galerkin Methods:

      • vector< vector<double> > massCGDSS(unsigned Ne, unsigned N): This function would return the total mass matrix after doing the DSS for the given domain consisting of Ne elements and in each element, trying to interpolate the solution in each of the element with a polynomial of degree N. By default, it is tried to interpolate using Lobatto nodes. And the integration is kept exact. But each of these restrictions can be easily changed.
      • vector< vector<double> > derivativeCGDSS(unsigned Ne, unsigned N): This function would return the total derivative matrix after doing the DSS for the given domain consisting of Ne elements and in each element, trying to interpolate the solution in each of the element of degree N. By default, it is tried to interpolate using Lobatto nodes. And the integration is kept exact. But each of these restrictions can be easily changed.

scientificcpp's People

Contributors

kaushikcfd avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.