├── .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 | " \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 | "