This is the 25 + 1 year anniversary version of the 1995 Rachford-Rice contest

Overview

Rachford-Rice Contest

This is the 25 + 1 year anniversary version of the 1995 Rachford-Rice contest. Can you solve the Rachford-Rice problem for all these cases? With the initiative of Curtis Hays Whitson, and the extensive help by Aaron Zick, the original Rachford-Rice contest offered $1000 to any student who could solve the problem for all cases. Only three people were able to develop procedures that passed all the test, and none of these were students.

Today we are happy to re-release the Rachford-Rice contest, but now for Python. There are several differences between the original contest and this version, the main one being that this version will focus mainly on passing all the tests and not that much on speed. A timer will be set for your calculations, so if you want to optimize for speed as well you are free to do so.

To access the original version of the Rachford-Rice contest, go to this link.

Table of Contents

How do you access the code?

You can either use Git to clone the repository using

git clone https://github.com/WhitsonAS/Rachford-Rice-Contest.git

If you do not want to use Git or know how to use Git, you can manually download the repository by clicking the green code button and press the option called "Download ZIP".

Code download button

How do you enter your code?

The main stucture of the code is not to be modified at all, so you are only supposed to write code in certain designated files or functions. The file that contains the function which you have to change is called rachford_rice_solution.py and the function is called rachford_rice_solver(). This is the only place where you can change anything.

The function takes in the number of components (Nc) as an integer, the composition (zi) as a numpy array, and the K-values (Ki) as a numpy array.

The output of the function must be given in the following order, as the following types. The number of iterations used (N) as an integer, the vapor molar composition (yi) as a numpy array, the liquid molar composition (xi) as a numpy array, the vapor molar fraction (V) as a float, and the liquid molar fraction (L) as a float.

For debugging purposes, there is an option in section (3) in the main.py file in the function called is_converged() where you can turn on an optinal variable called print_to_console (which is False by default) by setting it to True. This feature will print some useful information about which tests pass / fail for each case.

See video 5 for an example of how to add you code.

Note that you're not allowed to change the floating point precision to get the desired threshold! The goal is that your algorithm should be able to have a threshold equal to your floating point precision. Any solution based on floating point manipulation of this kind will be disqualified.

When you have developed a code that you want to submit, make a folder within the folder called Solutions with the date of your submission (YYYYMMDD) and your name (e.g. 20211015-Markus-Hays-Nielsen) and add a file called solution.py within this folder (the relative path should look like this: Solutions/20211015-Markus-Hays-Nielsen/solution-py). The solution file should be possible to copy and paste straight into rachford_rice_solution.py and run with no modifications needed. If there is any issue with running your solution, you will be contacted and asked to fix the issue. If no answer is recived, the solution will be removed. This is meant to make everything easier for the reviewer and anyone else who wants to try your code.

The procedure for adding your code to the repository is to first make a new branch with your name (e.g. markus-hays-nielsen) and once you are ready to submit you can create a pull request with your file(s) in the structure detailed above. Once your code has been reviewed, we will add your code to the main branch and it will become public.

If you want to submit you solution privately, please contact us by mail at [email protected].

Basic theory about Rachford-Rice problem

The Rachford-Rice equation is a combination of (1) the material balance equation, (2) the assumption that the vapor (yi) and liquid (xi) compositions are defined by a constant set of K-values (Ki) and (3) that the sum of vapor and liquid molar fractions sum to one.

The equation is given by

equation

where zi is the total molar composition of component i, and V is the vapor molar fraction defined by

equation

where nV is the total molar amount of the vapor phase and nL is the total molar amount of the liquid phase.

The constraints for passing the contest are given by a set of test functions (R) and are given by

Vapor composition test

equation

Liquid composition test

equation

Vapor and liquid fraction test

equation

Material balance test

equation

K-value test

equation

where the threshold value (εt) is set to be 10-15.

The tests will be judged based on their severity which is given by

equation

For more information about the Rachford-Rice solution, watch the following videos:

