Coder Social home page Coder Social logo

antonrydahl / cstr Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 42.59 MB

This example is meant for the DTU student studying Scientific Computing for Differential Equations I (02686).

C 93.55% Makefile 1.63% MATLAB 3.88% Shell 0.94%
stochastic-differential-equations newton-solver mersenne-twister implicit-euler-method

cstr's Introduction

Parallel Implementation of the CSTR Model

drawing

This example demonstrates how to simulate the model dynamics of the Continuous Stirred Tank Reactor model for an example input profile. This code implements the model given in the paper Nonlinear Model Predictive Control for an Exothermic Reaction in an Adiabatic CSTR.

The simulations in this example are run in parallel using the Open Multi-processin (OpenMP).

Getting Started

Start out by navigating to https://thinlinc.gbar.dtu.dk/main/. In the top left corner, click Applications and select DTU. In order to get the result nicely displayed, open xterm (VirtualGL-application-node). If you choose to use another terminal on Thinlinc, the Matlab driver will not work and the results will not be displayed.

Create a new directory where you can run the code. For instance, type

mkdir 02686_CSTR

and navigate to the new directory

cd 02686_CSTR

In order to download these files, type

git init
git clone https://github.com/AntonRydahl/CSTR

and navigate to the downloaded files

cd cstr

You are now ready to run the example. In your folder you have libraries containing a random number generator, Mersenne Twister, an implicit first order ODE solver, Implicit Euler, and a library for generating a scalar Standard Wiener Process. The Newton solver uses in the Implicit Euler method uses LAPACK. You can eventually take a look at the Makefile to see how the Fortran version of LAPACK can be used on Thinlinc.

The folder also contains a Matlab driver to illustrate the results.

Commands to Run the Driver

The driver can be executed with the command:

./driver.sh <number of realisations> <number of threads>

Expected Result

The C function project.c will compute a user specified number of realisations of model noise and simulate the model in open loop for the different realisations of noise. Afterwards, the Matlab driver driver.m illustrates the solution.

This browser does not support PDFs. Please download the PDF to view it: Download PDF.

cstr's People

Contributors

antonrydahl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

carlosp81

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.