Descriptoin |
Comment |
Download link |
CO2-solubility |
MATLAB-script that calculates the CO2 solubility in water and brines. The model is written based on "An improved model calculating CO2 solubility in pure water and aqueous NaCl solutions from 273 to 533 K and from 0 to 2000 bar" by Zhenhao Duan and Rui Sun (2003), and "An improved model for the calculation of CO2 solubility in aqueous solutions containing Na+, K+, Ca2+, Cl-, and SO42-" by Zhenhao Duan and Rui Sun (2005). |
View code |
Polyalphabetic-cipher decoder |
MATLAB-script that takes English polyalphabetic shift-cipher code as input from .txt file, uses frequency-analysis and finds the most likely decryption key for a defined key-length. The script puts out the plain deciphered text to an Excel-spreadsheet. The script is just written "off the top of my head". |
View code |
Pressure-drop calculation |
MATLAB-script used to calculate a full pressure-drop model for multi-phase flow in pipes. The model utilises the Beggs and Brill pressure-drop model, merged with Vogel inflow, Hasan-Kabir temperature calculation and a self-modified gas fraction estimation. The model is solved iteratively. |
View code |
Dice game |
Small python-program that simulates a die casting game. The user starts with 1000 points and places a bet. Further, the user guess if the computer rolls above or below expected face value. The game is fair, with a 50% chance for either on each roll. The game is over if the player loses all the points. With a correct guess, the player is given its initial bet back times two. |
Download |
Monty-hall problem |
The Monty-Hall problem is a game-show puzzle where three doors are presented to the contester. Behind two of the doors are goats, and behind one door is a car. A potential contester would pick a door to open and win what's behind it. The twist is that after the contester has chosen a door, thehost, who knows where the car is, will open a door that hides a goat (The contester's door will not be opened). The contester is then given the opportunity to change its choice to the remaining door. It is easy to analytically prove that the contester should always switch the choice of doors, but this code proves it empirically. This is a program (Matlab-code) that simulates 10^5 games of not switching the door when given the choice, and 10^5 games of switching the door. The winning (getting the car) statistics are presented at the end of the file. |
View |
Yield to maturity |
Yield to maturity needs to be calculated numerically, which this GUI-solver does. Coded in MATLAB. |
Download |
Iterative solver |
I accidently constructet a rather efficient iterative solver to solve equations on the form "f(x) = 0". The algorithm was developed to solve the above "Yield to Maturity problem", but has been generalised and is pre-filled out to solve x = sqrt(2). |
View code |