├── .gitattributes ├── .gitignore ├── 00_Introduction_Python ├── 00_Introduction_Python.ipynb ├── 01_markdown.ipynb ├── 02_getting_started.ipynb ├── 03_numpy_scipy_matplotlib.ipynb └── images │ ├── python_ecosystem.png │ └── stackoverflow-growth.png ├── 01_inlet_profiles ├── 01_generating_flow_demonstration.ipynb ├── 02_generating_flow_exercises.ipynb └── resources │ ├── 2_comp.png │ ├── const.png │ ├── gradient.png │ ├── inlet_profiles.py │ ├── quad.png │ └── step.png ├── 02_residence_time_distributions ├── 01_rtd_demonstration.ipynb ├── 02_rtd_exercises.ipynb └── resources │ ├── rtd_figures.py │ ├── step.png │ ├── system.png │ ├── system_chain.png │ └── system_dirac.png ├── 03_chemical_reactions ├── 01_reactions_demonstration.ipynb └── 02_reaction_exercises.ipynb ├── 04_adsorption ├── 01_adsorption_demonstration.ipynb ├── 02_adsorption_exercise.ipynb └── resources │ └── Picture1.png ├── 05_simple_chromatographic_processes ├── 01_chromatography_demonstration.ipynb ├── 02_chromatography_exercise.ipynb └── resources │ ├── dextran_inlet.png │ ├── lwe_inlet.png │ └── system.png ├── 06_advanced_chromatographic_processes ├── 01_advanced_chromatography_demonstration.ipynb ├── 02_advanced_chromatography_exercise.ipynb └── resources │ ├── smb.png │ └── valve_mixer.png ├── LICENSE ├── README.md ├── environment.yml ├── getting_started.ipynb ├── resources ├── dextran_experiment.csv └── dextran_experiment_long.csv └── utils.ipynb /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Jupyter Notebook 306 | .ipynb_checkpoints 307 | 308 | # Cake - Uncomment if you are using it 309 | # tools/** 310 | # !tools/packages.config 311 | 312 | # Tabs Studio 313 | *.tss 314 | 315 | # Telerik's JustMock configuration file 316 | *.jmconfig 317 | 318 | # BizTalk build output 319 | *.btp.cs 320 | *.btm.cs 321 | *.odx.cs 322 | *.xsd.cs 323 | 324 | # OpenCover UI analysis results 325 | OpenCover/ 326 | 327 | # Azure Stream Analytics local run output 328 | ASALocalRun/ 329 | 330 | # MSBuild Binary and Structured Log 331 | *.binlog 332 | 333 | # NVidia Nsight GPU debugger configuration file 334 | *.nvuser 335 | 336 | # MFractors (Xamarin productivity tool) working folder 337 | .mfractor/ 338 | 339 | # Local History for Visual Studio 340 | .localhistory/ 341 | 342 | # BeatPulse healthcheck temp database 343 | healthchecksdb 344 | /CADET-Tutorial/.ipynb_checkpoints 345 | /CADET-Tutorial/.~Lesson 8 Experimental design overview.ipynb 346 | -------------------------------------------------------------------------------- /00_Introduction_Python/00_Introduction_Python.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Introduction to Python\n", 8 | "\n", 9 | "## Why Python?\n", 10 | "- Simplicity: Easy to code, easy to read.\n", 11 | "- Availability: Free and open source and compatible with all major operating systems.\n", 12 | "- \"Batteries included\": Robust standard library provides wide range of modules to add functionality to the Python application.\n", 13 | "- Excellent third party libraries:\n", 14 | "\n", 15 | " ***The Python ecosystem:*** \n", 16 | " \"Python\n", 17 | " \n", 18 | "- In this course we will be using:\n", 19 | " - [NumPy](https://www.numpy.org/) for array-computing \n", 20 | " - [SciPy](https://www.scipy.org/) for numerical routines\n", 21 | " - [Matplotlib](https://www.matplotlib.org/) for data visualization\n", 22 | "- Widespread Adoption in Science and Education:\n", 23 | " \n", 24 | " \n", 25 | "\n", 26 | "\n", 27 | "### Tutorial objectives\n", 28 | "This tutorial covers the following topics:\n", 29 | "- Installation of Python\n", 30 | "- help, print, type\n", 31 | "- Variables\n", 32 | "- Operators\n", 33 | "- Basic Functions\n", 34 | "- Import of packages\n", 35 | "- Introduction to numpy\n", 36 | "- Introduction to matplotlib" 37 | ] 38 | }, 39 | { 40 | "cell_type": "markdown", 41 | "metadata": {}, 42 | "source": [ 43 | "___" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "## Python Installation\n", 51 | "- In this course, we will be using the Conda Python distribution. Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies completely seprate from any system Python installations and withoud needing administrative rights.\n", 52 | "- Download Miniconda from [here](https://docs.conda.io/en/latest/miniconda.html)\n", 53 | "- Installation remarks:\n", 54 | " - Accept License Agreement\n", 55 | " - Select *Install Just Me*\n", 56 | " - Select Destination Folder: use recommended\n", 57 | " - Do *not* add Anaconda to your PATH\n", 58 | " - Click install\n", 59 | " - To install additional packages, open the anaconda prompt from the windows menu and enter:\n", 60 | " ```\n", 61 | " conda install numpy scipy matplotlib jupyterlab\n", 62 | " ```\n", 63 | "- The tutorial and exercises will be presented using jupyter notebooks. Jupyterlab is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.\n", 64 | " - Markdown cells are used for formatted text\n", 65 | " - Code cells contain executable code\n", 66 | "\n", 67 | "***Task:*** Start Jupyterlab Server by entering ``` jupyter-lab ``` in the anaconda prompt, create a new notebook and a new cell and convert the type to 'Markdown'." 68 | ] 69 | }, 70 | { 71 | "cell_type": "markdown", 72 | "metadata": {}, 73 | "source": [ 74 | "## Further Watching\n", 75 | "You can find plenty of great resources for (Python) programming online. \n", 76 | "- [Corey Schafer](https://www.youtube.com/user/schafer5) is focused on general programming aspectes, mainly in Python, but also has good introductions to *Bash*, *Git*, *SQL*, and many more.\n", 77 | "- [APMonitor](https://www.youtube.com/user/APMonitorCom) has a lot of engineering examples in *Python*, *Matlab* or on *paper*. In fact, some of this course's exercises are based heavily on his work.\n", 78 | "- [3Blue1Brown](https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw) makes great videos series on a broad range of (physical) math topics such as *linear algebra*, *calculus*, and *differential equations*." 79 | ] 80 | } 81 | ], 82 | "metadata": { 83 | "kernelspec": { 84 | "display_name": "Python 3", 85 | "language": "python", 86 | "name": "python3" 87 | }, 88 | "language_info": { 89 | "codemirror_mode": { 90 | "name": "ipython", 91 | "version": 3 92 | }, 93 | "file_extension": ".py", 94 | "mimetype": "text/x-python", 95 | "name": "python", 96 | "nbconvert_exporter": "python", 97 | "pygments_lexer": "ipython3", 98 | "version": "3.7.9" 99 | } 100 | }, 101 | "nbformat": 4, 102 | "nbformat_minor": 4 103 | } 104 | -------------------------------------------------------------------------------- /00_Introduction_Python/01_markdown.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Markdown \n", 8 | "Markdown is a lightweight markup language with plain text formatting syntax. You can find more information and examples [here](https://en.wikipedia.org/wiki/Markdown).\n", 9 | "___\n", 10 | "\n", 11 | "### Example: Raw input" 12 | ] 13 | }, 14 | { 15 | "cell_type": "raw", 16 | "metadata": {}, 17 | "source": [ 18 | "It's very easy to make some words **bold** and other words *italic* with Markdown. \n", 19 | "\n", 20 | "You can insert [links](https://www.example.com),\n", 21 | "\n", 22 | "create lists\n", 23 | "- item 1\n", 24 | "- item 2\n", 25 | "\n", 26 | "and Headlines.\n", 27 | "# Heading\n", 28 | "## Sub-heading\n", 29 | "\n", 30 | "Also, mathematical equations are supported using KaTeX notation:\n", 31 | "$\n", 32 | "\\frac{\\partial c(z,t)}{\\partial t} + F \\frac{\\partial q(z,t)}{\\partial t} + u \\frac{\\partial c(z,t)}{\\partial z} = 0\n", 33 | "$" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "metadata": {}, 39 | "source": [ 40 | "### Example: Output:\n", 41 | "It's very easy to make some words **bold** and other words *italic* with Markdown. \n", 42 | "\n", 43 | "You can insert [links](https://www.example.com),\n", 44 | "\n", 45 | "create lists\n", 46 | "- item 1\n", 47 | "- item 2\n", 48 | "\n", 49 | "and Headlines.\n", 50 | "# Heading\n", 51 | "## Sub-heading\n", 52 | "\n", 53 | "Also, mathematical equations are supported using KaTeX notation:\n", 54 | "$\n", 55 | "\\frac{\\partial c(z,t)}{\\partial t} + F \\frac{\\partial q(z,t)}{\\partial t} + u \\frac{\\partial c(z,t)}{\\partial z} = 0\n", 56 | "$" 57 | ] 58 | }, 59 | { 60 | "cell_type": "markdown", 61 | "metadata": {}, 62 | "source": [ 63 | "___" 64 | ] 65 | }, 66 | { 67 | "cell_type": "markdown", 68 | "metadata": {}, 69 | "source": [ 70 | "***Task:*** Write a sentence using **bold**, *italic*, as well as ***bold and italic*** highlighting." 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": {}, 76 | "source": [ 77 | "***Task:*** Download an image and insert a link with the alternative text 'Figure 1'." 78 | ] 79 | }, 80 | { 81 | "cell_type": "markdown", 82 | "metadata": {}, 83 | "source": [ 84 | "***Task:*** Write down the equation for your favorite adsorption isotherm." 85 | ] 86 | } 87 | ], 88 | "metadata": { 89 | "kernelspec": { 90 | "display_name": "Python 3", 91 | "language": "python", 92 | "name": "python3" 93 | }, 94 | "language_info": { 95 | "codemirror_mode": { 96 | "name": "ipython", 97 | "version": 3 98 | }, 99 | "file_extension": ".py", 100 | "mimetype": "text/x-python", 101 | "name": "python", 102 | "nbconvert_exporter": "python", 103 | "pygments_lexer": "ipython3", 104 | "version": "3.7.9" 105 | } 106 | }, 107 | "nbformat": 4, 108 | "nbformat_minor": 4 109 | } 110 | -------------------------------------------------------------------------------- /00_Introduction_Python/02_getting_started.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Getting started with Python\n", 8 | "\n", 9 | "### Hello World!\n", 10 | "The simplest program in Python consists of a line that tells the computer a command. Traditionally, the first program of every programmer in every new language prints \"Hello World!\"" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "***Task:*** Change ```'Hello world!'``` to a different text message." 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": null, 23 | "metadata": {}, 24 | "outputs": [], 25 | "source": [ 26 | "print('Hello world!')" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "### Help me! \n", 34 | "The most important thing to learn in programming is finding help. The easiest way is to to use the ```help()``` function. If you get stuck, search for answers online in the online documentation of [Python](https://docs.python.org/3/) or in forums such as [Stackoverflow](https://stackoverflow.com/questions/tagged/python). Chances are, other programmers will have had the same problem as you have!" 35 | ] 36 | }, 37 | { 38 | "cell_type": "markdown", 39 | "metadata": {}, 40 | "source": [ 41 | "***Task:*** Show the help documentation for the ```max``` function instead of the ```print``` function. Based on the help, use the ```max``` function to find the highest value of two numbers: ```5``` and ```2```." 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": null, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "help(print)" 51 | ] 52 | }, 53 | { 54 | "cell_type": "markdown", 55 | "metadata": {}, 56 | "source": [ 57 | "### Python as a calculator\n", 58 | "\n", 59 | "Python can be used just like a calculator. Enter an expression and the interpreter returns the result. The syntax is simple: the operators ```+```, ```-```, ```*```, and ```/``` act as you would expect. Round brackets ```( )``` can be used to group expressions." 60 | ] 61 | }, 62 | { 63 | "cell_type": "markdown", 64 | "metadata": {}, 65 | "source": [ 66 | "***Task:*** Play around with the interpreter and enter some equations!" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": null, 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [ 75 | "1 + 1" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [ 84 | "(50 * 5 - 6) / 3" 85 | ] 86 | }, 87 | { 88 | "cell_type": "markdown", 89 | "metadata": {}, 90 | "source": [ 91 | "### Operators\n", 92 | "\n", 93 | "We've already seen some operators. Operators are used to transform, compare, join, substract, etc. Below is a list of operators in descending order of precedence. When there are no parenthesis to guide the precedence, this order will be assumed.\n", 94 | "\n", 95 | "| Operator | Description |\n", 96 | "| --- | --- |\n", 97 | "| ** | Exponent |\n", 98 | "| *, /, //, % | Multiplication, Division, Floor division, Modulus |\n", 99 | "| +, - | Addition, Subtraction |\n", 100 | "| <=, <, >, >= | Comparison |\n", 101 | "| =, %=, /=, //=, -=, +=, *=, **= | Assignment |\n", 102 | "| is, is not | Identity |\n", 103 | "| in, not in | Membership |\n", 104 | "| not, or, and | Logical |" 105 | ] 106 | }, 107 | { 108 | "cell_type": "markdown", 109 | "metadata": {}, 110 | "source": [ 111 | "***Example:***" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": null, 117 | "metadata": {}, 118 | "outputs": [], 119 | "source": [ 120 | "# Area of unit circle. <-- Note the '#', it makes everything after that a comment, i.e. it will NOT be executed \n", 121 | "3.1415926/4 * 2**2" 122 | ] 123 | }, 124 | { 125 | "cell_type": "markdown", 126 | "metadata": {}, 127 | "source": [ 128 | "***Example:***" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": null, 134 | "metadata": {}, 135 | "outputs": [], 136 | "source": [ 137 | "1 == 0" 138 | ] 139 | }, 140 | { 141 | "cell_type": "markdown", 142 | "metadata": {}, 143 | "source": [ 144 | "***Task:*** Calculate the volume of the unit sphere." 145 | ] 146 | }, 147 | { 148 | "cell_type": "code", 149 | "execution_count": null, 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [] 153 | }, 154 | { 155 | "cell_type": "markdown", 156 | "metadata": {}, 157 | "source": [ 158 | "***Task:*** Determine whether $35^2$ is greater than $2^{10}$." 159 | ] 160 | }, 161 | { 162 | "cell_type": "code", 163 | "execution_count": null, 164 | "metadata": {}, 165 | "outputs": [], 166 | "source": [] 167 | }, 168 | { 169 | "cell_type": "markdown", 170 | "metadata": {}, 171 | "source": [ 172 | "### Variables\n", 173 | "\n", 174 | "Variables are reserved memory locations to store values. By assigning different data types to variables, you can store integers, decimals or characters in these variables. Python variables do not need explicit declaration to reserve memory space. The declaration happens automatically when you assign a value to a variable using the equal sign (```=```).\n", 175 | "\n", 176 | "The operand to the left of the ```=``` operator is the name of the variable and the operand to the right of the ```=``` operator is the value stored in the variable. A variable name must begin with a letter or underscore but not with a number or other special characters. A variable name must not have a space and lowercase or uppercase are permitted." 177 | ] 178 | }, 179 | { 180 | "cell_type": "markdown", 181 | "metadata": {}, 182 | "source": [ 183 | "***Example:***" 184 | ] 185 | }, 186 | { 187 | "cell_type": "code", 188 | "execution_count": null, 189 | "metadata": {}, 190 | "outputs": [], 191 | "source": [ 192 | "answer = 42\n", 193 | "print(answer)" 194 | ] 195 | }, 196 | { 197 | "cell_type": "markdown", 198 | "metadata": {}, 199 | "source": [ 200 | "***Task:*** Correct the following errors in the variable names and print their values." 201 | ] 202 | }, 203 | { 204 | "cell_type": "code", 205 | "execution_count": null, 206 | "metadata": {}, 207 | "outputs": [], 208 | "source": [ 209 | "1diameter = 1\n", 210 | "length! = 10\n", 211 | "circle_area = 3.1415926/4* diameter**2\n", 212 | "#bar = 4" 213 | ] 214 | }, 215 | { 216 | "cell_type": "markdown", 217 | "metadata": {}, 218 | "source": [ 219 | "***Task:*** Write an equation for the volume of a cylinder using predefined variables." 220 | ] 221 | }, 222 | { 223 | "cell_type": "code", 224 | "execution_count": null, 225 | "metadata": {}, 226 | "outputs": [], 227 | "source": [] 228 | }, 229 | { 230 | "cell_type": "markdown", 231 | "metadata": {}, 232 | "source": [ 233 | "### Object Orientation/Types\n", 234 | "Object-oriented Programming (OOP), is a programming paradigm which provides means of structuring programs so that properties and behaviors are bundled into individual objects. For instance, an object could represent a person with a name property, age, address, etc., with behaviors like walking, talking, breathing, and running. Or an email with properties like recipient list, subject, body, etc., and behaviors like adding attachments and sending.\n", 235 | "\n", 236 | "A deeper introduction to OOP is out of scope for this course. However, it is important to know that in Python *everything* is an object. This means, it is of a certain *type* and every type brings with it certain behaviour. Python has five standard data types and we've already met some (subclasses) of them:\n", 237 | "- Numbers\n", 238 | "- String\n", 239 | "- List\n", 240 | "- Tuple\n", 241 | "- Dictionary\n", 242 | "\n", 243 | "The type can be determined using the ```type``` function." 244 | ] 245 | }, 246 | { 247 | "cell_type": "markdown", 248 | "metadata": {}, 249 | "source": [ 250 | "***Example:***" 251 | ] 252 | }, 253 | { 254 | "cell_type": "code", 255 | "execution_count": null, 256 | "metadata": {}, 257 | "outputs": [], 258 | "source": [ 259 | "foo = 2.0\n", 260 | "print(type(foo))" 261 | ] 262 | }, 263 | { 264 | "cell_type": "markdown", 265 | "metadata": {}, 266 | "source": [ 267 | "***Task:*** Print the variable value and type for ```answer```, and ```file_name```." 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "execution_count": null, 273 | "metadata": {}, 274 | "outputs": [], 275 | "source": [ 276 | "answer = 42\n", 277 | "file_name = \"readme.md\"" 278 | ] 279 | }, 280 | { 281 | "cell_type": "markdown", 282 | "metadata": {}, 283 | "source": [ 284 | "Almost everything in Python has *attributes* and *methods*." 285 | ] 286 | }, 287 | { 288 | "cell_type": "markdown", 289 | "metadata": {}, 290 | "source": [ 291 | "***Example:*** Complex numbers are an extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary numbers are real multiples of the imaginary unit (the square root of -1), written with $j$ in Python. You can access the real and imaginary parts of complex numbers using ```real``` and ```imganiary``` parts." 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": null, 297 | "metadata": {}, 298 | "outputs": [], 299 | "source": [ 300 | "c = complex(3,2)\n", 301 | "print(type(c))\n", 302 | "print(c.real)\n", 303 | "print(c.imag)" 304 | ] 305 | }, 306 | { 307 | "cell_type": "markdown", 308 | "metadata": {}, 309 | "source": [ 310 | "***Task:*** The method ```upper()``` returns a copy of the string in which all case-based characters have been uppercased. Use this method to capitalize a string variable." 311 | ] 312 | }, 313 | { 314 | "cell_type": "code", 315 | "execution_count": null, 316 | "metadata": {}, 317 | "outputs": [], 318 | "source": [] 319 | }, 320 | { 321 | "cell_type": "markdown", 322 | "metadata": {}, 323 | "source": [ 324 | "### Containers\n", 325 | "Lists are the most versatile compound data type for grouping together values in Python. A list contains items separated by commas and enclosed within square brackets (```[]```). The values stored in a list can be accessed using the slice operator (```[index]```, ```[start:end]```) with indexes starting at ***0*** in the beginning of the list and working their way to end ***-1***." 326 | ] 327 | }, 328 | { 329 | "cell_type": "markdown", 330 | "metadata": {}, 331 | "source": [ 332 | "***Example:***" 333 | ] 334 | }, 335 | { 336 | "cell_type": "code", 337 | "execution_count": null, 338 | "metadata": {}, 339 | "outputs": [], 340 | "source": [ 341 | "my_list = ['abcd', 786 , 2.23, 'john', 70.2]\n", 342 | "print(my_list)\n", 343 | "print(my_list[0])" 344 | ] 345 | }, 346 | { 347 | "cell_type": "markdown", 348 | "metadata": {}, 349 | "source": [ 350 | "***Task:*** Print elements starting from 3rd element." 351 | ] 352 | }, 353 | { 354 | "cell_type": "code", 355 | "execution_count": null, 356 | "metadata": {}, 357 | "outputs": [], 358 | "source": [] 359 | }, 360 | { 361 | "cell_type": "markdown", 362 | "metadata": {}, 363 | "source": [ 364 | "***Task:*** Append ```99``` to the list using the ```append()``` method." 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": null, 370 | "metadata": {}, 371 | "outputs": [], 372 | "source": [] 373 | }, 374 | { 375 | "cell_type": "markdown", 376 | "metadata": { 377 | "execution": { 378 | "iopub.execute_input": "2020-10-26T10:17:56.714446Z", 379 | "iopub.status.busy": "2020-10-26T10:17:56.714109Z", 380 | "iopub.status.idle": "2020-10-26T10:17:56.719751Z", 381 | "shell.execute_reply": "2020-10-26T10:17:56.718154Z", 382 | "shell.execute_reply.started": "2020-10-26T10:17:56.714408Z" 383 | } 384 | }, 385 | "source": [ 386 | "### Dictionaries\n", 387 | "\n", 388 | "Dictionaries in Python are unordered collections of key-value pairs enclosed within curly brackets (`{}`). Unlike lists, which are indexed by numbers, dictionaries are indexed by \n", 389 | "keys, which can be either numbers or strings." 390 | ] 391 | }, 392 | { 393 | "cell_type": "markdown", 394 | "metadata": { 395 | "execution": { 396 | "iopub.execute_input": "2020-10-26T10:20:46.690781Z", 397 | "iopub.status.busy": "2020-10-26T10:20:46.690576Z", 398 | "iopub.status.idle": "2020-10-26T10:20:46.693933Z", 399 | "shell.execute_reply": "2020-10-26T10:20:46.693295Z", 400 | "shell.execute_reply.started": "2020-10-26T10:20:46.690763Z" 401 | } 402 | }, 403 | "source": [ 404 | "***Example:***" 405 | ] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "execution_count": null, 410 | "metadata": {}, 411 | "outputs": [], 412 | "source": [ 413 | "my_dict = {'name': 'Cadet', 'version': '4.1.0', 'nUsers': 500}\n", 414 | "print(my_dict)\n", 415 | "print(my_dict['name'])\n", 416 | "my_dict['nDownloads'] = 2000\n", 417 | "print(my_dict['nDownloads'])" 418 | ] 419 | }, 420 | { 421 | "cell_type": "markdown", 422 | "metadata": { 423 | "execution": { 424 | "iopub.execute_input": "2020-10-26T10:26:37.287783Z", 425 | "iopub.status.busy": "2020-10-26T10:26:37.287298Z", 426 | "iopub.status.idle": "2020-10-26T10:26:37.293534Z", 427 | "shell.execute_reply": "2020-10-26T10:26:37.291936Z", 428 | "shell.execute_reply.started": "2020-10-26T10:26:37.287728Z" 429 | } 430 | }, 431 | "source": [ 432 | "Dictionaries, like lists, can be nested. " 433 | ] 434 | }, 435 | { 436 | "cell_type": "code", 437 | "execution_count": null, 438 | "metadata": {}, 439 | "outputs": [], 440 | "source": [ 441 | "my_dict = {'name': 'Cadet', 'version': '4.1.0', 'nUsers': 500}\n", 442 | "my_dict['stats'] = { 'github_stars': 1000, 'downloads': 2000, 'issues': 3}\n", 443 | "print(my_dict)" 444 | ] 445 | }, 446 | { 447 | "cell_type": "markdown", 448 | "metadata": {}, 449 | "source": [ 450 | "#### Addict\n", 451 | "\n", 452 | "Since the syntax to traverse deeply nested dictionaries can be quite tedious, we can use the package `addict` to simplify it to the dot notation." 453 | ] 454 | }, 455 | { 456 | "cell_type": "code", 457 | "execution_count": null, 458 | "metadata": {}, 459 | "outputs": [], 460 | "source": [ 461 | "from addict import Dict\n", 462 | "\n", 463 | "my_new_dict = Dict(my_dict)\n", 464 | "print(my_new_dict.stats)\n", 465 | "my_new_dict.stats.pull_requests = 10\n", 466 | "print(my_new_dict.stats)" 467 | ] 468 | }, 469 | { 470 | "cell_type": "markdown", 471 | "metadata": {}, 472 | "source": [ 473 | "### Python syntax\n", 474 | "\n", 475 | "In Python code blocks are structured by indentation level. It is is a language requirement not a matter of style. This principle makes it easier to read because it eliminates most of braces ```{ }``` and ```end``` statements which makes Python code much more readable. All statements with the same distance from left belong to the same block of code, i.e. the statements within a block line up vertically. If a block has to be more deeply nested, it is simply indented further to the right. \n", 476 | "\n", 477 | "Loops and Conditional statements end with a colon ```:```. The same is true for functions and other structures introducing blocks." 478 | ] 479 | }, 480 | { 481 | "cell_type": "markdown", 482 | "metadata": {}, 483 | "source": [ 484 | "### Conditions\n", 485 | "\n", 486 | "Conditional statements are used to direct the flow of the program to different commands based on whether a statement is ```True``` or ```False```. A boolean (```True``` or ```False```) is used to direct the flow with an ```if```, ```elif``` (else if), or ```else``` parts to the statement." 487 | ] 488 | }, 489 | { 490 | "cell_type": "markdown", 491 | "metadata": {}, 492 | "source": [ 493 | "***Example:***" 494 | ] 495 | }, 496 | { 497 | "cell_type": "code", 498 | "execution_count": null, 499 | "metadata": {}, 500 | "outputs": [], 501 | "source": [ 502 | "x = 4\n", 503 | "if x < 3:\n", 504 | " print('less than 3')\n", 505 | "elif x<4:\n", 506 | " print('between 3 and 4')\n", 507 | "else:\n", 508 | " print('greater than 4')" 509 | ] 510 | }, 511 | { 512 | "cell_type": "markdown", 513 | "metadata": {}, 514 | "source": [ 515 | "***Task:*** Write a conditional statement that checks whether the string ```'spam'``` is in ```menu```. \n", 516 | "**Hint:** Check the operators list for membership statements. " 517 | ] 518 | }, 519 | { 520 | "cell_type": "code", 521 | "execution_count": null, 522 | "metadata": {}, 523 | "outputs": [], 524 | "source": [ 525 | "menu = ['eggs','bacon']" 526 | ] 527 | }, 528 | { 529 | "cell_type": "markdown", 530 | "metadata": {}, 531 | "source": [ 532 | "### Loops\n", 533 | "Often, we don't know (or care) how many elements are in a container (e.g. list). We just want to perform an operation on every element of the container. The ```for``` statement in Python differs a bit from what you may be used to in C or Pascal. Python’s ```for``` statement iterates over the items of any sequence (e.g. a list or a string), in the order that they appear in the sequence." 534 | ] 535 | }, 536 | { 537 | "cell_type": "markdown", 538 | "metadata": {}, 539 | "source": [ 540 | "***Example:***" 541 | ] 542 | }, 543 | { 544 | "cell_type": "code", 545 | "execution_count": null, 546 | "metadata": {}, 547 | "outputs": [], 548 | "source": [ 549 | "list_of_primes = [2, 3, 5, 7]\n", 550 | "for element in list_of_primes:\n", 551 | " print(element)" 552 | ] 553 | }, 554 | { 555 | "cell_type": "markdown", 556 | "metadata": {}, 557 | "source": [ 558 | "***Task:*** Create a list with strings, iterate over all elements and print the string and the length of the string using the ```len``` function." 559 | ] 560 | }, 561 | { 562 | "cell_type": "code", 563 | "execution_count": null, 564 | "metadata": {}, 565 | "outputs": [], 566 | "source": [] 567 | }, 568 | { 569 | "cell_type": "markdown", 570 | "metadata": {}, 571 | "source": [ 572 | "## Functions\n", 573 | "A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing. There are built-in functions like ```print()```, ```help()```, etc. but it is possible to create your own functions. These functions are called user-defined functions.\n", 574 | "A function definition describes what is to be calculated once the function is called. The keyword ```def``` introduces a function definition. It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. \n", 575 | "\n", 576 | "***Note***, the function is not evaluated when defined!" 577 | ] 578 | }, 579 | { 580 | "cell_type": "markdown", 581 | "metadata": {}, 582 | "source": [ 583 | "***Example:***" 584 | ] 585 | }, 586 | { 587 | "cell_type": "code", 588 | "execution_count": null, 589 | "metadata": {}, 590 | "outputs": [], 591 | "source": [ 592 | "def circle_area(diameter):\n", 593 | " return 3.1415926/4 * diameter**2\n", 594 | "\n", 595 | "area = circle_area(3)\n", 596 | "print(area)" 597 | ] 598 | }, 599 | { 600 | "cell_type": "markdown", 601 | "metadata": {}, 602 | "source": [ 603 | "***Task:*** Define a function that returns the volume of a cylinder as a function of diameter and length. " 604 | ] 605 | }, 606 | { 607 | "cell_type": "code", 608 | "execution_count": null, 609 | "metadata": {}, 610 | "outputs": [], 611 | "source": [] 612 | } 613 | ], 614 | "metadata": { 615 | "kernelspec": { 616 | "display_name": "Python 3", 617 | "language": "python", 618 | "name": "python3" 619 | }, 620 | "language_info": { 621 | "codemirror_mode": { 622 | "name": "ipython", 623 | "version": 3 624 | }, 625 | "file_extension": ".py", 626 | "mimetype": "text/x-python", 627 | "name": "python", 628 | "nbconvert_exporter": "python", 629 | "pygments_lexer": "ipython3", 630 | "version": "3.8.6" 631 | } 632 | }, 633 | "nbformat": 4, 634 | "nbformat_minor": 4 635 | } 636 | -------------------------------------------------------------------------------- /00_Introduction_Python/03_numpy_scipy_matplotlib.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Importing packages and introduction to Numpy/Scipy/Matplotlib\n", 8 | "Python capabilities are extended with many useful packages. A few of the packages that we'll use in this class are:\n", 9 | "\n", 10 | "- [NumPy](https://www.numpy.org/) for array-computing\n", 11 | "- [SciPy](https://www.scipy.org/) for numerical routines\n", 12 | "- [Matplotlib](https://www.matplotlib.org/) for data visualization\n", 13 | "\n", 14 | "You can import a package with ```import package as pk``` where ```package``` is the package name and ```pk``` is the abbreviated name." 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "***Task:*** Import the ```numpy``` package as ```np``` (shortened name) and get help on the ```np.linspace``` function." 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": null, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "import numpy as np\n", 31 | "help(np.linspace)" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "metadata": {}, 37 | "source": [ 38 | "***Task:*** Use ```np.linspace``` to define 20 equally spaced values between $0$ and $2\\,\\pi$. Name the variable ```x``` and use the built-in ```np.pi``` constant for $\\pi$." 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "x = np.linspace(0,2*np.pi,20)\n", 48 | "print(x)" 49 | ] 50 | }, 51 | { 52 | "cell_type": "markdown", 53 | "metadata": {}, 54 | "source": [ 55 | "***Task:*** Use ```np.sin``` to calculate a new variable ```y``` as $y=2\\,\\sin{\\left(\\frac{x}{2}\\right)}$." 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [ 64 | "y = 2*np.sin(x/2)\n", 65 | "print(y)" 66 | ] 67 | }, 68 | { 69 | "cell_type": "markdown", 70 | "metadata": {}, 71 | "source": [ 72 | "***Task:*** Import the ```matplotlib.pyplot``` package as ```plt``` (shortened name) and show the help on the ```plt.plot``` function." 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": null, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [ 81 | "import matplotlib.pyplot as plt\n", 82 | "help(plt.plot)" 83 | ] 84 | }, 85 | { 86 | "cell_type": "markdown", 87 | "metadata": {}, 88 | "source": [ 89 | "***Task:*** Create a plot of ```x``` and ```y``` with the ```plt.plot``` function. Add an x-label with ```plt.xlabel``` and a y-label with ```plt.ylabel```." 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": null, 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [ 98 | "plt.plot(x,y,label='y=2*sin(x/2)')\n", 99 | "plt.xlabel('x')\n", 100 | "plt.ylabel('y')\n", 101 | "\n", 102 | "z = np.cos(x)\n", 103 | "plt.plot(x,z,label='cos(x)')\n", 104 | "\n", 105 | "plt.title('Trigonometry Functions')\n", 106 | "plt.legend()" 107 | ] 108 | } 109 | ], 110 | "metadata": { 111 | "kernelspec": { 112 | "display_name": "Python 3", 113 | "language": "python", 114 | "name": "python3" 115 | }, 116 | "language_info": { 117 | "codemirror_mode": { 118 | "name": "ipython", 119 | "version": 3 120 | }, 121 | "file_extension": ".py", 122 | "mimetype": "text/x-python", 123 | "name": "python", 124 | "nbconvert_exporter": "python", 125 | "pygments_lexer": "ipython3", 126 | "version": "3.7.9" 127 | } 128 | }, 129 | "nbformat": 4, 130 | "nbformat_minor": 4 131 | } 132 | -------------------------------------------------------------------------------- /00_Introduction_Python/images/python_ecosystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/00_Introduction_Python/images/python_ecosystem.png -------------------------------------------------------------------------------- /00_Introduction_Python/images/stackoverflow-growth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/00_Introduction_Python/images/stackoverflow-growth.png -------------------------------------------------------------------------------- /01_inlet_profiles/resources/2_comp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/01_inlet_profiles/resources/2_comp.png -------------------------------------------------------------------------------- /01_inlet_profiles/resources/const.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/01_inlet_profiles/resources/const.png -------------------------------------------------------------------------------- /01_inlet_profiles/resources/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/01_inlet_profiles/resources/gradient.png -------------------------------------------------------------------------------- /01_inlet_profiles/resources/inlet_profiles.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import scipy.interpolate 3 | import matplotlib.pyplot as plt 4 | 5 | 6 | def plot_sections(section_times, coeffs, file_name, n_comp=1): 7 | """Function for plotting section times demo 8 | 9 | Parameters 10 | ---------- 11 | section_times : ndarray, shape (m+1,) 12 | Polynomial breakpoints for piecewise polynomials. 13 | coeffs : ndarray, shape (k, m, …) 14 | Polynomial coefficients, order k and m intervals. 15 | file_name : string 16 | name for saving figure. 17 | """ 18 | n_sec = int(len(coeffs)/n_comp) 19 | time = np.linspace(section_times[0], section_times[-1], 1001) 20 | 21 | plt.figure() 22 | 23 | y_max = 0 24 | for n in range(n_comp): 25 | start = n * n_sec 26 | end = (n + 1) * n_sec 27 | sections = scipy.interpolate.PPoly(coeffs[start:end], section_times) 28 | plt.plot(time, sections(time)) 29 | 30 | y_max = max(y_max, max(sections(time))) 31 | 32 | sections_center = [] 33 | for i in range(len(section_times)-1): 34 | sections_center.append((section_times[i] + section_times[i+1])/2) 35 | 36 | 37 | plt.vlines(section_times, 0, 1.1*y_max, 'k', '--') 38 | 39 | plt.ylabel('concentration') 40 | plt.xlabel('time') 41 | 42 | plt.show() 43 | 44 | if file_name is not None: 45 | plt.savefig(file_name) 46 | 47 | 48 | 49 | if __name__ == '__main__': 50 | plt.close('all') 51 | section_times = [0, 1] 52 | coeffs = [[1]] 53 | file_name = './const.png' 54 | plot_sections(section_times, coeffs, file_name) 55 | 56 | section_times = [0, 1, 2] 57 | coeffs = [[1, 0]] 58 | file_name = './step.png' 59 | plot_sections(section_times, coeffs, file_name) 60 | 61 | section_times = [0, 1, 2, 3] 62 | coeffs = [[1, 0,-1], 63 | [0, 1, 1]] 64 | file_name = './gradient.png' 65 | plot_sections(section_times, coeffs, file_name) 66 | 67 | section_times = [0, 1, 2] 68 | coeffs = [[1, 0], 69 | [0, 0], 70 | [0, 1]] 71 | file_name = './quad.png' 72 | plot_sections(section_times, coeffs, file_name) 73 | 74 | section_times = [0, 1, 2] 75 | coeffs = [[0, 2], 76 | [0.5, 1]] 77 | file_name = './2_comp.png' 78 | plot_sections(section_times, coeffs, file_name, n_comp=2) -------------------------------------------------------------------------------- /01_inlet_profiles/resources/quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/01_inlet_profiles/resources/quad.png -------------------------------------------------------------------------------- /01_inlet_profiles/resources/step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/01_inlet_profiles/resources/step.png -------------------------------------------------------------------------------- /02_residence_time_distributions/resources/rtd_figures.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import scipy.interpolate 3 | import matplotlib.pyplot as plt 4 | 5 | def plot_step(c_init, c_step, t_switch, file_name=None): 6 | """Function for plotting section times demo 7 | 8 | Parameters 9 | ---------- 10 | c_init : ndarray 11 | Initial concentration 12 | c_step : ndarray 13 | Step concentration 14 | t_switch : float 15 | time for concentration step 16 | file_name : string 17 | name for saving figure. 18 | """ 19 | plt.figure() 20 | 21 | 22 | 23 | step_fun = lambda t_switch, time: np.array([c_init if t <= t_switch else c_step for t in time]) 24 | 25 | time = np.linspace(0, 4*t_switch, 1001) 26 | 27 | plt.plot(time, step_fun(t_switch, time)) 28 | 29 | plt.xticks([]) 30 | plt.yticks([]) 31 | 32 | plt.ylabel('concentration') 33 | plt.xlabel('time') 34 | 35 | plt.show() 36 | 37 | if file_name is not None: 38 | plt.savefig(file_name) 39 | 40 | 41 | 42 | if __name__ == '__main__': 43 | 44 | plt.close('all') 45 | file_name = './step.png' 46 | plot_step(0, 1, 1, file_name) -------------------------------------------------------------------------------- /02_residence_time_distributions/resources/step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/02_residence_time_distributions/resources/step.png -------------------------------------------------------------------------------- /02_residence_time_distributions/resources/system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/02_residence_time_distributions/resources/system.png -------------------------------------------------------------------------------- /02_residence_time_distributions/resources/system_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/02_residence_time_distributions/resources/system_chain.png -------------------------------------------------------------------------------- /02_residence_time_distributions/resources/system_dirac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/02_residence_time_distributions/resources/system_dirac.png -------------------------------------------------------------------------------- /04_adsorption/resources/Picture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/04_adsorption/resources/Picture1.png -------------------------------------------------------------------------------- /05_simple_chromatographic_processes/resources/dextran_inlet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/05_simple_chromatographic_processes/resources/dextran_inlet.png -------------------------------------------------------------------------------- /05_simple_chromatographic_processes/resources/lwe_inlet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/05_simple_chromatographic_processes/resources/lwe_inlet.png -------------------------------------------------------------------------------- /05_simple_chromatographic_processes/resources/system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/05_simple_chromatographic_processes/resources/system.png -------------------------------------------------------------------------------- /06_advanced_chromatographic_processes/resources/smb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/06_advanced_chromatographic_processes/resources/smb.png -------------------------------------------------------------------------------- /06_advanced_chromatographic_processes/resources/valve_mixer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cadet/CADET-Python-Tutorial/bd83801445adf9afe5fbac963df146b865641480/06_advanced_chromatographic_processes/resources/valve_mixer.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 58 | Public License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial-ShareAlike 4.0 International Public License 63 | ("Public License"). To the extent this Public License may be 64 | interpreted as a contract, You are granted the Licensed Rights in 65 | consideration of Your acceptance of these terms and conditions, and the 66 | Licensor grants You such rights in consideration of benefits the 67 | Licensor receives from making the Licensed Material available under 68 | these terms and conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-NC-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution, NonCommercial, and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. NonCommercial means not primarily intended for or directed towards 126 | commercial advantage or monetary compensation. For purposes of 127 | this Public License, the exchange of the Licensed Material for 128 | other material subject to Copyright and Similar Rights by digital 129 | file-sharing or similar means is NonCommercial provided there is 130 | no payment of monetary compensation in connection with the 131 | exchange. 132 | 133 | l. Share means to provide material to the public by any means or 134 | process that requires permission under the Licensed Rights, such 135 | as reproduction, public display, public performance, distribution, 136 | dissemination, communication, or importation, and to make material 137 | available to the public including in ways that members of the 138 | public may access the material from a place and at a time 139 | individually chosen by them. 140 | 141 | m. Sui Generis Database Rights means rights other than copyright 142 | resulting from Directive 96/9/EC of the European Parliament and of 143 | the Council of 11 March 1996 on the legal protection of databases, 144 | as amended and/or succeeded, as well as other essentially 145 | equivalent rights anywhere in the world. 146 | 147 | n. You means the individual or entity exercising the Licensed Rights 148 | under this Public License. Your has a corresponding meaning. 149 | 150 | 151 | Section 2 -- Scope. 152 | 153 | a. License grant. 154 | 155 | 1. Subject to the terms and conditions of this Public License, 156 | the Licensor hereby grants You a worldwide, royalty-free, 157 | non-sublicensable, non-exclusive, irrevocable license to 158 | exercise the Licensed Rights in the Licensed Material to: 159 | 160 | a. reproduce and Share the Licensed Material, in whole or 161 | in part, for NonCommercial purposes only; and 162 | 163 | b. produce, reproduce, and Share Adapted Material for 164 | NonCommercial purposes only. 165 | 166 | 2. Exceptions and Limitations. For the avoidance of doubt, where 167 | Exceptions and Limitations apply to Your use, this Public 168 | License does not apply, and You do not need to comply with 169 | its terms and conditions. 170 | 171 | 3. Term. The term of this Public License is specified in Section 172 | 6(a). 173 | 174 | 4. Media and formats; technical modifications allowed. The 175 | Licensor authorizes You to exercise the Licensed Rights in 176 | all media and formats whether now known or hereafter created, 177 | and to make technical modifications necessary to do so. The 178 | Licensor waives and/or agrees not to assert any right or 179 | authority to forbid You from making technical modifications 180 | necessary to exercise the Licensed Rights, including 181 | technical modifications necessary to circumvent Effective 182 | Technological Measures. For purposes of this Public License, 183 | simply making modifications authorized by this Section 2(a) 184 | (4) never produces Adapted Material. 185 | 186 | 5. Downstream recipients. 187 | 188 | a. Offer from the Licensor -- Licensed Material. Every 189 | recipient of the Licensed Material automatically 190 | receives an offer from the Licensor to exercise the 191 | Licensed Rights under the terms and conditions of this 192 | Public License. 193 | 194 | b. Additional offer from the Licensor -- Adapted Material. 195 | Every recipient of Adapted Material from You 196 | automatically receives an offer from the Licensor to 197 | exercise the Licensed Rights in the Adapted Material 198 | under the conditions of the Adapter's License You apply. 199 | 200 | c. No downstream restrictions. You may not offer or impose 201 | any additional or different terms or conditions on, or 202 | apply any Effective Technological Measures to, the 203 | Licensed Material if doing so restricts exercise of the 204 | Licensed Rights by any recipient of the Licensed 205 | Material. 206 | 207 | 6. No endorsement. Nothing in this Public License constitutes or 208 | may be construed as permission to assert or imply that You 209 | are, or that Your use of the Licensed Material is, connected 210 | with, or sponsored, endorsed, or granted official status by, 211 | the Licensor or others designated to receive attribution as 212 | provided in Section 3(a)(1)(A)(i). 213 | 214 | b. Other rights. 215 | 216 | 1. Moral rights, such as the right of integrity, are not 217 | licensed under this Public License, nor are publicity, 218 | privacy, and/or other similar personality rights; however, to 219 | the extent possible, the Licensor waives and/or agrees not to 220 | assert any such rights held by the Licensor to the limited 221 | extent necessary to allow You to exercise the Licensed 222 | Rights, but not otherwise. 223 | 224 | 2. Patent and trademark rights are not licensed under this 225 | Public License. 226 | 227 | 3. To the extent possible, the Licensor waives any right to 228 | collect royalties from You for the exercise of the Licensed 229 | Rights, whether directly or through a collecting society 230 | under any voluntary or waivable statutory or compulsory 231 | licensing scheme. In all other cases the Licensor expressly 232 | reserves any right to collect such royalties, including when 233 | the Licensed Material is used other than for NonCommercial 234 | purposes. 235 | 236 | 237 | Section 3 -- License Conditions. 238 | 239 | Your exercise of the Licensed Rights is expressly made subject to the 240 | following conditions. 241 | 242 | a. Attribution. 243 | 244 | 1. If You Share the Licensed Material (including in modified 245 | form), You must: 246 | 247 | a. retain the following if it is supplied by the Licensor 248 | with the Licensed Material: 249 | 250 | i. identification of the creator(s) of the Licensed 251 | Material and any others designated to receive 252 | attribution, in any reasonable manner requested by 253 | the Licensor (including by pseudonym if 254 | designated); 255 | 256 | ii. a copyright notice; 257 | 258 | iii. a notice that refers to this Public License; 259 | 260 | iv. a notice that refers to the disclaimer of 261 | warranties; 262 | 263 | v. a URI or hyperlink to the Licensed Material to the 264 | extent reasonably practicable; 265 | 266 | b. indicate if You modified the Licensed Material and 267 | retain an indication of any previous modifications; and 268 | 269 | c. indicate the Licensed Material is licensed under this 270 | Public License, and include the text of, or the URI or 271 | hyperlink to, this Public License. 272 | 273 | 2. You may satisfy the conditions in Section 3(a)(1) in any 274 | reasonable manner based on the medium, means, and context in 275 | which You Share the Licensed Material. For example, it may be 276 | reasonable to satisfy the conditions by providing a URI or 277 | hyperlink to a resource that includes the required 278 | information. 279 | 3. If requested by the Licensor, You must remove any of the 280 | information required by Section 3(a)(1)(A) to the extent 281 | reasonably practicable. 282 | 283 | b. ShareAlike. 284 | 285 | In addition to the conditions in Section 3(a), if You Share 286 | Adapted Material You produce, the following conditions also apply. 287 | 288 | 1. The Adapter's License You apply must be a Creative Commons 289 | license with the same License Elements, this version or 290 | later, or a BY-NC-SA Compatible License. 291 | 292 | 2. You must include the text of, or the URI or hyperlink to, the 293 | Adapter's License You apply. You may satisfy this condition 294 | in any reasonable manner based on the medium, means, and 295 | context in which You Share Adapted Material. 296 | 297 | 3. You may not offer or impose any additional or different terms 298 | or conditions on, or apply any Effective Technological 299 | Measures to, Adapted Material that restrict exercise of the 300 | rights granted under the Adapter's License You apply. 301 | 302 | 303 | Section 4 -- Sui Generis Database Rights. 304 | 305 | Where the Licensed Rights include Sui Generis Database Rights that 306 | apply to Your use of the Licensed Material: 307 | 308 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 309 | to extract, reuse, reproduce, and Share all or a substantial 310 | portion of the contents of the database for NonCommercial purposes 311 | only; 312 | 313 | b. if You include all or a substantial portion of the database 314 | contents in a database in which You have Sui Generis Database 315 | Rights, then the database in which You have Sui Generis Database 316 | Rights (but not its individual contents) is Adapted Material, 317 | including for purposes of Section 3(b); and 318 | 319 | c. You must comply with the conditions in Section 3(a) if You Share 320 | all or a substantial portion of the contents of the database. 321 | 322 | For the avoidance of doubt, this Section 4 supplements and does not 323 | replace Your obligations under this Public License where the Licensed 324 | Rights include other Copyright and Similar Rights. 325 | 326 | 327 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 328 | 329 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 330 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 331 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 332 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 333 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 334 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 335 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 336 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 337 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 338 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 339 | 340 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 341 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 342 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 343 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 344 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 345 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 346 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 347 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 348 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 349 | 350 | c. The disclaimer of warranties and limitation of liability provided 351 | above shall be interpreted in a manner that, to the extent 352 | possible, most closely approximates an absolute disclaimer and 353 | waiver of all liability. 354 | 355 | 356 | Section 6 -- Term and Termination. 357 | 358 | a. This Public License applies for the term of the Copyright and 359 | Similar Rights licensed here. However, if You fail to comply with 360 | this Public License, then Your rights under this Public License 361 | terminate automatically. 362 | 363 | b. Where Your right to use the Licensed Material has terminated under 364 | Section 6(a), it reinstates: 365 | 366 | 1. automatically as of the date the violation is cured, provided 367 | it is cured within 30 days of Your discovery of the 368 | violation; or 369 | 370 | 2. upon express reinstatement by the Licensor. 371 | 372 | For the avoidance of doubt, this Section 6(b) does not affect any 373 | right the Licensor may have to seek remedies for Your violations 374 | of this Public License. 375 | 376 | c. For the avoidance of doubt, the Licensor may also offer the 377 | Licensed Material under separate terms or conditions or stop 378 | distributing the Licensed Material at any time; however, doing so 379 | will not terminate this Public License. 380 | 381 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 382 | License. 383 | 384 | 385 | Section 7 -- Other Terms and Conditions. 386 | 387 | a. The Licensor shall not be bound by any additional or different 388 | terms or conditions communicated by You unless expressly agreed. 389 | 390 | b. Any arrangements, understandings, or agreements regarding the 391 | Licensed Material not stated herein are separate from and 392 | independent of the terms and conditions of this Public License. 393 | 394 | 395 | Section 8 -- Interpretation. 396 | 397 | a. For the avoidance of doubt, this Public License does not, and 398 | shall not be interpreted to, reduce, limit, restrict, or impose 399 | conditions on any use of the Licensed Material that could lawfully 400 | be made without permission under this Public License. 401 | 402 | b. To the extent possible, if any provision of this Public License is 403 | deemed unenforceable, it shall be automatically reformed to the 404 | minimum extent necessary to make it enforceable. If the provision 405 | cannot be reformed, it shall be severed from this Public License 406 | without affecting the enforceability of the remaining terms and 407 | conditions. 408 | 409 | c. No term or condition of this Public License will be waived and no 410 | failure to comply consented to unless expressly agreed to by the 411 | Licensor. 412 | 413 | d. Nothing in this Public License constitutes or may be interpreted 414 | as a limitation upon, or waiver of, any privileges and immunities 415 | that apply to the Licensor or You, including from the legal 416 | processes of any jurisdiction or authority. 417 | 418 | ======================================================================= 419 | 420 | Creative Commons is not a party to its public 421 | licenses. Notwithstanding, Creative Commons may elect to apply one of 422 | its public licenses to material it publishes and in those instances 423 | will be considered the “Licensor.” The text of the Creative Commons 424 | public licenses is dedicated to the public domain under the CC0 Public 425 | Domain Dedication. Except for the limited purpose of indicating that 426 | material is shared under a Creative Commons public license or as 427 | otherwise permitted by the Creative Commons policies published at 428 | creativecommons.org/policies, Creative Commons does not authorize the 429 | use of the trademark "Creative Commons" or any other trademark or logo 430 | of Creative Commons without its prior written consent including, 431 | without limitation, in connection with any unauthorized modifications 432 | to any of its public licenses or any other arrangements, 433 | understandings, or agreements concerning use of licensed material. For 434 | the avoidance of doubt, this paragraph does not form part of the 435 | public licenses. 436 | 437 | Creative Commons may be contacted at creativecommons.org. 438 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CC BY NC SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa] 2 | 3 | This work is licensed under a 4 | [Creative Commons Attribution 4.0 International License][cc-by-nc-sa]. 5 | 6 | [![CC BY 4.0][cc-by-nc-sa-image]][cc-by-nc-sa] 7 | 8 | [cc-by-nc-sa]: https://creativecommons.org/licenses/by-nc-sa/4.0/ 9 | [cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png 10 | [cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY%20NC%20SA%204.0-lightgrey.svg 11 | 12 | # We recommend for new users of CADET to follow the [CADET-Workshop](https://github.com/cadet/CADET-Workshop) 13 | 14 | This repository is maintained to serve as a documentation of the CADET-Interface (using CADET-Python). 15 | 16 | For more information, see also: 17 | - **Website (including documentation):** https://cadet.github.io 18 | - **Forum:** https://forum.cadet-web.de 19 | - **Source:** https://github.com/cadet/cadet-core 20 | - **Bug reports:** https://github.com/cadet/cadet-core 21 | 22 | ### Download the tutorials 23 | To run the tutorials locally, we recommend installing [Anaconda](https://www.anaconda.com/). 24 | Anaconda is a high-performance scientific distribution of Python that includes many common packages needed for scientific and engineering work. 25 | Download the installer from their website and run it for the local user. 26 | We recommend creating a dedicated environment for CADET. 27 | 28 | The easiest way to download the tutorials is to clone this repository. 29 | For this purpuse, make sure, [git](https://git-scm.com/downloads) is installed. 30 | 31 | From a `git bash` run 32 | ``` 33 | git clone https://github.com/cadet/CADET-Python-Tutorial 34 | ``` 35 | 36 | Then, from the `Anaconda Prompt`, `cd` into the directory and install all the requirements by running the following command: 37 | ``` 38 | conda env create -f ./environment.yml 39 | ``` 40 | This will create a new conda environment called `cadet`. 41 | To activate it, run: 42 | ``` 43 | conda activate cadet 44 | ``` 45 | 46 | ### Getting started 47 | Fire up a `jupyter-lab` from `Anaconda Prompt` and navigate to the location of this repository using the file manager on the left. 48 | Then, start by following the instructions in `getting_started.ipynb`. 49 | It includes a check that everything is installed correctly. 50 | 51 | In case you are new to `Python` and `jupyter`, we also included a small tutorial (`00_Introduction_Python`) which covers the necessary basics for the tutorials. 52 | 53 | 54 | ### Fixing potential problems. 55 | - If you get the following error `The code execution cannot proceed because VCRUNTIME140_1.dll was not found. Reinstalling the program may fix this problem.`, please visit https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads and install the latest Microsoft Visual C++ Redistributable. 56 | - Some of the notebooks include interactive graphs. To enable them, please open an Anaconda prompt and run: 57 | - For JupyterLab 2.0+ 58 | ``` 59 | jupyter labextension install @jupyter-widgets/jupyterlab-manager 60 | jupyter lab clean 61 | jupyter lab build 62 | ``` 63 | - For JupyterLab 3.0+: install `ipympl` 64 | 65 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: cadet 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.10 6 | - cadet 7 | - numpy 8 | - scipy 9 | - matplotlib 10 | - jupyterlab 11 | - ipywidgets 12 | - pip 13 | - pip: 14 | - cadet-python 15 | -------------------------------------------------------------------------------- /getting_started.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Introduction\n", 8 | "\n", 9 | "This document is to help you check if CADET is installed correctly.\n", 10 | "If you install everything is this document you will be able to run all the examples on your local machine and be ready to use CADET for running further simulations. \n", 11 | "\n", 12 | "
\n", 13 | "\n", 14 | "**Note:** \n", 15 | "\n", 16 | "Before starting any of the tutorials, make sure you have read the instructions carefully.\n", 17 | "Make sure, you have updated the tutorials, set the correct path for `CADET`, and checked that `CADET` runs.\n", 18 | " \n", 19 | "
\n" 20 | ] 21 | }, 22 | { 23 | "cell_type": "markdown", 24 | "metadata": {}, 25 | "source": [ 26 | "## Update the tutorials\n", 27 | "\n", 28 | "This cell will connect to github and update to a newer version of the tutorial later.\n", 29 | "\n", 30 | "
\n", 31 | "\n", 32 | "**Warning:** \n", 33 | "\n", 34 | "Updating the repository will also remove any local changes you may have made to the tutorial files!!!\n", 35 | " \n", 36 | "
" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "# Python path library support\n", 46 | "from pathlib import Path\n", 47 | "from git import Repo\n", 48 | "\n", 49 | "# This is where the tutorial will be checked out\n", 50 | "tutorial_dir = Path.home() / \"CADET-Tutorial\"\n", 51 | "\n", 52 | "# If the tutorial has already been copied we need to update it instead of copying it again\n", 53 | "if tutorial_dir.exists():\n", 54 | " repo = Repo(tutorial_dir.as_posix())\n", 55 | "\n", 56 | " remote = repo.remote()\n", 57 | " remote.fetch() \n", 58 | " repo.git.reset('--hard','origin/master')\n", 59 | "else:\n", 60 | " Repo.clone_from(\"https://github.com/modsim/CADET-Tutorial\", tutorial_dir)" 61 | ] 62 | }, 63 | { 64 | "cell_type": "markdown", 65 | "metadata": {}, 66 | "source": [ 67 | "## CADET documentation\n", 68 | "\n", 69 | "The documentation of CADET is available on https://cadet.github.io. \n", 70 | "It includes theoretical background of all the [models](https://cadet.github.io/master/modelling/) implemented in CADET, a detailed description of the [interface specifications](https://cadet.github.io/master/interface/), as well as information on the numerics of the [simulator](https://cadet.github.io/master/simulation/)." 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": {}, 76 | "source": [ 77 | "## CADET-Python\n", 78 | "\n", 79 | "In this tutorial, we will use CADET-Python to interface CADET.\n", 80 | "It is a file based frontend for CADET which maps almost exactly to the documented CADET interface specifications.\n", 81 | "The package includes a Cadet class which serves as a generic HDF5 frontend.\n", 82 | "\n", 83 | "As an example, we consider setting the external porosity for the column model (unit_001).\n", 84 | "From file format, the path for this is `/input/model/unit_001/COL_POROSITY`.\n", 85 | "In the Python frontend, this becomes:\n", 86 | "\n", 87 | "```\n", 88 | "sim = Cadet()\n", 89 | "sim.root.input.model.unit_001.col_porosity = 0.33\n", 90 | "```\n", 91 | "\n", 92 | "To create the model and specify its parameters, we create an instance of the Cadet class. In the root attribute of this object, the parameter structure is defined as described in the file format reference. It is implemented as a Dict of the addict package. This allows for creating arbitrary nested dictionaries using dot-notation.\n", 93 | "\n", 94 | "
\n", 95 | "\n", 96 | "**Warning:** \n", 97 | "\n", 98 | "Note, that the Cadet class does not provide any sanity checks. If parameters are misspelled or have the wrong dimensions, they are simply ignored. This can cause problems later on, when the simulator is run.\n", 99 | "\n", 100 | "
\n" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "## Utility functions for this tutorial\n", 108 | "\n", 109 | "For the purpose of this tutorial, we have provided some [utility functions](./utils.ipynb) which provide some templates and other useful functionality." 110 | ] 111 | }, 112 | { 113 | "cell_type": "markdown", 114 | "metadata": {}, 115 | "source": [ 116 | "## Verify CADET is working\n", 117 | "CADET comes with some basic tests to verify that it is working correctly. \n", 118 | "If you install from the zip file this should just automatically work.\n", 119 | "If it does not please report any error messages you get so we can help fix the problem.\n", 120 | "\n", 121 | "
\n", 122 | "\n", 123 | "**Note:** \n", 124 | "\n", 125 | "In case you did not use `conda` to install CADET, please make sure to enter the correct path to your CADET installation there!\n", 126 | "\n", 127 | "
" 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "metadata": {}, 134 | "outputs": [], 135 | "source": [ 136 | "%run ./utils.ipynb\n", 137 | "\n", 138 | "ret = subprocess.run(\n", 139 | " [lwe_path.as_posix()], \n", 140 | " stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=install_path\n", 141 | ")\n", 142 | "if ret.returncode == 0:\n", 143 | " print(\"Test simulation was created\")\n", 144 | "else:\n", 145 | " print(\"Failure: Creation of test simulation ran into problems\")\n", 146 | "if ret.stdout:\n", 147 | " print('Output', ret.stdout.decode('utf-8'))\n", 148 | "if ret.stderr:\n", 149 | " print('Errors', ret.stderr.decode('utf-8'))\n", 150 | " \n", 151 | "lwe_hdf5_path = install_path / 'LWE.h5'\n", 152 | "\n", 153 | "# create a simulation\n", 154 | "sim = Cadet()\n", 155 | "\n", 156 | "# set the path to where a simulation can be found\n", 157 | "sim.filename = lwe_hdf5_path.as_posix()\n", 158 | "\n", 159 | "# run the simulation\n", 160 | "data = sim.run()\n", 161 | "\n", 162 | "if data.returncode == 0:\n", 163 | " print(\"Simulation completed successfully\")\n", 164 | "else:\n", 165 | " print(\"Simulation failed\")\n", 166 | "\n", 167 | "# Load the data from the simulation\n", 168 | "sim.load()" 169 | ] 170 | } 171 | ], 172 | "metadata": { 173 | "kernelspec": { 174 | "display_name": "Python 3 (ipykernel)", 175 | "language": "python", 176 | "name": "python3" 177 | }, 178 | "language_info": { 179 | "codemirror_mode": { 180 | "name": "ipython", 181 | "version": 3 182 | }, 183 | "file_extension": ".py", 184 | "mimetype": "text/x-python", 185 | "name": "python", 186 | "nbconvert_exporter": "python", 187 | "pygments_lexer": "ipython3", 188 | "version": "3.9.7" 189 | } 190 | }, 191 | "nbformat": 4, 192 | "nbformat_minor": 4 193 | } 194 | -------------------------------------------------------------------------------- /resources/dextran_experiment.csv: -------------------------------------------------------------------------------- 1 | 0.0,0.0 2 | 1.0,-4.702848186084886e-97 3 | 2.0,1.0381282617829266e-89 4 | 3.0,5.094517845571499e-86 5 | 4.0,-1.9950531489041665e-82 6 | 5.0,-6.629811741975923e-80 7 | 6.0,4.916217837199065e-77 8 | 7.0,1.7227581317604414e-75 9 | 8.0,-9.589890765038024e-73 10 | 9.0,3.3990065720829446e-72 11 | 10.0,3.070269106574815e-69 12 | 11.0,-5.104400790384335e-68 13 | 12.0,-1.513050903613588e-66 14 | 13.0,3.0569901624230535e-65 15 | 14.0,4.979305140461423e-64 16 | 15.0,-6.035387891675968e-63 17 | 16.0,-9.309590564804677e-62 18 | 17.0,4.622385616544162e-61 19 | 18.0,9.971364804806084e-60 20 | 19.0,-2.2100682596676324e-60 21 | 20.0,-5.9092290475532996e-58 22 | 21.0,-1.8404644191110982e-57 23 | 22.0,1.7920902729898435e-56 24 | 23.0,1.2273274428647233e-55 25 | 24.0,-1.268344019665487e-55 26 | 25.0,-3.6050409476246534e-54 27 | 26.0,-8.901112609698439e-54 28 | 27.0,4.413813379506895e-53 29 | 28.0,3.0506209237872164e-52 30 | 29.0,2.5422669740757363e-52 31 | 30.0,-3.728191171956133e-51 32 | 31.0,-1.4433908846725844e-50 33 | 32.0,-2.3109642373657462e-51 34 | 33.0,1.5087382778012988e-49 35 | 34.0,4.903937609880518e-49 36 | 35.0,4.379515859393295e-50 37 | 36.0,-4.438619399188863e-48 38 | 37.0,-1.4050254307358762e-47 39 | 38.0,-6.037504378779409e-48 40 | 39.0,9.360592480043762e-47 41 | 40.0,3.3077788017269285e-46 42 | 41.0,3.1925598406235053e-46 43 | 42.0,-1.3399654260820327e-45 44 | 43.0,-6.148572631117582e-45 45 | 44.0,-9.673388244052783e-45 46 | 45.0,9.342452351243452e-45 47 | 46.0,8.518283396336145e-44 48 | 47.0,1.9551444475507984e-43 49 | 48.0,9.528620995884365e-44 50 | 49.0,-7.75681659798746e-43 51 | 50.0,-2.7371850852247146e-42 52 | 51.0,-3.877446700807291e-42 53 | 52.0,2.5672524904140138e-42 54 | 53.0,2.590862812965929e-41 55 | 54.0,6.085768782737818e-41 56 | 55.0,5.234760304654039e-41 57 | 56.0,-1.239492116023484e-40 58 | 57.0,-5.702539744377369e-40 59 | 58.0,-1.0537388794815473e-39 60 | 59.0,-5.5420007027678704e-40 61 | 60.0,2.712068728883604e-39 62 | 61.0,9.596553185182383e-39 63 | 62.0,1.5724627113528307e-38 64 | 63.0,6.45118821494985e-39 65 | 64.0,-4.0877981964979606e-38 66 | 65.0,-1.339072889412051e-37 67 | 66.0,-2.144217694366349e-37 68 | 67.0,-1.0522274287626218e-37 69 | 68.0,4.588609945163563e-37 70 | 69.0,1.5828278172794016e-36 71 | 70.0,2.685772548150244e-36 72 | 71.0,1.9287645028564093e-36 73 | 72.0,-3.6006997786040975e-36 74 | 73.0,-1.569870726184696e-35 75 | 74.0,-3.008256125449146e-35 76 | 75.0,-3.037494716001292e-35 77 | 76.0,1.2560537875344046e-35 78 | 77.0,1.2501474582487744e-34 79 | 78.0,2.8946230130244725e-34 80 | 79.0,3.8596994717937625e-34 81 | 80.0,1.5960270918653181e-34 82 | 81.0,-7.000000274766217e-34 83 | 82.0,-2.27241077556729e-33 84 | 83.0,-3.908230596643065e-33 85 | 84.0,-3.7523091326252575e-33 86 | 85.0,1.1274744259032533e-33 87 | 86.0,1.317904206604498e-32 88 | 87.0,3.0835264570633357e-32 89 | 88.0,4.378194387874929e-32 90 | 89.0,3.021197802500166e-32 91 | 90.0,-3.8057465673685067e-32 92 | 91.0,-1.7614051829088202e-31 93 | 92.0,-3.5085764631384167e-31 94 | 93.0,-4.417471007434101e-31 95 | 94.0,-2.3085234798519756e-31 96 | 95.0,5.2852496343042445e-31 97 | 96.0,1.9186379526937277e-30 98 | 97.0,3.547409066525653e-30 99 | 98.0,4.245069356152112e-30 100 | 99.0,2.054277289696162e-30 101 | 100.0,-5.074055559436517e-30 102 | 101.0,-1.77986705863732e-29 103 | 102.0,-3.280496387945827e-29 104 | 103.0,-4.0362818616207e-29 105 | 104.0,-2.4014229889299513e-29 106 | 105.0,3.4421839726862414e-29 107 | 106.0,1.4243551722548197e-28 108 | 107.0,2.7747336712755877e-28 109 | 108.0,3.669779874402284e-28 110 | 109.0,2.830790027144596e-28 111 | 110.0,-1.2789411452911888e-28 112 | 111.0,-9.59763866283548e-28 113 | 112.0,-2.1063466825380376e-27 114 | 113.0,-3.102011646918465e-27 115 | 114.0,-3.0373726527947953e-27 116 | 115.0,-6.930091214414237e-28 117 | 116.0,4.9631207091281146e-27 118 | 117.0,1.3835711182951504e-26 119 | 118.0,2.350995407535755e-26 120 | 119.0,2.8284361033692346e-26 121 | 120.0,1.9363957218295682e-26 122 | 121.0,-1.2750360082403076e-26 123 | 122.0,-7.28586136824438e-26 124 | 123.0,-1.5285210334516063e-25 125 | 124.0,-2.231997777426263e-25 126 | 125.0,-2.286991879062857e-25 127 | 126.0,-9.603613081932707e-26 128 | 127.0,2.4047867451327995e-25 129 | 128.0,7.912698442824846e-25 130 | 129.0,1.4484634829119035e-24 131 | 130.0,1.9303689661840844e-24 132 | 131.0,1.770179788589637e-24 133 | 132.0,4.0315082134580755e-25 134 | 133.0,-2.6115949475014998e-24 135 | 134.0,-7.21918099485515e-24 136 | 135.0,-1.2415449354352763e-23 137 | 136.0,-1.5886358133361162e-23 138 | 137.0,-1.4005527945440175e-23 139 | 138.0,-2.5587567308069473e-24 140 | 139.0,2.1594729454771444e-23 141 | 140.0,5.783861639823376e-23 142 | 141.0,9.861660596443507e-23 143 | 142.0,1.269292069979672e-22 144 | 143.0,1.1628672754685205e-22 145 | 144.0,3.5570104645749244e-23 146 | 145.0,-1.3984590427409745e-22 147 | 146.0,-4.0989045159955515e-22 148 | 147.0,-7.277252187039303e-22 149 | 148.0,-9.810098121436256e-22 150 | 149.0,-9.87576348040302e-22 151 | 150.0,-5.215079526563346e-22 152 | 151.0,6.204627647114475e-22 153 | 152.0,2.5036156155139204e-21 154 | 153.0,4.906053819171253e-21 155 | 154.0,7.175172118857796e-21 156 | 155.0,8.153064269239703e-21 157 | 156.0,6.271197569546346e-21 158 | 157.0,-1.0981828573727257e-22 159 | 158.0,-1.2034979873628313e-20 160 | 159.0,-2.9002659391804104e-20 161 | 160.0,-4.791062509008952e-20 162 | 161.0,-6.221813559891964e-20 163 | 162.0,-6.191132188808181e-20 164 | 163.0,-3.481318530159137e-20 165 | 164.0,3.010580450437065e-20 166 | 165.0,1.3724469426605045e-19 167 | 166.0,2.773476653947972e-19 168 | 167.0,4.2021147395023423e-19 169 | 168.0,5.101736361916097e-19 170 | 169.0,4.6780117483029155e-19 171 | 170.0,2.0234964118355397e-19 172 | 171.0,-3.616109395115777e-19 173 | 172.0,-1.2437449320673743e-18 174 | 173.0,-2.3563963604203838e-18 175 | 174.0,-3.4547854974244917e-18 176 | 175.0,-4.107069445482482e-18 177 | 176.0,-3.710701696596643e-18 178 | 177.0,-1.5848787975407128e-18 179 | 178.0,2.844054751878265e-18 180 | 179.0,9.751068547702195e-18 181 | 180.0,1.8548745954001714e-17 182 | 181.0,2.7524297280789567e-17 183 | 182.0,3.359682801523873e-17 184 | 183.0,3.238082217137406e-17 185 | 184.0,1.8726053715735133e-17 186 | 185.0,-1.2059418485688749e-17 187 | 186.0,-6.224907518061441e-17 188 | 187.0,-1.2914455665241455e-16 189 | 188.0,-2.022596176036886e-16 190 | 189.0,-2.610701661726003e-16 191 | 190.0,-2.743439537900356e-16 192 | 191.0,-2.0248341827550395e-16 193 | 192.0,-4.224560790894401e-18 194 | 193.0,3.5160032070661464e-16 195 | 194.0,8.688796456579053e-16 196 | 195.0,1.503709493994961e-15 197 | 196.0,2.1443935145612138e-15 198 | 197.0,2.59850864871311e-15 199 | 198.0,2.6026176598372056e-15 200 | 199.0,1.847819767210041e-15 201 | 200.0,2.3688275890628962e-17 202 | 201.0,-3.041862647875022e-15 203 | 202.0,-7.262228076831499e-15 204 | 203.0,-1.2118730308315152e-14 205 | 204.0,-1.645615010515027e-14 206 | 205.0,-1.8381798826344355e-14 207 | 206.0,-1.5255705338942178e-14 208 | 207.0,-3.812683175595556e-15 209 | 208.0,1.9324996847330165e-14 210 | 209.0,5.684581902267271e-14 211 | 210.0,1.0982631724303465e-13 212 | 211.0,1.7631901305699142e-13 213 | 212.0,2.4999892559345633e-13 214 | 213.0,3.1954050219860775e-13 215 | 214.0,3.686386112231023e-13 216 | 215.0,3.7770244854440764e-13 217 | 216.0,3.2880187873722785e-13 218 | 217.0,2.1407551943575804e-13 219 | 218.0,4.532135910243824e-14 220 | 219.0,-1.2835313455998318e-13 221 | 220.0,-2.0215979100160603e-13 222 | 221.0,2.731810343471315e-15 223 | 222.0,7.555863788180356e-13 224 | 223.0,2.428905423130968e-12 225 | 224.0,5.493538727507453e-12 226 | 225.0,1.0495867090373404e-11 227 | 226.0,1.8031702062241462e-11 228 | 227.0,2.8670229597164906e-11 229 | 228.0,4.2885003150742814e-11 230 | 229.0,6.099767105295408e-11 231 | 230.0,8.314456235839666e-11 232 | 231.0,1.0934473170696672e-10 233 | 232.0,1.397905160304054e-10 234 | 233.0,1.754172953512619e-10 235 | 234.0,2.1873804716110751e-10 236 | 235.0,2.7557694268942056e-10 237 | 236.0,3.573466784453563e-10 238 | 237.0,4.839079761325179e-10 239 | 238.0,6.873373353303323e-10 240 | 239.0,1.0167888503165428e-09 241 | 240.0,1.5430812664940308e-09 242 | 241.0,2.3631609526954183e-09 243 | 242.0,3.6045967606808207e-09 244 | 243.0,5.427867773413041e-09 245 | 244.0,8.026749118408619e-09 246 | 245.0,1.1628623089612996e-08 247 | 246.0,1.6492329052021033e-08 248 | 247.0,2.2909344133659027e-08 249 | 248.0,3.121712891390696e-08 250 | 249.0,4.182408858597071e-08 251 | 250.0,5.52691035380716e-08 252 | 251.0,7.233907223084769e-08 253 | 252.0,9.427236097334596e-08 254 | 253.0,1.2300263405152028e-07 255 | 254.0,1.6163121613093905e-07 256 | 255.0,2.1502852345465007e-07 257 | 256.0,2.9067260809181666e-07 258 | 257.0,3.9955339667919277e-07 259 | 258.0,5.576643594945123e-07 260 | 259.0,7.875155561044623e-07 261 | 260.0,1.1196930347011065e-06 262 | 261.0,1.5941827165432068e-06 263 | 262.0,2.2612337649044094e-06 264 | 263.0,3.1809173693793104e-06 265 | 264.0,4.424365265408533e-06 266 | 265.0,6.075945595551509e-06 267 | 266.0,8.240100874163373e-06 268 | 267.0,1.1051650110902282e-05 269 | 268.0,1.4684415645076029e-05 270 | 269.0,1.9363407216664523e-05 271 | 270.0,2.537592732200361e-05 272 | 271.0,3.308456440264429e-05 273 | 272.0,4.2943849301853446e-05 274 | 273.0,5.5519719256369045e-05 275 | 274.0,7.151646309754775e-05 276 | 275.0,9.180637258846558e-05 277 | 276.0,0.00011746292605167634 278 | 277.0,0.00014980371963014364 279 | 278.0,0.00019043935831324616 280 | 279.0,0.00024133013831430776 281 | 280.0,0.0003048469493853405 282 | 281.0,0.00038384971978100196 283 | 282.0,0.0004817717679603557 284 | 283.0,0.0006027153427614797 285 | 284.0,0.0007515517778165145 286 | 285.0,0.0009340469694758744 287 | 286.0,0.0011569891861854691 288 | 287.0,0.0014283317262820435 289 | 288.0,0.0017573386982507031 290 | 289.0,0.0021547597962221004 291 | 290.0,0.0026329996304539677 292 | 291.0,0.0032063000364589834 293 | 292.0,0.0038909224393829113 294 | 293.0,0.004705346058512167 295 | 294.0,0.005670449187688579 296 | 295.0,0.006809685967144422 297 | 296.0,0.008149256007073287 298 | 297.0,0.009718236956036406 299 | 298.0,0.011548682813449077 300 | 299.0,0.013675678157241593 301 | 300.0,0.016137344352316455 302 | 301.0,0.01897471778836548 303 | 302.0,0.022231559973818704 304 | 303.0,0.025954078024837363 305 | 304.0,0.030190500069006216 306 | 305.0,0.03499046788115153 307 | 306.0,0.040404367611301284 308 | 307.0,0.04648258921739373 309 | 308.0,0.05327459658126436 310 | 309.0,0.06082800214780984 311 | 310.0,0.06918767738475773 312 | 311.0,0.07839485207857465 313 | 312.0,0.08848624285537199 314 | 313.0,0.09949331318889999 315 | 314.0,0.11144157250817945 316 | 315.0,0.12434990143028583 317 | 316.0,0.13823004495741292 318 | 317.0,0.15308611255699603 319 | 318.0,0.16891418039830391 320 | 319.0,0.185701929419221 321 | 320.0,0.20342849254181974 322 | 321.0,0.22206434102175704 323 | 322.0,0.24157132809488166 324 | 323.0,0.26190276026269405 325 | 324.0,0.2830038022404068 326 | 325.0,0.3048118488832969 327 | 326.0,0.32725707128498516 328 | 327.0,0.350263005719872 329 | 328.0,0.373747413194129 330 | 329.0,0.39762304966765893 331 | 330.0,0.42179855016761486 332 | 331.0,0.4461793615016663 333 | 332.0,0.47066873449060165 334 | 333.0,0.4951686502364318 335 | 334.0,0.5195807635547359 336 | 335.0,0.5438073297117065 337 | 336.0,0.5677520440719495 338 | 337.0,0.5913208217073054 339 | 338.0,0.6144225287790053 340 | 339.0,0.6369695925353397 341 | 340.0,0.6588784872235961 342 | 341.0,0.680070141046499 343 | 342.0,0.7004702734975915 344 | 343.0,0.7200095277935858 345 | 344.0,0.7386235418759827 346 | 345.0,0.7562529710491926 347 | 346.0,0.7728434067836418 348 | 347.0,0.7883450392137997 349 | 348.0,0.8027119898864676 350 | 349.0,0.8159011020908595 351 | 350.0,0.8278703930950386 352 | 351.0,0.8385763219556255 353 | 352.0,0.8479716276462169 354 | 353.0,0.8560115443097412 355 | 354.0,0.8626510487424123 356 | 355.0,0.8676965484563768 357 | 356.0,0.8700316092115387 358 | 357.0,0.8712586253293894 359 | 358.0,0.8718146029674312 360 | 359.0,0.8715373279812926 361 | 360.0,0.8702432817030513 362 | 361.0,0.8677925549362568 363 | 362.0,0.8640885595062588 364 | 363.0,0.8590635051480918 365 | 364.0,0.8526593747555001 366 | 365.0,0.8448085857787827 367 | 366.0,0.8354269031040666 368 | 367.0,0.8244312482206212 369 | 368.0,0.8117852003216223 370 | 369.0,0.7975379575908248 371 | 370.0,0.7818189777930588 372 | 371.0,0.7647963750643717 373 | 372.0,0.7466331151374832 374 | 373.0,0.7274692846401836 375 | 374.0,0.707422810231593 376 | 375.0,0.6865933671657038 377 | 376.0,0.6650657894963115 378 | 377.0,0.6429160071419101 379 | 378.0,0.6202186820277575 380 | 379.0,0.5970525597562266 381 | 380.0,0.5735021441829031 382 | 381.0,0.5496574150199124 383 | 382.0,0.5256130753622258 384 | 383.0,0.501467145655374 385 | 384.0,0.4773194812347833 386 | 385.0,0.45326957514510047 387 | 386.0,0.429415089371805 388 | 387.0,0.40584889872318436 389 | 388.0,0.38265891240108957 390 | 389.0,0.3599268304831213 391 | 390.0,0.33772741593929406 392 | 391.0,0.3161287955848982 393 | 392.0,0.29519194092481804 394 | 393.0,0.2749704609675282 395 | 394.0,0.2555103751689568 396 | 395.0,0.23684980857728535 397 | 396.0,0.21901886454732208 398 | 397.0,0.2020395799541424 399 | 398.0,0.18592675675370196 400 | 399.0,0.1706873244203419 401 | 400.0,0.1563223516994971 402 | 401.0,0.1428260436133805 403 | 402.0,0.13018753489866491 404 | 403.0,0.11839045909086725 405 | 404.0,0.10741394189261473 406 | 405.0,0.09723289670238996 407 | 406.0,0.08781860545348041 408 | 407.0,0.07913956619174324 409 | 408.0,0.07116172848602384 410 | 409.0,0.06384964617726548 411 | 410.0,0.05716661322316694 412 | 411.0,0.051075422271895835 413 | 412.0,0.045538803148664854 414 | 413.0,0.04051956891552318 415 | 414.0,0.03598126750205887 416 | 415.0,0.031888155137278926 417 | 416.0,0.028205669574857685 418 | 417.0,0.024900604689922834 419 | 418.0,0.021941177994451395 420 | 419.0,0.019297456008481328 421 | 420.0,0.016941006017887932 422 | 421.0,0.01484545150559683 423 | 422.0,0.012985889421245587 424 | 423.0,0.011339426178695301 425 | 424.0,0.009884632062867408 426 | 425.0,0.008601891294272426 427 | 426.0,0.007473086307624462 428 | 427.0,0.006481699549663386 429 | 428.0,0.005612685012939692 430 | 429.0,0.0048523842772358544 431 | 430.0,0.004188489500274853 432 | 431.0,0.0036098398360690305 433 | 432.0,0.003106451275556913 434 | 433.0,0.0026693039016265413 435 | 434.0,0.0022903331605395364 436 | 435.0,0.001962349920613021 437 | 436.0,0.001678941658152964 438 | 437.0,0.0014344967768686278 439 | 438.0,0.0012240301236900516 440 | 439.0,0.0010431758694495552 441 | 440.0,0.0008879883835270272 442 | 441.0,0.0007550025026879306 443 | 442.0,0.0006411339552341866 444 | 443.0,0.0005437933780384079 445 | 444.0,0.0004609150705838465 446 | 445.0,0.0003903327953371957 447 | 446.0,0.00033024916572907187 448 | 447.0,0.0002793386963779683 449 | 448.0,0.00023612362810106473 450 | 449.0,0.00019933079448672343 451 | 450.0,0.0001682158660224142 452 | 451.0,0.0001418870015748274 453 | 452.0,0.00011947467106975836 454 | 453.0,0.00010040828562007397 455 | 454.0,8.43532504561856e-05 456 | 455.0,7.074588832019564e-05 457 | 456.0,5.919925843517514e-05 458 | 457.0,4.952846830119169e-05 459 | 458.0,4.1417165571089106e-05 460 | 459.0,3.4626573307322626e-05 461 | 460.0,2.8998716242511775e-05 462 | 461.0,2.4339792238395917e-05 463 | 462.0,2.0445086142873557e-05 464 | 463.0,1.719262800596118e-05 465 | 464.0,1.4522534172568513e-05 466 | 465.0,1.2241611006998018e-05 467 | 466.0,1.0223883875441057e-05 468 | 467.0,8.55387775399091e-06 469 | 468.0,7.107444100656724e-06 470 | 469.0,5.84751462455181e-06 471 | 470.0,4.740413970624032e-06 472 | 471.0,3.7804620269837574e-06 473 | 472.0,2.9762784489576346e-06 474 | 473.0,2.3038568493368914e-06 475 | 474.0,1.7290139590918391e-06 476 | 475.0,1.2858594039283175e-06 477 | 476.0,9.767802070130056e-07 478 | 477.0,7.231865757428584e-07 479 | 478.0,5.507647050948401e-07 480 | 479.0,4.51159702121422e-07 481 | 480.0,3.981201092397478e-07 482 | 481.0,3.8228907441465804e-07 483 | 482.0,3.926211284170474e-07 484 | 483.0,4.163677570954877e-07 485 | 484.0,4.4078044629854993e-07 486 | 485.0,4.531106818748059e-07 487 | 486.0,4.433559995079322e-07 488 | 487.0,4.2841146892092777e-07 489 | 488.0,4.0967068562906213e-07 490 | 489.0,3.871336496323354e-07 491 | 490.0,3.608003609307474e-07 492 | 491.0,3.3067081952429835e-07 493 | 492.0,2.9674502541298813e-07 494 | 493.0,2.7141077353206276e-07 495 | 494.0,2.5477851057480027e-07 496 | 495.0,2.3814624761753775e-07 497 | 496.0,2.2151398466027523e-07 498 | 497.0,2.0488172170301272e-07 499 | 498.0,1.8824945874575017e-07 500 | 499.0,1.7161719578848768e-07 501 | 500.0,1.5498493283122517e-07 502 | 501.0,1.3835266987396262e-07 503 | 502.0,1.2172040691670013e-07 504 | 503.0,1.0508814395943759e-07 505 | 504.0,8.845588100217507e-08 506 | 505.0,7.182361804491256e-08 507 | 506.0,5.895446341931264e-08 508 | 507.0,5.696634933585872e-08 509 | 508.0,5.4978235252404803e-08 510 | 509.0,5.299012116895089e-08 511 | 510.0,5.100200708549696e-08 512 | 511.0,4.9013893002043044e-08 513 | 512.0,4.702577891858912e-08 514 | 513.0,4.5037664835135206e-08 515 | 514.0,4.3049550751681284e-08 516 | 515.0,4.106143666822736e-08 517 | 516.0,3.907332258477345e-08 518 | 517.0,3.708520850131953e-08 519 | 518.0,3.509709441786561e-08 520 | 519.0,3.3108980334411694e-08 521 | 520.0,3.1120866250957765e-08 522 | 521.0,2.913275216750385e-08 523 | 522.0,2.714463808404993e-08 524 | 523.0,2.5156524000596012e-08 525 | 524.0,2.316840991714209e-08 526 | 525.0,2.1180295833688168e-08 527 | 526.0,1.9192181750234253e-08 528 | 527.0,1.720406766678033e-08 529 | 528.0,1.5215953583326415e-08 530 | 529.0,1.3227839499872493e-08 531 | 530.0,1.1239725416418574e-08 532 | 531.0,9.251611332964654e-09 533 | 532.0,7.263497249510735e-09 534 | 533.0,6.477322101476875e-09 535 | 534.0,6.366131287034257e-09 536 | 535.0,6.254940472591639e-09 537 | 536.0,6.143749658149021e-09 538 | 537.0,6.032558843706403e-09 539 | 538.0,5.921368029263785e-09 540 | 539.0,5.810177214821167e-09 541 | 540.0,5.698986400378549e-09 542 | 541.0,5.5877955859359315e-09 543 | 542.0,5.4766047714933135e-09 544 | 543.0,5.365413957050696e-09 545 | 544.0,5.254223142608078e-09 546 | 545.0,5.14303232816546e-09 547 | 546.0,5.031841513722841e-09 548 | 547.0,4.920650699280223e-09 549 | 548.0,4.809459884837605e-09 550 | 549.0,4.698269070394988e-09 551 | 550.0,4.58707825595237e-09 552 | 551.0,4.475887441509752e-09 553 | 552.0,4.364696627067134e-09 554 | 553.0,4.253505812624516e-09 555 | 554.0,4.142314998181898e-09 556 | 555.0,4.03112418373928e-09 557 | 556.0,3.919933369296662e-09 558 | 557.0,3.808742554854044e-09 559 | 558.0,3.6975517404114262e-09 560 | 559.0,3.5863609259688083e-09 561 | 560.0,3.4751701115261904e-09 562 | 561.0,3.3639792970835725e-09 563 | 562.0,3.2527884826409546e-09 564 | 563.0,3.1415976681983367e-09 565 | 564.0,3.0304068537557184e-09 566 | 565.0,2.919216039313101e-09 567 | 566.0,2.808025224870483e-09 568 | 567.0,2.6968344104278646e-09 569 | 568.0,2.5856435959852467e-09 570 | 569.0,2.474452781542629e-09 571 | 570.0,2.363261967100011e-09 572 | 571.0,2.252071152657393e-09 573 | 572.0,2.1408803382147747e-09 574 | 573.0,2.029689523772157e-09 575 | 574.0,1.918498709329539e-09 576 | 575.0,1.8073078948869212e-09 577 | 576.0,1.6961170804443033e-09 578 | 577.0,1.5849262660016854e-09 579 | 578.0,1.4737354515590672e-09 580 | 579.0,1.3625446371164493e-09 581 | 580.0,1.2513538226738314e-09 582 | 581.0,1.1401630082312135e-09 583 | 582.0,1.0289721937885956e-09 584 | 583.0,9.177813793459777e-10 585 | 584.0,8.065905649033597e-10 586 | 585.0,6.953997504607418e-10 587 | 586.0,6.178877853761424e-10 588 | 587.0,5.89407066523947e-10 589 | 588.0,5.609263476717516e-10 590 | 589.0,5.324456288195561e-10 591 | 590.0,5.039649099673608e-10 592 | 591.0,4.754841911151653e-10 593 | 592.0,4.4700347226296997e-10 594 | 593.0,4.185227534107746e-10 595 | 594.0,3.900420345585792e-10 596 | 595.0,3.615613157063838e-10 597 | 596.0,3.330805968541884e-10 598 | 597.0,3.04599878001993e-10 599 | 598.0,2.7611915914979756e-10 600 | 599.0,2.476384402976022e-10 601 | 600.0,2.191577214454068e-10 602 | -------------------------------------------------------------------------------- /resources/dextran_experiment_long.csv: -------------------------------------------------------------------------------- 1 | 0.000000000000000000e+00,0.000000000000000000e+00 2 | 1.000000000000000000e+00,-4.293146573660484722e-104 3 | 2.000000000000000000e+00,-1.063785878902012761e-96 4 | 3.000000000000000000e+00,-1.048139884507130359e-92 5 | 4.000000000000000000e+00,8.195501441085481318e-90 6 | 5.000000000000000000e+00,2.349784161227544689e-87 7 | 6.000000000000000000e+00,1.488168809106391660e-85 8 | 7.000000000000000000e+00,3.064965317394028947e-84 9 | 8.000000000000000000e+00,-1.183416744813795575e-82 10 | 9.000000000000000000e+00,-8.661158752691125571e-81 11 | 1.000000000000000000e+01,-2.114536687448982276e-79 12 | 1.100000000000000000e+01,-1.700590433568377027e-78 13 | 1.200000000000000000e+01,3.183503366976544493e-77 14 | 1.300000000000000000e+01,1.035070685151391630e-75 15 | 1.400000000000000000e+01,1.192901171086978366e-74 16 | 1.500000000000000000e+01,3.712573533550202458e-74 17 | 1.600000000000000000e+01,-7.822609604884741304e-73 18 | 1.700000000000000000e+01,-1.257475560297056606e-71 19 | 1.800000000000000000e+01,-7.628341019995640317e-71 20 | 1.900000000000000000e+01,5.176760559766104057e-71 21 | 2.000000000000000000e+01,3.972848155070317910e-69 22 | 2.100000000000000000e+01,2.927055131921106484e-68 23 | 2.200000000000000000e+01,8.485117089379031042e-68 24 | 2.300000000000000000e+01,-2.178295408541516359e-67 25 | 2.400000000000000000e+01,-3.703191429272128611e-66 26 | 2.500000000000000000e+01,-1.998624831794950190e-65 27 | 2.600000000000000000e+01,-5.270540810294902675e-65 28 | 2.700000000000000000e+01,4.349336743209215099e-65 29 | 2.800000000000000000e+01,1.133444380998703562e-63 30 | 2.900000000000000000e+01,5.791987547060456361e-63 31 | 3.000000000000000000e+01,1.598967758769964672e-62 32 | 3.100000000000000000e+01,1.021949123066922967e-62 33 | 3.200000000000000000e+01,-1.376055637037369207e-61 34 | 3.300000000000000000e+01,-8.017106511679660468e-61 35 | 3.400000000000000000e+01,-2.477784684442241072e-60 36 | 3.500000000000000000e+01,-3.965342660560576001e-60 37 | 3.600000000000000000e+01,4.232089223705214876e-60 38 | 3.700000000000000000e+01,5.318405546148739965e-59 39 | 3.800000000000000000e+01,2.008851299082779090e-58 40 | 3.900000000000000000e+01,4.603719674768999558e-58 41 | 4.000000000000000000e+01,4.815672331339863138e-58 42 | 4.100000000000000000e+01,-1.167378264728934712e-57 43 | 4.200000000000000000e+01,-7.570946749901288395e-57 44 | 4.300000000000000000e+01,-2.253530954910590506e-56 45 | 4.400000000000000000e+01,-4.322253580127493335e-56 46 | 4.500000000000000000e+01,-3.749087244135818446e-56 47 | 4.600000000000000000e+01,9.779562035353853672e-56 48 | 4.700000000000000000e+01,5.708043222625113660e-55 49 | 4.800000000000000000e+01,1.622404432421196055e-54 50 | 4.900000000000000000e+01,3.113601980256654745e-54 51 | 5.000000000000000000e+01,3.442765226710976330e-54 52 | 5.100000000000000000e+01,-2.487017594487513487e-54 53 | 5.200000000000000000e+01,-2.522540839729260859e-53 54 | 5.300000000000000000e+01,-7.867128499243568158e-53 55 | 5.400000000000000000e+01,-1.650129119969435283e-52 56 | 5.500000000000000000e+01,-2.356175607369825447e-52 57 | 5.600000000000000000e+01,-1.202066071259628320e-52 58 | 5.700000000000000000e+01,5.534181159618650520e-52 59 | 5.800000000000000000e+01,2.361272893799388700e-51 60 | 5.900000000000000000e+01,5.778701650712260942e-51 61 | 6.000000000000000000e+01,1.022805133082271852e-50 62 | 6.100000000000000000e+01,1.216601641787350149e-50 63 | 6.200000000000000000e+01,2.368199801990709734e-51 64 | 6.300000000000000000e+01,-3.606443638347932125e-50 65 | 6.400000000000000000e+01,-1.249419124772749317e-49 66 | 6.500000000000000000e+01,-2.761900904318831897e-49 67 | 6.600000000000000000e+01,-4.558316765837606619e-49 68 | 6.700000000000000000e+01,-5.215573862164863280e-49 69 | 6.800000000000000000e+01,-1.458962656195643784e-49 70 | 6.900000000000000000e+01,1.225186278092735944e-48 71 | 7.000000000000000000e+01,4.267759303848477841e-48 72 | 7.100000000000000000e+01,9.352310005425326524e-48 73 | 7.200000000000000000e+01,1.559204621357836601e-47 74 | 7.300000000000000000e+01,1.927943868387183312e-47 75 | 7.400000000000000000e+01,1.200618115460253573e-47 76 | 7.500000000000000000e+01,-2.046325100330338869e-47 77 | 7.600000000000000000e+01,-9.632616736578663211e-47 78 | 7.700000000000000000e+01,-2.292161452858406281e-46 79 | 7.800000000000000000e+01,-4.087414311583294428e-46 80 | 7.900000000000000000e+01,-5.726710195014211294e-46 81 | 8.000000000000000000e+01,-5.649961107103767416e-46 82 | 8.100000000000000000e+01,-1.028118538333371090e-46 83 | 8.200000000000000000e+01,1.217760349292323533e-45 84 | 8.300000000000000000e+01,3.814705487201957971e-45 85 | 8.400000000000000000e+01,7.852024064830688721e-45 86 | 8.500000000000000000e+01,1.274036770617487519e-44 87 | 8.600000000000000000e+01,1.641629207960066193e-44 88 | 8.700000000000000000e+01,1.454883436913486963e-44 89 | 8.800000000000000000e+01,9.265555124991197280e-47 90 | 8.900000000000000000e+01,-3.609161895609526416e-44 91 | 9.000000000000000000e+01,-1.024977999213106903e-43 92 | 9.100000000000000000e+01,-2.009019356007210446e-43 93 | 9.200000000000000000e+01,-3.162124011340964027e-43 94 | 9.300000000000000000e+01,-4.028015189186482734e-43 95 | 9.400000000000000000e+01,-3.707190347854240378e-43 96 | 9.500000000000000000e+01,-7.901636251958565398e-44 97 | 9.600000000000000000e+01,6.515082263914455739e-43 98 | 9.700000000000000000e+01,1.989097486576986674e-42 99 | 9.800000000000000000e+01,3.987643842296392992e-42 100 | 9.900000000000000000e+01,6.417782758421207405e-42 101 | 1.000000000000000000e+02,8.543936000101053054e-42 102 | 1.010000000000000000e+02,8.893733292145691250e-42 103 | 1.020000000000000000e+02,5.120604735944458394e-42 104 | 1.030000000000000000e+02,-5.864319662398057404e-42 105 | 1.040000000000000000e+02,-2.725877069601827853e-41 106 | 1.050000000000000000e+02,-6.096464252104547824e-41 107 | 1.060000000000000000e+02,-1.052861620345712256e-40 108 | 1.070000000000000000e+02,-1.517121780412309285e-40 109 | 1.080000000000000000e+02,-1.813005203240349598e-40 110 | 1.090000000000000000e+02,-1.618196098437072060e-40 111 | 1.100000000000000000e+02,-4.765888607337850412e-41 112 | 1.110000000000000000e+02,2.145321320703618603e-40 113 | 1.120000000000000000e+02,6.716022066341854620e-40 114 | 1.130000000000000000e+02,1.337416609790677341e-39 115 | 1.140000000000000000e+02,2.153571026618352405e-39 116 | 1.150000000000000000e+02,2.940139523398952890e-39 117 | 1.160000000000000000e+02,3.346462162023130390e-39 118 | 1.170000000000000000e+02,2.821237079605789421e-39 119 | 1.180000000000000000e+02,6.300300515725978869e-40 120 | 1.190000000000000000e+02,-4.040008505134958923e-39 121 | 1.200000000000000000e+02,-1.184800120253481440e-38 122 | 1.210000000000000000e+02,-2.290784492380963165e-38 123 | 1.220000000000000000e+02,-3.623299291983508097e-38 124 | 1.230000000000000000e+02,-4.908227670426874812e-38 125 | 1.240000000000000000e+02,-5.632281062540642292e-38 126 | 1.250000000000000000e+02,-5.007030468173627510e-38 127 | 1.260000000000000000e+02,-1.996225318969174643e-38 128 | 1.270000000000000000e+02,4.547518672383749612e-38 129 | 1.280000000000000000e+02,1.558872222173405132e-37 130 | 1.290000000000000000e+02,3.143133221427166805e-37 131 | 1.300000000000000000e+02,5.103893449977344017e-37 132 | 1.310000000000000000e+02,7.122394420299216131e-37 133 | 1.320000000000000000e+02,8.584722153613661398e-37 134 | 1.330000000000000000e+02,8.529851262560187619e-37 135 | 1.340000000000000000e+02,5.663262556685760201e-37 136 | 1.350000000000000000e+02,-1.516130031738978358e-37 137 | 1.360000000000000000e+02,-1.442081401158279624e-36 138 | 1.370000000000000000e+02,-3.387108945649973124e-36 139 | 1.380000000000000000e+02,-5.936820645366399350e-36 140 | 1.390000000000000000e+02,-8.818450374352439630e-36 141 | 1.400000000000000000e+02,-1.144083497101407553e-35 142 | 1.410000000000000000e+02,-1.281509791727506246e-35 143 | 1.420000000000000000e+02,-1.152977122546138347e-35 144 | 1.430000000000000000e+02,-5.826506060843619859e-36 145 | 1.440000000000000000e+02,6.168320089704561338e-36 146 | 1.450000000000000000e+02,2.600651788331935202e-35 147 | 1.460000000000000000e+02,5.425174944890343564e-35 148 | 1.470000000000000000e+02,8.957637778690906809e-35 149 | 1.480000000000000000e+02,1.277136191995709663e-34 150 | 1.490000000000000000e+02,1.604279290456579849e-34 151 | 1.500000000000000000e+02,1.747979739091664735e-34 152 | 1.510000000000000000e+02,1.531964008094447195e-34 153 | 1.520000000000000000e+02,7.446759037946562152e-35 154 | 1.530000000000000000e+02,-8.314446832043927668e-35 155 | 1.540000000000000000e+02,-3.368740917612090605e-34 156 | 1.550000000000000000e+02,-6.918753382257713007e-34 157 | 1.560000000000000000e+02,-1.131429214851718480e-33 158 | 1.570000000000000000e+02,-1.605953785189348170e-33 159 | 1.580000000000000000e+02,-2.022320400444612214e-33 160 | 1.590000000000000000e+02,-2.237790354934316534e-33 161 | 1.600000000000000000e+02,-2.063546943083222694e-33 162 | 1.610000000000000000e+02,-1.270006734728742945e-33 163 | 1.620000000000000000e+02,3.915065189106431876e-34 164 | 1.630000000000000000e+02,3.123860302729815902e-33 165 | 1.640000000000000000e+02,7.021510842855494914e-33 166 | 1.650000000000000000e+02,1.198066286862848289e-32 167 | 1.660000000000000000e+02,1.757077153003300292e-32 168 | 1.670000000000000000e+02,2.293264767226634312e-32 169 | 1.680000000000000000e+02,2.669973450006131463e-32 170 | 1.690000000000000000e+02,2.698047354983688641e-32 171 | 1.700000000000000000e+02,2.140322808657471614e-32 172 | 1.710000000000000000e+02,7.359696414787188486e-33 173 | 1.720000000000000000e+02,-1.758276218173848319e-32 174 | 1.730000000000000000e+02,-5.504125281388117448e-32 175 | 1.740000000000000000e+02,-1.050193264083780088e-31 176 | 1.750000000000000000e+02,-1.648736852527795016e-31 177 | 1.760000000000000000e+02,-2.281790831143623574e-31 178 | 1.770000000000000000e+02,-2.838107663146129895e-31 179 | 1.780000000000000000e+02,-3.154406188757132201e-31 180 | 1.790000000000000000e+02,-3.015421573624587245e-31 181 | 1.800000000000000000e+02,-2.166856328777756215e-31 182 | 1.810000000000000000e+02,-3.443561753004819225e-32 183 | 1.820000000000000000e+02,2.679988791225754917e-31 184 | 1.830000000000000000e+02,7.030924151744525730e-31 185 | 1.840000000000000000e+02,1.265246597731690648e-30 186 | 1.850000000000000000e+02,1.919947911489078310e-30 187 | 1.860000000000000000e+02,2.594416259691946103e-30 188 | 1.870000000000000000e+02,3.169776355843240741e-30 189 | 1.880000000000000000e+02,3.476987393437438043e-30 190 | 1.890000000000000000e+02,3.298970934011983585e-30 191 | 1.900000000000000000e+02,2.385649018781869225e-30 192 | 1.910000000000000000e+02,4.816536347631086989e-31 193 | 1.920000000000000000e+02,-2.628173366915493700e-30 194 | 1.930000000000000000e+02,-7.064270997416703538e-30 195 | 1.940000000000000000e+02,-1.276840735707758332e-29 196 | 1.950000000000000000e+02,-1.941820193104809482e-29 197 | 1.960000000000000000e+02,-2.634200570461403611e-29 198 | 1.970000000000000000e+02,-3.245084669016522476e-29 199 | 1.980000000000000000e+02,-3.619332884036347202e-29 200 | 1.990000000000000000e+02,-3.558468811995025024e-29 201 | 2.000000000000000000e+02,-2.832280834701458784e-29 202 | 2.010000000000000000e+02,-1.202411093622718437e-29 203 | 2.020000000000000000e+02,1.544227891505572994e-29 204 | 2.030000000000000000e+02,5.543952048225823631e-29 205 | 2.040000000000000000e+02,1.079013838479983977e-28 206 | 2.050000000000000000e+02,1.706189188594257375e-28 207 | 2.060000000000000000e+02,2.385034725032446666e-28 208 | 2.070000000000000000e+02,3.029364228786803398e-28 209 | 2.080000000000000000e+02,3.513111248270404631e-28 210 | 2.090000000000000000e+02,3.671104383309861584e-28 211 | 2.100000000000000000e+02,3.306181666594408551e-28 212 | 2.110000000000000000e+02,2.204665672244215172e-28 213 | 2.120000000000000000e+02,1.596197672759853712e-29 214 | 2.130000000000000000e+02,-2.988261315691742087e-28 215 | 2.140000000000000000e+02,-7.303485733943981967e-28 216 | 2.150000000000000000e+02,-1.269825581475146056e-27 217 | 2.160000000000000000e+02,-1.887355824598896945e-27 218 | 2.170000000000000000e+02,-2.525592211953135573e-27 219 | 2.180000000000000000e+02,-3.095255968548936629e-27 220 | 2.190000000000000000e+02,-3.473405127824232040e-27 221 | 2.200000000000000000e+02,-3.506291211918777278e-27 222 | 2.210000000000000000e+02,-3.015549559034639737e-27 223 | 2.220000000000000000e+02,-1.815336017321869438e-27 224 | 2.230000000000000000e+02,2.637841612526031795e-28 225 | 2.240000000000000000e+02,3.341848583332966065e-27 226 | 2.250000000000000000e+02,7.449314867443158755e-27 227 | 2.260000000000000000e+02,1.248067022385069464e-26 228 | 2.270000000000000000e+02,1.814178948085819364e-26 229 | 2.280000000000000000e+02,2.390694318550162553e-26 230 | 2.290000000000000000e+02,2.898781555828511817e-26 231 | 2.300000000000000000e+02,3.232014082309623855e-26 232 | 2.310000000000000000e+02,3.258620480032353965e-26 233 | 2.320000000000000000e+02,2.828987850945721172e-26 234 | 2.330000000000000000e+02,1.788329716762446732e-26 235 | 2.340000000000000000e+02,-3.450816145337412285e-29 236 | 2.350000000000000000e+02,-2.648734472669239642e-26 237 | 2.360000000000000000e+02,-6.176520385796098012e-26 238 | 2.370000000000000000e+02,-1.050709255527837261e-25 239 | 2.380000000000000000e+02,-1.541438532809725431e-25 240 | 2.390000000000000000e+02,-2.049188380251484959e-25 241 | 2.400000000000000000e+02,-2.512406574018458027e-25 242 | 2.410000000000000000e+02,-2.847764207719007709e-25 243 | 2.420000000000000000e+02,-2.951734899901649023e-25 244 | 2.430000000000000000e+02,-2.705702796141955125e-25 245 | 2.440000000000000000e+02,-1.983815240469130643e-25 246 | 2.450000000000000000e+02,-6.672629919772300774e-26 247 | 2.460000000000000000e+02,1.336822133297886967e-25 248 | 2.470000000000000000e+02,4.072552042568397148e-25 249 | 2.480000000000000000e+02,7.508390381575826718e-25 250 | 2.490000000000000000e+02,1.151011500676892590e-24 251 | 2.500000000000000000e+02,1.581075675697789381e-24 252 | 2.510000000000000000e+02,1.998983582405994427e-24 253 | 2.520000000000000000e+02,2.346179964350147602e-24 254 | 2.530000000000000000e+02,2.547851606293640064e-24 255 | 2.540000000000000000e+02,2.515057900104706548e-24 256 | 2.550000000000000000e+02,2.150427157476515894e-24 257 | 2.560000000000000000e+02,1.356436515212207808e-24 258 | 2.570000000000000000e+02,4.755447727405480210e-26 259 | 2.580000000000000000e+02,-1.835615104858144694e-24 260 | 2.590000000000000000e+02,-4.306733927323639434e-24 261 | 2.600000000000000000e+02,-7.313456150390829921e-24 262 | 2.610000000000000000e+02,-1.071704339690511180e-23 263 | 2.620000000000000000e+02,-1.427404326619561158e-23 264 | 2.630000000000000000e+02,-1.762103867594002422e-23 265 | 2.640000000000000000e+02,-2.026944603802827829e-23 266 | 2.650000000000000000e+02,-2.161295582947902645e-23 267 | 2.660000000000000000e+02,-2.095178707305391019e-23 268 | 2.670000000000000000e+02,-1.753370932895741554e-23 269 | 2.680000000000000000e+02,-1.061913806301729961e-23 270 | 2.690000000000000000e+02,4.223610588251625320e-25 271 | 2.700000000000000000e+02,1.600006309981037770e-23 272 | 2.710000000000000000e+02,3.616694749554293667e-23 273 | 2.720000000000000000e+02,6.048018214603492555e-23 274 | 2.730000000000000000e+02,8.784303000604666925e-23 275 | 2.740000000000000000e+02,1.163774370871946914e-22 276 | 2.750000000000000000e+02,1.433311004020966418e-22 277 | 2.760000000000000000e+02,1.650492733359633212e-22 278 | 2.770000000000000000e+02,1.769975119154224270e-22 279 | 2.780000000000000000e+02,1.739549435502714048e-22 280 | 2.790000000000000000e+02,1.503124643032601639e-22 281 | 2.800000000000000000e+02,1.005417718450531143e-22 282 | 2.810000000000000000e+02,1.979157489925435461e-23 283 | 2.820000000000000000e+02,-9.531445633867763525e-23 284 | 2.830000000000000000e+02,-2.457168148306969222e-22 285 | 2.840000000000000000e+02,-4.289303490858840666e-22 286 | 2.850000000000000000e+02,-6.380216481564264535e-22 287 | 2.860000000000000000e+02,-8.606665003114963755e-22 288 | 2.870000000000000000e+02,-1.078372972478217281e-21 289 | 2.880000000000000000e+02,-1.266164080331662715e-21 290 | 2.890000000000000000e+02,-1.392774281115625773e-21 291 | 2.900000000000000000e+02,-1.421590924352130026e-21 292 | 2.910000000000000000e+02,-1.312161448735527422e-21 293 | 2.920000000000000000e+02,-1.023337036033794200e-21 294 | 2.930000000000000000e+02,-5.170659470773254973e-22 295 | 2.940000000000000000e+02,2.365528499964450047e-22 296 | 2.950000000000000000e+02,1.253536333964870477e-21 297 | 2.960000000000000000e+02,2.529066183729773017e-21 298 | 2.970000000000000000e+02,4.030286048642909833e-21 299 | 2.980000000000000000e+02,5.689650073066400732e-21 300 | 2.990000000000000000e+02,7.399268728723611127e-21 301 | 3.000000000000000000e+02,9.006554520295507617e-21 302 | 3.010000000000000000e+02,1.031340450733763932e-20 303 | 3.020000000000000000e+02,1.107959012149974155e-20 304 | 3.030000000000000000e+02,1.103120464400771997e-20 305 | 3.040000000000000000e+02,9.875287893899799923e-21 306 | 3.050000000000000000e+02,7.319465208726740349e-21 307 | 3.060000000000000000e+02,3.103524023970826564e-21 308 | 3.070000000000000000e+02,-2.965863755341551817e-21 309 | 3.080000000000000000e+02,-1.097301327990446643e-20 310 | 3.090000000000000000e+02,-2.084874021361407821e-20 311 | 3.100000000000000000e+02,-3.232078140194182237e-20 312 | 3.110000000000000000e+02,-4.486900138946720319e-20 313 | 3.120000000000000000e+02,-5.768919142498707150e-20 314 | 3.130000000000000000e+02,-6.967142449163227038e-20 315 | 3.140000000000000000e+02,-7.939082970931228213e-20 316 | 3.150000000000000000e+02,-8.513644441676888803e-20 317 | 3.160000000000000000e+02,-8.497049739329732058e-20 318 | 3.170000000000000000e+02,-7.682841473790849386e-20 319 | 3.180000000000000000e+02,-5.866169779387429639e-20 320 | 3.190000000000000000e+02,-2.861938441837984829e-20 321 | 3.200000000000000000e+02,1.469668862411213045e-20 322 | 3.210000000000000000e+02,7.196454923486917007e-20 323 | 3.220000000000000000e+02,1.428380538648196379e-19 324 | 3.230000000000000000e+02,2.256415706963126710e-19 325 | 3.240000000000000000e+02,3.170553520438619513e-19 326 | 3.250000000000000000e+02,4.118663101449884432e-19 327 | 3.260000000000000000e+02,5.027999208966718348e-19 328 | 3.270000000000000000e+02,5.804863140678165134e-19 329 | 3.280000000000000000e+02,6.335212946655527700e-19 330 | 3.290000000000000000e+02,6.488453519790918278e-19 331 | 3.300000000000000000e+02,6.123150258317872947e-19 332 | 3.310000000000000000e+02,5.095664717728726350e-19 333 | 3.320000000000000000e+02,3.271485601126422366e-19 334 | 3.330000000000000000e+02,5.392965844298670152e-20 335 | 3.340000000000000000e+02,-3.170784368850765816e-19 336 | 3.350000000000000000e+02,-7.868564065144057012e-19 337 | 3.360000000000000000e+02,-1.348346606552302018e-18 338 | 3.370000000000000000e+02,-1.984476719255840942e-18 339 | 3.380000000000000000e+02,-2.666247359667608059e-18 340 | 3.390000000000000000e+02,-3.351368215834110863e-18 341 | 3.400000000000000000e+02,-3.983508187521408038e-18 342 | 3.410000000000000000e+02,-4.492548807186714357e-18 343 | 3.420000000000000000e+02,-4.795475004012535116e-18 344 | 3.430000000000000000e+02,-4.799560980012181380e-18 345 | 3.440000000000000000e+02,-4.406690446527608803e-18 346 | 3.450000000000000000e+02,-3.519635905907062734e-18 347 | 3.460000000000000000e+02,-2.049959145998938802e-18 348 | 3.470000000000000000e+02,7.221554470051914961e-20 349 | 3.480000000000000000e+02,2.886114985106452857e-18 350 | 3.490000000000000000e+02,6.388026416807683029e-18 351 | 3.500000000000000000e+02,1.051817250570807305e-17 352 | 3.510000000000000000e+02,1.514807524063507519e-17 353 | 3.520000000000000000e+02,2.006865855333690841e-17 354 | 3.530000000000000000e+02,2.498204201313250910e-17 355 | 3.540000000000000000e+02,2.949733065180599129e-17 356 | 3.550000000000000000e+02,3.313294420723028429e-17 357 | 3.560000000000000000e+02,3.532285961116613005e-17 358 | 3.570000000000000000e+02,3.543780753272688351e-17 359 | 3.580000000000000000e+02,3.281301240665173200e-17 360 | 3.590000000000000000e+02,2.678849701139870298e-17 361 | 3.600000000000000000e+02,1.675903205314203833e-17 362 | 3.610000000000000000e+02,2.236758019101658616e-18 363 | 3.620000000000000000e+02,-1.707287802105573547e-17 364 | 3.630000000000000000e+02,-4.119293910520563038e-17 365 | 3.640000000000000000e+02,-6.979118420937033767e-17 366 | 3.650000000000000000e+02,-1.020986584308553432e-16 367 | 3.660000000000000000e+02,-1.368314269979133162e-16 368 | 3.670000000000000000e+02,-1.721336147717523302e-16 369 | 3.680000000000000000e+02,-2.055431196787567227e-16 370 | 3.690000000000000000e+02,-2.339948008294883812e-16 371 | 3.700000000000000000e+02,-2.538470270784005032e-16 372 | 3.710000000000000000e+02,-2.609957915258576273e-16 373 | 3.720000000000000000e+02,-2.510277940267562799e-16 374 | 3.730000000000000000e+02,-2.194503141339436947e-16 375 | 3.740000000000000000e+02,-1.619782673647613719e-16 376 | 3.750000000000000000e+02,-7.490590028460494602e-17 377 | 3.760000000000000000e+02,4.444076003444194402e-17 378 | 3.770000000000000000e+02,1.972250736290404337e-16 379 | 3.780000000000000000e+02,3.825736543092899130e-16 380 | 3.790000000000000000e+02,5.970536169005638741e-16 381 | 3.800000000000000000e+02,8.341389658569262603e-16 382 | 3.810000000000000000e+02,1.083783188390628349e-15 383 | 3.820000000000000000e+02,1.332100131559230189e-15 384 | 3.830000000000000000e+02,1.561228597223117302e-15 385 | 3.840000000000000000e+02,1.749335282701743489e-15 386 | 3.850000000000000000e+02,1.871066053237653352e-15 387 | 3.860000000000000000e+02,1.898238651241477446e-15 388 | 3.870000000000000000e+02,1.800973497837407166e-15 389 | 3.880000000000000000e+02,1.549156055961649677e-15 390 | 3.890000000000000000e+02,1.114443604844163252e-15 391 | 3.900000000000000000e+02,4.727715557615429526e-16 392 | 3.910000000000000000e+02,-3.928831816061737115e-16 393 | 3.920000000000000000e+02,-1.489339426760396519e-15 394 | 3.930000000000000000e+02,-2.809974743053292560e-15 395 | 3.940000000000000000e+02,-4.331145474779398409e-15 396 | 3.950000000000000000e+02,-6.009041956172670885e-15 397 | 3.960000000000000000e+02,-7.776912632840143715e-15 398 | 3.970000000000000000e+02,-9.543029859829924749e-15 399 | 3.980000000000000000e+02,-1.118933818487392507e-14 400 | 3.990000000000000000e+02,-1.257211194365289806e-14 401 | 4.000000000000000000e+02,-1.352399625982026154e-14 402 | 4.010000000000000000e+02,-1.385833661231512227e-14 403 | 4.020000000000000000e+02,-1.337531295875197340e-14 404 | 4.030000000000000000e+02,-1.187131775054326189e-14 405 | 4.040000000000000000e+02,-9.151320847658373309e-15 406 | 4.050000000000000000e+02,-5.043302549968065394e-15 407 | 4.060000000000000000e+02,5.842754529498756700e-16 408 | 4.070000000000000000e+02,7.803983967579766388e-15 409 | 4.080000000000000000e+02,1.660706476213945668e-14 410 | 4.090000000000000000e+02,2.688225526846743020e-14 411 | 4.100000000000000000e+02,3.839472526872976736e-14 412 | 4.110000000000000000e+02,5.076695270996904097e-14 413 | 4.120000000000000000e+02,6.346196259562328157e-14 414 | 4.130000000000000000e+02,7.577370343519390991e-14 415 | 4.140000000000000000e+02,8.682432446920293683e-14 416 | 4.150000000000000000e+02,9.557176861753431462e-14 417 | 4.160000000000000000e+02,1.008261278003342823e-13 418 | 4.170000000000000000e+02,1.012830099678173396e-13 419 | 4.180000000000000000e+02,9.557329677020318665e-14 420 | 4.190000000000000000e+02,8.232674792525325164e-14 421 | 4.200000000000000000e+02,6.025561268415182037e-14 422 | 4.210000000000000000e+02,2.824669946091706081e-14 423 | 4.220000000000000000e+02,-1.451511427745204566e-14 424 | 4.230000000000000000e+02,-6.842226469803617770e-14 425 | 4.240000000000000000e+02,-1.333082731121685902e-13 426 | 4.250000000000000000e+02,-2.083088153447449287e-13 427 | 4.260000000000000000e+02,-2.917232377499361701e-13 428 | 4.270000000000000000e+02,-3.808888942360580460e-13 429 | 4.280000000000000000e+02,-4.720823561904193588e-13 430 | 4.290000000000000000e+02,-5.604553804222344201e-13 431 | 4.300000000000000000e+02,-6.400056856897963630e-13 432 | 4.310000000000000000e+02,-7.036193684179900019e-13 433 | 4.320000000000000000e+02,-7.431912411333803335e-13 434 | 4.330000000000000000e+02,-7.498205464073502726e-13 435 | 4.340000000000000000e+02,-7.141167036654250092e-13 436 | 4.350000000000000000e+02,-6.265584953338685609e-13 437 | 4.360000000000000000e+02,-4.780531842051250399e-13 438 | 4.370000000000000000e+02,-2.605391974359145453e-13 439 | 4.380000000000000000e+02,3.229158917301956070e-14 440 | 4.390000000000000000e+02,4.041934011594859451e-13 441 | 4.400000000000000000e+02,8.554899813890602612e-13 442 | 4.410000000000000000e+02,1.382128338365312647e-12 443 | 4.420000000000000000e+02,1.974787740793203338e-12 444 | 4.430000000000000000e+02,2.618026999654636936e-12 445 | 4.440000000000000000e+02,3.289521422320165761e-12 446 | 4.450000000000000000e+02,3.959484439610211397e-12 447 | 4.460000000000000000e+02,4.590383889091988553e-12 448 | 4.470000000000000000e+02,5.136968014464352143e-12 449 | 4.480000000000000000e+02,5.546766614220410734e-12 450 | 4.490000000000000000e+02,5.760854539735996654e-12 451 | 4.500000000000000000e+02,5.715605342107496029e-12 452 | 4.510000000000000000e+02,5.344811795282613959e-12 453 | 4.520000000000000000e+02,4.582588949659357860e-12 454 | 4.530000000000000000e+02,3.366898314683257154e-12 455 | 4.540000000000000000e+02,1.643822041552238997e-12 456 | 4.550000000000000000e+02,-6.272323180700320604e-13 457 | 4.560000000000000000e+02,-3.468082805998733494e-12 458 | 4.570000000000000000e+02,-6.875726280603540883e-12 459 | 4.580000000000000000e+02,-1.081619719723348464e-11 460 | 4.590000000000000000e+02,-1.521805618973383487e-11 461 | 4.600000000000000000e+02,-1.996651676330367238e-11 462 | 4.610000000000000000e+02,-2.489821670293000360e-11 463 | 4.620000000000000000e+02,-2.979722513647407740e-11 464 | 4.630000000000000000e+02,-3.439192603377530040e-11 465 | 4.640000000000000000e+02,-3.835513783905689169e-11 466 | 4.650000000000000000e+02,-4.130625131489139810e-11 467 | 4.660000000000000000e+02,-4.281683237394554988e-11 468 | 4.670000000000000000e+02,-4.241937277755017643e-11 469 | 4.680000000000000000e+02,-3.962038763002728187e-11 470 | 4.690000000000000000e+02,-3.391930029662272904e-11 471 | 4.700000000000000000e+02,-2.483060465867555902e-11 472 | 4.710000000000000000e+02,-1.191176267500312743e-11 473 | 4.720000000000000000e+02,5.206210473703500775e-12 474 | 4.730000000000000000e+02,2.678043510102280493e-11 475 | 4.740000000000000000e+02,5.291653016687666734e-11 476 | 4.750000000000000000e+02,8.352655231692017156e-11 477 | 4.760000000000000000e+02,1.182856666940992769e-10 478 | 4.770000000000000000e+02,1.565896570009464252e-10 479 | 4.780000000000000000e+02,1.975145460502587432e-10 480 | 4.790000000000000000e+02,2.397839526314899761e-10 481 | 4.800000000000000000e+02,2.817450289902280785e-10 482 | 4.810000000000000000e+02,3.213548782665283649e-10 483 | 4.820000000000000000e+02,3.561829839967333815e-10 484 | 4.830000000000000000e+02,3.834379611494523324e-10 485 | 4.840000000000000000e+02,4.000137740874726092e-10 486 | 4.850000000000000000e+02,4.025672777364704718e-10 487 | 4.860000000000000000e+02,3.876142924765812883e-10 488 | 4.870000000000000000e+02,3.516793490695326728e-10 489 | 4.880000000000000000e+02,2.914704976198924585e-10 490 | 4.890000000000000000e+02,2.040910187255688633e-10 491 | 4.900000000000000000e+02,8.729084257899247360e-11 492 | 4.910000000000000000e+02,-6.026097680317947764e-11 493 | 4.920000000000000000e+02,-2.386411361820359822e-10 494 | 4.930000000000000000e+02,-4.463412771491111062e-10 495 | 4.940000000000000000e+02,-6.799110234977951313e-10 496 | 4.950000000000000000e+02,-9.336004774073562565e-10 497 | 4.960000000000000000e+02,-1.199000266742617403e-09 498 | 4.970000000000000000e+02,-1.464717751520208236e-09 499 | 4.980000000000000000e+02,-1.716100142515089907e-09 500 | 4.990000000000000000e+02,-1.935030627109915520e-09 501 | 5.000000000000000000e+02,-2.099782374330088232e-09 502 | 5.010000000000000000e+02,-2.185039416878213788e-09 503 | 5.020000000000000000e+02,-2.162043277231107862e-09 504 | 5.030000000000000000e+02,-1.998910106877738898e-09 505 | 5.040000000000000000e+02,-1.661150761472136926e-09 506 | 5.050000000000000000e+02,-1.112343044482005568e-09 507 | 5.060000000000000000e+02,-3.151937527575475343e-10 508 | 5.070000000000000000e+02,7.672796111992172746e-10 509 | 5.080000000000000000e+02,2.170263556816022639e-09 510 | 5.090000000000000000e+02,3.925492973926023407e-09 511 | 5.100000000000000000e+02,6.059272719080750487e-09 512 | 5.110000000000000000e+02,8.590336817845183577e-09 513 | 5.120000000000000000e+02,1.152764172905773227e-08 514 | 5.130000000000000000e+02,1.486808018066625488e-08 515 | 5.140000000000000000e+02,1.859425428867435979e-08 516 | 5.150000000000000000e+02,2.267235512602157526e-08 517 | 5.160000000000000000e+02,2.705047324899342062e-08 518 | 5.170000000000000000e+02,3.165738508371731908e-08 519 | 5.180000000000000000e+02,3.640204726380984980e-08 520 | 5.190000000000000000e+02,4.117378011468005342e-08 521 | 5.200000000000000000e+02,4.584414742728375917e-08 522 | 5.210000000000000000e+02,5.026992038559646340e-08 523 | 5.220000000000000000e+02,5.429798692684414668e-08 524 | 5.230000000000000000e+02,5.777171696798044254e-08 525 | 5.240000000000000000e+02,6.054025302979559099e-08 526 | 5.250000000000000000e+02,6.247034387485902814e-08 527 | 5.260000000000000000e+02,6.346050540843837990e-08 528 | 5.270000000000000000e+02,6.345864597796295456e-08 529 | 5.280000000000000000e+02,6.248133323752303922e-08 530 | 5.290000000000000000e+02,6.063900671617044631e-08 531 | 5.300000000000000000e+02,5.816271580447710000e-08 532 | 5.310000000000000000e+02,5.543504552319962960e-08 533 | 5.320000000000000000e+02,5.302479348393204839e-08 534 | 5.330000000000000000e+02,5.172536466767244203e-08 535 | 5.340000000000000000e+02,5.259988681493258022e-08 536 | 5.350000000000000000e+02,5.702931860643604715e-08 537 | 5.360000000000000000e+02,6.676673403553980127e-08 538 | 5.370000000000000000e+02,8.399421951880183492e-08 539 | 5.380000000000000000e+02,1.113857756300536722e-07 540 | 5.390000000000000000e+02,1.521685777174744588e-07 541 | 5.400000000000000000e+02,2.101778215165754079e-07 542 | 5.410000000000000000e+02,2.898979307656904977e-07 543 | 5.420000000000000000e+02,3.964918232582702131e-07 544 | 5.430000000000000000e+02,5.357920349554045944e-07 545 | 5.440000000000000000e+02,7.142625057920115126e-07 546 | 5.450000000000000000e+02,9.389335891131829777e-07 547 | 5.460000000000000000e+02,1.217337084977539579e-06 548 | 5.470000000000000000e+02,1.557451078927389381e-06 549 | 5.480000000000000000e+02,1.967718391827032945e-06 550 | 5.490000000000000000e+02,2.457192764617591590e-06 551 | 5.500000000000000000e+02,3.035788867695707726e-06 552 | 5.510000000000000000e+02,3.714569641515890357e-06 553 | 5.520000000000000000e+02,4.506168834364325357e-06 554 | 5.530000000000000000e+02,5.425151423889712215e-06 555 | 5.540000000000000000e+02,6.488351314793114003e-06 556 | 5.550000000000000000e+02,7.715224606899282123e-06 557 | 5.560000000000000000e+02,9.128205994265837530e-06 558 | 5.570000000000000000e+02,1.075307232776541846e-05 559 | 5.580000000000000000e+02,1.261937555930206360e-05 560 | 5.590000000000000000e+02,1.476091256977092593e-05 561 | 5.600000000000000000e+02,1.721624485182930516e-05 562 | 5.610000000000000000e+02,2.002928563424419029e-05 563 | 5.620000000000000000e+02,2.324998196738693786e-05 564 | 5.630000000000000000e+02,2.693505912578125883e-05 565 | 5.640000000000000000e+02,3.114887671564333461e-05 566 | 5.650000000000000000e+02,3.596435122557662734e-05 567 | 5.660000000000000000e+02,4.146405251605545704e-05 568 | 5.670000000000000000e+02,4.774139994470154552e-05 569 | 5.680000000000000000e+02,5.490199303519721207e-05 570 | 5.690000000000000000e+02,6.306520371393658207e-05 571 | 5.700000000000000000e+02,7.236564433299833585e-05 572 | 5.710000000000000000e+02,8.295514929442334871e-05 573 | 5.720000000000000000e+02,9.500471286775052080e-05 574 | 5.730000000000000000e+02,1.087068844546973189e-04 575 | 5.740000000000000000e+02,1.242785706309120614e-04 576 | 5.750000000000000000e+02,1.419630295088097525e-04 577 | 5.760000000000000000e+02,1.620340586261048395e-04 578 | 5.770000000000000000e+02,1.847985260322150081e-04 579 | 5.780000000000000000e+02,2.106003724077707415e-04 580 | 5.790000000000000000e+02,2.398253094593146072e-04 581 | 5.800000000000000000e+02,2.729039446938870406e-04 582 | 5.810000000000000000e+02,3.103183280697356227e-04 583 | 5.820000000000000000e+02,3.526062889086789272e-04 584 | 5.830000000000000000e+02,4.003672487798868251e-04 585 | 5.840000000000000000e+02,4.542697621610446547e-04 586 | 5.850000000000000000e+02,5.150564136058479858e-04 587 | 5.860000000000000000e+02,5.835532325482824982e-04 588 | 5.870000000000000000e+02,6.606768646122111602e-04 589 | 5.880000000000000000e+02,7.474424266114098984e-04 590 | 5.890000000000000000e+02,8.449749373052953001e-04 591 | 5.900000000000000000e+02,9.545166001703711718e-04 592 | 5.910000000000000000e+02,1.077439552072310524e-03 593 | 5.920000000000000000e+02,1.215256903248475209e-03 594 | 5.930000000000000000e+02,1.369632778370970727e-03 595 | 5.940000000000000000e+02,1.542398522019149858e-03 596 | 5.950000000000000000e+02,1.735562989717268816e-03 597 | 5.960000000000000000e+02,1.951328880987163866e-03 598 | 5.970000000000000000e+02,2.192108222839979879e-03 599 | 5.980000000000000000e+02,2.460535471972040249e-03 600 | 5.990000000000000000e+02,2.759488430775100531e-03 601 | 6.000000000000000000e+02,3.092101010364791801e-03 602 | -------------------------------------------------------------------------------- /utils.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Settings and utility functions\n", 8 | "\n", 9 | "This module has all of the standard pieces of code we need for the tutrials so that we don't have to repeat them for every lesson." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": { 15 | "tags": [] 16 | }, 17 | "source": [ 18 | "## Set path to CADET bin folder\n", 19 | "\n", 20 | "The first step is to import CADET and tell the system where cadet-cli can be found.\n", 21 | "\n", 22 | "
\n", 23 | "\n", 24 | "**Note:** \n", 25 | "\n", 26 | "Please specify the location of the `cadet-cli` executable by providing the location of the `bin` folder where CADET was installed.\n", 27 | "\n", 28 | "
" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": null, 34 | "metadata": { 35 | "tags": [] 36 | }, 37 | "outputs": [], 38 | "source": [ 39 | "import shutil\n", 40 | "import os\n", 41 | "import platform\n", 42 | "from pathlib import Path\n", 43 | "from cadet import Cadet\n", 44 | "\n", 45 | "# Either ensure CADET is on your PATH (e.g. by installing via conda)\n", 46 | "# OR \n", 47 | "# provide the path to the CADET installation\n", 48 | "# E.g.\n", 49 | "# windows: C:\\Users\\\\cadet\n", 50 | "# linux: ~/cadet/bin\n", 51 | "# would be set by:\n", 52 | "\n", 53 | "install_path = None\n", 54 | "\n", 55 | "executable = 'cadet-cli'\n", 56 | "if install_path is None:\n", 57 | " try:\n", 58 | " if platform.system() == 'Windows':\n", 59 | " executable += '.exe'\n", 60 | " executable_path = Path(shutil.which(executable))\n", 61 | " except TypeError:\n", 62 | " raise FileNotFoundError(\n", 63 | " \"CADET could not be found. Please set an install path\"\n", 64 | " )\n", 65 | " install_path = executable_path.parent.parent\n", 66 | "\n", 67 | "install_path = Path(install_path)\n", 68 | "cadet_bin_path = install_path / \"bin\" / executable\n", 69 | "\n", 70 | "if cadet_bin_path.exists():\n", 71 | " Cadet.cadet_path = install_path\n", 72 | "else:\n", 73 | " raise FileNotFoundError(\n", 74 | " \"CADET could not be found. Please check the path\"\n", 75 | " )\n", 76 | "\n", 77 | "cadet_lib_path = install_path / \"lib\"\n", 78 | "try:\n", 79 | " if cadet_lib_path.as_posix() not in os.environ['LD_LIBRARY_PATH']:\n", 80 | " os.environ['LD_LIBRARY_PATH'] = \\\n", 81 | " cadet_lib_path.as_posix() \\\n", 82 | " + os.pathsep \\\n", 83 | " + os.environ['LD_LIBRARY_PATH']\n", 84 | "except KeyError:\n", 85 | " os.environ['LD_LIBRARY_PATH'] = cadet_lib_path.as_posix()\n", 86 | "\n", 87 | "lwe_executable = 'createLWE'\n", 88 | "if platform.system() == 'Windows':\n", 89 | " lwe_executable += '.exe'\n", 90 | "lwe_path = install_path / \"bin\" / lwe_executable" 91 | ] 92 | }, 93 | { 94 | "cell_type": "markdown", 95 | "metadata": {}, 96 | "source": [ 97 | "## Standard imports\n", 98 | "\n", 99 | "Here, some other standard libraries are imported." 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [ 108 | "import os\n", 109 | "\n", 110 | "from IPython.display import display, HTML, clear_output\n", 111 | "display(HTML(\"\"))\n", 112 | "\n", 113 | "from IPython.display import Image\n", 114 | "\n", 115 | "# python numeric library\n", 116 | "import numpy as np\n", 117 | "\n", 118 | "# scientific library for python\n", 119 | "import scipy\n", 120 | "\n", 121 | "# addict is a library that makes it easier to create nested dictionaries\n", 122 | "from addict import Dict\n", 123 | "\n", 124 | "# json is a standard text based format and it used in CADETMatch for the configuration file\n", 125 | "import json\n", 126 | "\n", 127 | "# python plotting library\n", 128 | "import matplotlib.pyplot as plt\n", 129 | "%config InlineBackend.figure_format='svg'\n", 130 | "%matplotlib inline\n", 131 | "\n", 132 | "# jupyter widget support\n", 133 | "from ipywidgets import interact, interactive\n", 134 | "import ipywidgets as widgets\n", 135 | "\n", 136 | "# Temporary files for simulation objects\n", 137 | "import tempfile\n", 138 | "tempfile.tempdir = os.path.join(Path.home())\n", 139 | "\n", 140 | "import subprocess" 141 | ] 142 | }, 143 | { 144 | "cell_type": "markdown", 145 | "metadata": {}, 146 | "source": [ 147 | "## Template for CADET simulations\n", 148 | "\n", 149 | "This function defines some default values that can be used for all simulations." 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": null, 155 | "metadata": {}, 156 | "outputs": [], 157 | "source": [ 158 | "def get_cadet_template(n_units=3, split_components_data=False):\n", 159 | " cadet_template = Cadet()\n", 160 | " \n", 161 | " cadet_template.root.input.model.nunits = n_units\n", 162 | " \n", 163 | " # Store solution\n", 164 | " cadet_template.root.input['return'].split_components_data = split_components_data\n", 165 | " cadet_template.root.input['return'].split_ports_data = 0\n", 166 | " cadet_template.root.input['return'].unit_000.write_solution_inlet = 1\n", 167 | " cadet_template.root.input['return'].unit_000.write_solution_outlet = 1\n", 168 | " cadet_template.root.input['return'].unit_000.write_solution_bulk = 1\n", 169 | " cadet_template.root.input['return'].unit_000.write_solution_particle = 1\n", 170 | " cadet_template.root.input['return'].unit_000.write_solution_solid = 1\n", 171 | " cadet_template.root.input['return'].unit_000.write_solution_flux = 1\n", 172 | " cadet_template.root.input['return'].unit_000.write_solution_volume = 1\n", 173 | " cadet_template.root.input['return'].unit_000.write_coordinates = 1\n", 174 | " cadet_template.root.input['return'].unit_000.write_sens_outlet = 1\n", 175 | " \n", 176 | " for unit in range(n_units):\n", 177 | " cadet_template.root.input['return']['unit_{0:03d}'.format(unit)] = cadet_template.root.input['return'].unit_000\n", 178 | " \n", 179 | " # Tolerances for the time integrator\n", 180 | " cadet_template.root.input.solver.time_integrator.abstol = 1e-6\n", 181 | " cadet_template.root.input.solver.time_integrator.algtol = 1e-10\n", 182 | " cadet_template.root.input.solver.time_integrator.reltol = 1e-6\n", 183 | " cadet_template.root.input.solver.time_integrator.init_step_size = 1e-6\n", 184 | " cadet_template.root.input.solver.time_integrator.max_steps = 1000000\n", 185 | " \n", 186 | " # Solver settings\n", 187 | " cadet_template.root.input.model.solver.gs_type = 1\n", 188 | " cadet_template.root.input.model.solver.max_krylov = 0\n", 189 | " cadet_template.root.input.model.solver.max_restarts = 10\n", 190 | " cadet_template.root.input.model.solver.schur_safety = 1e-8\n", 191 | "\n", 192 | " # Run the simulation on single thread\n", 193 | " cadet_template.root.input.solver.nthreads = 1\n", 194 | " \n", 195 | " return cadet_template\n", 196 | "\n", 197 | "\n", 198 | "def set_discretization(model, n_col=20, n_par_types=1):\n", 199 | " columns = {'GENERAL_RATE_MODEL', 'LUMPED_RATE_MODEL_WITH_PORES', 'LUMPED_RATE_MODEL_WITHOUT_PORES'}\n", 200 | " \n", 201 | " \n", 202 | " for unit_name, unit in model.root.input.model.items():\n", 203 | " if 'unit_' in unit_name and unit.unit_type in columns:\n", 204 | " unit.discretization.spatial_method = \"FV\"\n", 205 | " unit.discretization.ncol = n_col\n", 206 | " unit.discretization.npar = 5\n", 207 | " unit.discretization.npartype = n_par_types\n", 208 | " \n", 209 | " unit.discretization.par_disc_type = 'EQUIDISTANT_PAR'\n", 210 | " unit.discretization.use_analytic_jacobian = 1\n", 211 | " unit.discretization.reconstruction = 'WENO'\n", 212 | " unit.discretization.gs_type = 1\n", 213 | " unit.discretization.max_krylov = 0\n", 214 | " unit.discretization.max_restarts = 10\n", 215 | " unit.discretization.schur_safety = 1.0e-8\n", 216 | "\n", 217 | " unit.discretization.weno.boundary_model = 0\n", 218 | " unit.discretization.weno.weno_eps = 1e-10\n", 219 | " unit.discretization.weno.weno_order = 3" 220 | ] 221 | }, 222 | { 223 | "cell_type": "markdown", 224 | "metadata": {}, 225 | "source": [ 226 | "This function creates a simple model for a dextran pulse." 227 | ] 228 | }, 229 | { 230 | "cell_type": "code", 231 | "execution_count": null, 232 | "metadata": {}, 233 | "outputs": [], 234 | "source": [ 235 | "def create_dextran_model():\n", 236 | "\n", 237 | " dextran_model = get_cadet_template(n_units=3, split_components_data=True)\n", 238 | "\n", 239 | " # INLET\n", 240 | " dextran_model.root.input.model.unit_000.unit_type = 'INLET'\n", 241 | " dextran_model.root.input.model.unit_000.ncomp = 1\n", 242 | " dextran_model.root.input.model.unit_000.inlet_type = 'PIECEWISE_CUBIC_POLY'\n", 243 | "\n", 244 | " # Column\n", 245 | " dextran_model.root.input.model.unit_001.unit_type = 'LUMPED_RATE_MODEL_WITH_PORES'\n", 246 | " dextran_model.root.input.model.unit_001.ncomp = 1\n", 247 | " dextran_model.root.input.model.unit_001.nbound = [0]\n", 248 | " \n", 249 | " dextran_model.root.input.model.unit_001.col_length = 0.25\n", 250 | " dextran_model.root.input.model.unit_001.cross_section_area = 1e-4\n", 251 | " dextran_model.root.input.model.unit_001.col_porosity = 0.37\n", 252 | " dextran_model.root.input.model.unit_001.par_porosity = 0.33\n", 253 | " dextran_model.root.input.model.unit_001.par_radius = 4.5e-5\n", 254 | "\n", 255 | " dextran_model.root.input.model.unit_001.col_dispersion = 2.0e-7\n", 256 | " dextran_model.root.input.model.unit_001.film_diffusion = [0.0,]\n", 257 | " \n", 258 | " dextran_model.root.input.model.unit_001.adsorption_model = 'NONE'\n", 259 | " \n", 260 | " dextran_model.root.input.model.unit_001.init_c = [0.0,]\n", 261 | " \n", 262 | " set_discretization(dextran_model, n_col=100)\n", 263 | " \n", 264 | " ## Outlet\n", 265 | " dextran_model.root.input.model.unit_002.ncomp = 1\n", 266 | " dextran_model.root.input.model.unit_002.unit_type = 'OUTLET'\n", 267 | " \n", 268 | " # Sections and connections\n", 269 | " dextran_model.root.input.solver.sections.nsec = 2\n", 270 | " dextran_model.root.input.solver.sections.section_times = [0.0, 50.0, 600.0]\n", 271 | " dextran_model.root.input.solver.sections.section_continuity = [0,]\n", 272 | " \n", 273 | " ## Inlet Profile\n", 274 | " dextran_model.root.input.model.unit_000.sec_000.const_coeff = [1.0,]\n", 275 | " dextran_model.root.input.model.unit_000.sec_001.const_coeff = [0.0,]\n", 276 | " \n", 277 | " ## Switches\n", 278 | " dextran_model.root.input.model.connections.nswitches = 1\n", 279 | " dextran_model.root.input.model.connections.switch_000.section = 0\n", 280 | " dextran_model.root.input.model.connections.switch_000.connections = [\n", 281 | " 0, 1, -1, -1, 2.88e-8,\n", 282 | " 1, 2, -1, -1, 2.88e-8\n", 283 | " ]\n", 284 | "\n", 285 | " #set the times that the simulator writes out data for\n", 286 | " dextran_model.root.input.solver.user_solution_times = np.linspace(0, 600, 601)\n", 287 | "\n", 288 | " return dextran_model\n", 289 | "\n", 290 | "def plot_dextran_model(model):\n", 291 | " time = model.root.output.solution.solution_times\n", 292 | " c = model.root.output.solution.unit_001.solution_outlet_comp_000\n", 293 | " plt.plot(time, c)\n", 294 | " plt.title('Column (Outlet)')\n", 295 | " plt.xlabel('$time~/~min$')\n", 296 | " plt.ylabel('$concentration~/~mol \\cdot L^{-1} $')\n", 297 | " plt.show()\n", 298 | " " 299 | ] 300 | }, 301 | { 302 | "cell_type": "code", 303 | "execution_count": null, 304 | "metadata": {}, 305 | "outputs": [], 306 | "source": [ 307 | "def create_langmuir_model():\n", 308 | "\n", 309 | " langmuir_model = get_cadet_template(n_units=3)\n", 310 | "\n", 311 | " # INLET\n", 312 | " langmuir_model.root.input.model.unit_000.unit_type = 'INLET'\n", 313 | " langmuir_model.root.input.model.unit_000.ncomp = 1\n", 314 | " langmuir_model.root.input.model.unit_000.inlet_type = 'PIECEWISE_CUBIC_POLY'\n", 315 | "\n", 316 | " # Column\n", 317 | " langmuir_model.root.input.model.unit_001.unit_type = 'LUMPED_RATE_MODEL_WITH_PORES'\n", 318 | " langmuir_model.root.input.model.unit_001.ncomp = 1\n", 319 | "\n", 320 | " langmuir_model.root.input.model.unit_001.col_length = 0.25\n", 321 | " langmuir_model.root.input.model.unit_001.cross_section_area = 1.0386890710931253E-4\n", 322 | " langmuir_model.root.input.model.unit_001.col_porosity = 0.37\n", 323 | " langmuir_model.root.input.model.unit_001.par_porosity = 0.33\n", 324 | " langmuir_model.root.input.model.unit_001.par_radius = 4.5e-5\n", 325 | " \n", 326 | " langmuir_model.root.input.model.unit_001.col_dispersion = 2.0e-7\n", 327 | " langmuir_model.root.input.model.unit_001.film_diffusion = [2.0E-7,]\n", 328 | " \n", 329 | " langmuir_model.root.input.model.unit_001.adsorption_model = 'MULTI_COMPONENT_LANGMUIR'\n", 330 | "\n", 331 | " langmuir_model.root.input.model.unit_001.nbound = [1,]\n", 332 | " langmuir_model.root.input.model.unit_001.adsorption.is_kinetic = 1\n", 333 | " langmuir_model.root.input.model.unit_001.adsorption.mcl_ka = [1.144,]\n", 334 | " langmuir_model.root.input.model.unit_001.adsorption.mcl_kd = [2.0e-3,]\n", 335 | " langmuir_model.root.input.model.unit_001.adsorption.mcl_qmax = [4.88,]\n", 336 | "\n", 337 | " langmuir_model.root.input.model.unit_001.init_c = [0.0,]\n", 338 | " langmuir_model.root.input.model.unit_001.init_q = [0.0,]\n", 339 | "\n", 340 | " ## Outlet\n", 341 | " langmuir_model.root.input.model.unit_002.ncomp = 1\n", 342 | " langmuir_model.root.input.model.unit_002.unit_type = 'OUTLET'\n", 343 | " \n", 344 | " set_discretization(langmuir_model)\n", 345 | "\n", 346 | " # Sections and connections\n", 347 | " langmuir_model.root.input.solver.sections.nsec = 2\n", 348 | " langmuir_model.root.input.solver.sections.section_times = [0.0, 3000.0, 9500.0]\n", 349 | " langmuir_model.root.input.solver.sections.section_continuity = [0,]\n", 350 | " \n", 351 | " ## Inlet Profile\n", 352 | " langmuir_model.root.input.model.unit_000.sec_000.const_coeff = [1.0,]\n", 353 | " langmuir_model.root.input.model.unit_000.sec_001.const_coeff = [0.0,]\n", 354 | " \n", 355 | " ## Switches\n", 356 | " langmuir_model.root.input.model.connections.nswitches = 1\n", 357 | " langmuir_model.root.input.model.connections.switch_000.section = 0\n", 358 | " langmuir_model.root.input.model.connections.switch_000.connections = [\n", 359 | " 0, 1, -1, -1, 2.88e-8,\n", 360 | " 1, 2, -1, -1, 2.88e-8\n", 361 | " ]\n", 362 | "\n", 363 | " # set the times that the simulator writes out data for\n", 364 | " langmuir_model.root.input.solver.user_solution_times = np.linspace(0, 9500, 9501) \n", 365 | "\n", 366 | " return langmuir_model\n", 367 | "\n", 368 | "def plot_langmuir_model(model):\n", 369 | " time = model.root.output.solution.solution_times\n", 370 | " c = model.root.output.solution.unit_001.solution_outlet\n", 371 | " plt.plot(time, c)\n", 372 | " plt.title('Column (Outlet)')\n", 373 | " plt.xlabel('$time~/~min$')\n", 374 | " plt.ylabel('$concentration~/~mol \\cdot L^{-1} $')\n", 375 | " plt.show() " 376 | ] 377 | }, 378 | { 379 | "cell_type": "code", 380 | "execution_count": null, 381 | "metadata": {}, 382 | "outputs": [], 383 | "source": [ 384 | "def save_to_csv(time, c, file_name):\n", 385 | " combined_data = np.column_stack(time, c)\n", 386 | " \n", 387 | " np.save_to_csv(file_name, combined_data, delimiter=',')" 388 | ] 389 | }, 390 | { 391 | "cell_type": "markdown", 392 | "metadata": {}, 393 | "source": [ 394 | "## Function for running CADET\n", 395 | "\n", 396 | "Wrapper for calling the `Cadet.run()` function with some additional functionality." 397 | ] 398 | }, 399 | { 400 | "cell_type": "code", 401 | "execution_count": null, 402 | "metadata": {}, 403 | "outputs": [], 404 | "source": [ 405 | "def run_simulation(cadet, file_name=None):\n", 406 | " if file_name is None:\n", 407 | " f = next(tempfile._get_candidate_names())\n", 408 | " cadet.filename = os.path.join(tempfile.tempdir, f + '.h5')\n", 409 | " else:\n", 410 | " cadet.filename = file_name\n", 411 | " # save the simulation\n", 412 | " cadet.save()\n", 413 | "\n", 414 | " # run the simulation and load results\n", 415 | " data = cadet.run()\n", 416 | " cadet.load()\n", 417 | " \n", 418 | " # Remove files \n", 419 | " if file_name is None:\n", 420 | " os.remove(os.path.join(tempfile.tempdir, f + '.h5'))\n", 421 | "\n", 422 | " # Raise error if simulation fails\n", 423 | " if data.return_code == 0:\n", 424 | " print(\"Simulation completed successfully\")\n", 425 | " else:\n", 426 | " print(data)\n", 427 | " raise Exception(\"Simulation failed\")" 428 | ] 429 | }, 430 | { 431 | "cell_type": "markdown", 432 | "metadata": {}, 433 | "source": [ 434 | "## CADET-Match" 435 | ] 436 | }, 437 | { 438 | "cell_type": "code", 439 | "execution_count": null, 440 | "metadata": {}, 441 | "outputs": [], 442 | "source": [ 443 | "from CADETMatch.jupyter import Match" 444 | ] 445 | } 446 | ], 447 | "metadata": { 448 | "kernelspec": { 449 | "display_name": "Python 3 (ipykernel)", 450 | "language": "python", 451 | "name": "python3" 452 | }, 453 | "language_info": { 454 | "codemirror_mode": { 455 | "name": "ipython", 456 | "version": 3 457 | }, 458 | "file_extension": ".py", 459 | "mimetype": "text/x-python", 460 | "name": "python", 461 | "nbconvert_exporter": "python", 462 | "pygments_lexer": "ipython3", 463 | "version": "3.10.16" 464 | } 465 | }, 466 | "nbformat": 4, 467 | "nbformat_minor": 4 468 | } 469 | --------------------------------------------------------------------------------