AAE-E3030 - Numerical Modeling of Multiphase Flows L, 25.02.2019-28.05.2019
This course space end date is set to 28.05.2019 Search Courses: AAE-E3030
Lecture 3 , Python tutorials
Krav för slutförande
Dear all,
The material for the python tutorial session we will have 14th Thursday can be downloaded from here. In the compressed folder, you will find numbered python scripts from 1 to 20, representing different exercises.
Two different ways to run the exercises in Linux:
- You can run the exercise scripts by navigating through their folder in the linux terminal, and typing "python <exercisename>.py", which will then run the code, and print the information on the screen, if any print command is given.
- You can also use the software ipython, which should come as built-in in all most, not all Aalto machines. Type ipython to your terminal (while in the folder of exercises) to boot it up. Inside ipython environment, you can run any exercise with "run <exercisename>.py". Good thing about ipython is that the variables you create are stored in the session, so if you define e.g. x=5, after the code is run typing x to the terminal will print you its value.
NOTE: If your machine does not have ipython, you can use the Aalto computing services brute and force. Here is how you do it:
- Open up your terminal and type ssh -X <youraaltousername>@brute.aalto.fi, then enter your password.
- Navigate to the folder with exercise files, and boot ipython by typing ipython to your terminal.
Finally, I have created a Jupyter notebook : https://jupyter.org/ ,for anyone wishing to do the exercise on their browser. Please keep in mind that for the exercises related to chemistry calculations you should be using Cantera software, which is not available in Jupyter notebooks. So I highly suggest using your linux terminal to practice.
If for any reason (for instance a Windows computer) you want to do the exercises in Jupyter notebook follow the simple steps below:
- Go to https://notebooks.csc.fi/#/ and login with your Aalto credentials using HAKA Login.
- In the Environments page, click "Launch New" under "Course Introduction to Python (self-study)" tab and wait for Access button to show up. When access is shown, click "Open in browser"
- You will then go to a page with Files tab. On right side, click "Upload" and upload the python_Exercise.ipynb file provided here. Click blue Upload button.
- Click to the file to open it up. Now you're in an cloud computing environment with some text and code lines. You can run the code lines by clicking on them and pressing "Run" on the top panel, which will print the result of that code cell. If you want to clear your outputs, click Cell>All Output/Current Outputs>Clear.
Keep in mind that the environment you generate will be deleted in 5 hours and your work won't be saved, so download your file if you want to keep your changes.
See you all tomorrow morning at T7.
Best,
Bulut