List of participants who have successfully completed

  • Aaron Zick
  • Michael Michelsen
  • Kim Knudsen
You might also like...
Chinese Pre-Trained Language Models (CPM-LM) Version-I

CPM-Generate 为了促进中文自然语言处理研究的发展,本项目提供了 CPM-LM (2.6B) 模型的文本生成代码,可用于文本生成的本地测试,并以此为基础进一步研究零次学习/少次学习等场景。[项目首页] [模型下载] [技术报告] 若您想使用CPM-1进行推理,我们建议使用高效推理工具BMI

Simple GUI where you can enter an article and get a crisp summarized version.

Text-Summarization-using-TextRank-BART Simple GUI where you can enter an article and get a crisp summarized version. How to run: Clone the repo Instal

Snack Rice - A Rice University servery finder, customized for your needs!

Snack Rice - A Rice University servery finder, customized for your needs!

Write a program that works out whether if a given year is a leap year
Write a program that works out whether if a given year is a leap year

Leap Year 💪 This is a Difficult Challenge 💪 Instructions Write a program that works out whether if a given year is a leap year. A normal year has 36

🖍️This is a feature-complete clone of the awesome Chalk (JavaScript) library.
🖍️This is a feature-complete clone of the awesome Chalk (JavaScript) library.

Terminal string styling done right This is a feature-complete clone of the awesome Chalk (JavaScript) library. All credits go to Sindre Sorhus. Highli

Contain the customization I made for my Linux rice.

dotfiles Contain the customization I made for my Linux rice. Credit and Respect Polybar Autohide Fulltime Rofi by adi1090x (only include my personal r

It is the assignment for COMP 576 in Rice University

COMP-576 It is the assignment for COMP 576 in Rice University There are two programming assignments and one Final Project. Assignment 1: It is a MLP a

One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

This Repository is an up-to-date version of Harvard nlp's Legacy code and a Refactoring of the jupyter notebook version as a shell script version.
This Repository is an up-to-date version of Harvard nlp's Legacy code and a Refactoring of the jupyter notebook version as a shell script version.

This Repository is an up-to-date version of Harvard nlp's Legacy code and a Refactoring of the jupyter notebook version as a shell script version.

9th place solution in "Santa 2020 - The Candy Cane Contest"

Santa 2020 - The Candy Cane Contest My solution in this Kaggle competition "Santa 2020 - The Candy Cane Contest", 9th place. Basic Strategy In this co

A global contest to grow and monitor your own food with Raspberry Pi
A global contest to grow and monitor your own food with Raspberry Pi

growlab A global contest to grow and monitor your own food with Raspberry Pi A capture from phototimer of my seed tray with a wide-angle camera positi

Autotype on websites that have copy-paste disabled like Moodle, HackerEarth contest etc.
Autotype on websites that have copy-paste disabled like Moodle, HackerEarth contest etc.

Autotype A quick and small python script that helps you autotype on websites that have copy paste disabled like Moodle, HackerEarth contests etc as it

These are After Effects and Python files that were made in the process of creating the video for the contest.

spirograph These are After Effects and Python files that were made in the process of creating the video for the contest. In the python file you can qu

A results generator and automatic token checker for Yandex Contest

Yandex contest Python checking tools A results generator and automatic token checker for Yandex Contest. Версия на русском языке Installation Clone th

A Telegram Bot to display Codeforces Contest Ranklist

CFRankListBot A bot that displays the top ranks for a Codeforces contest. Participants' Details All the details of a participant is in the utils/__ini

30DaysOfCode-PhoenixClub - Solution of everyday coding problem given in 30DaysofCode contest held on Hackerrank

30DaysOfCode-PhoenixClub 👨‍💻 Every day problems solution given in 30DaysOfCode

2021 AI CUP Competition on Traditional Chinese Scene Text Recognition - Intermediate Contest

繁體中文場景文字辨識 程式碼說明 組別:這就是我 成員:蔣明憲 唐碩謙 黃玥菱 林冠霆 蕭靖騰 目錄 環境套件 安裝方式 資料夾布局 前處理-製作偵測訓練註解檔 前處理-製作分類訓練樣本 part.py : 從 json 裁切出分類訓練樣本 Class.py : 將切出來的樣本按照文字分類到各資料夾

Comments
  • a 'solution'

    a 'solution'

    A fake, cheating "solution" which is more of a cautionary tale about Python. Maybe some people will enjoy it! No floating point precision flags were harmed etc. etc.

    opened by derrickturk 1
  • 127 failed cases in benchmark

    127 failed cases in benchmark

    Hello again!

    I ran main.py and I get 127 failed cases for 20211015-Markus-Hays-Nielsen:

    image

    I would just like to confirm that it is not necessary to pass all tests to upload to the repository. Also, I think it's possible that some tests may pass (or fail) depending on the compiler... Are different operating systems are also tested?

    Thanks!

    opened by yoelcortes 1
  • How many iterations maximum?

    How many iterations maximum?

    Hello!

    Seems like the number of iterations of the benchmark solution can go up to 101 (not 100), is going up to 101 OK?

    https://github.com/WhitsonAS/Rachford-Rice-Contest/blob/39e686f48f69a6efe0c4d464d3ed11ffb2bc9b82/Solutions/20211015-Markus-Hays-Nielsen/solution.py#L54

    Thanks in advance for the clarification!

    opened by yoelcortes 1
  • Typo racford_rice_solver

    Typo racford_rice_solver

    Hi! Just wanted to let you know there is a typo in the function name of racford_rice_solver (should be rachford_rice_solver). This typo is everywhere, including in Solution/20211015-Markus-Hays-Nielsen.py and in main.py. Thanks!

    opened by yoelcortes 1
Owner
null
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.

Summarization, translation, Q&A, text generation and more at blazing speed using a T5 version implemented in ONNX. This package is still in alpha stag

Abel 211 Dec 28, 2022
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.

Summarization, translation, Q&A, text generation and more at blazing speed using a T5 version implemented in ONNX. This package is still in alpha stag

Abel 137 Feb 1, 2021
Pytorch version of BERT-whitening

BERT-whitening This is the Pytorch implementation of "Whitening Sentence Representations for Better Semantics and Faster Retrieval". BERT-whitening is

Weijie Liu 255 Dec 27, 2022
GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model

GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model -- based on GPT-3, called GPT-Codex -- that is fine-tuned on publicly available code from GitHub.

Nathan Cooper 2.3k Jan 1, 2023
open-information-extraction-system, build open-knowledge-graph(SPO, subject-predicate-object) by pyltp(version==3.4.0)

中文开放信息抽取系统, open-information-extraction-system, build open-knowledge-graph(SPO, subject-predicate-object) by pyltp(version==3.4.0)

null 7 Nov 2, 2022
Pytorch-version BERT-flow: One can apply BERT-flow to any PLM within Pytorch framework.

Pytorch-version BERT-flow: One can apply BERT-flow to any PLM within Pytorch framework.

Ubiquitous Knowledge Processing Lab 59 Dec 1, 2022
An extension for asreview implements a version of the tf-idf feature extractor that saves the matrix and the vocabulary.

Extension - matrix and vocabulary extractor for TF-IDF and Doc2Vec An extension for ASReview that adds a tf-idf extractor that saves the matrix and th

ASReview 4 Jun 17, 2022
Refactored version of FastSpeech2

Refactored version of FastSpeech2. An implementation of Microsoft's "FastSpeech 2: Fast and High-Quality End-to-End Text to Speech"

ILJI CHOI 10 May 26, 2022
A simple version of DeTR

DeTR-Lite A simple version of DeTR Before you enjoy this DeTR-Lite The purpose of this project is to allow you to learn the basic knowledge of DeTR. P

Jianhua Yang 11 Jun 13, 2022
Paddle2.x version AI-Writer

Paddle2.x 版本AI-Writer 用魔改 GPT 生成网文。Tuned GPT for novel generation.

yujun 74 Jan 4, 2023