{ "info": { "author": "Gabriel S. Gusmao", "author_email": "gusmaogabriels@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==============\r\n**mkin4py** \r\n==============\r\n\r\n*mkin(microkinetics) 4 py(thon)*\r\n\r\n|star| |watch| |fork| |github|\r\n\r\n.. image:: https://img.shields.io/pypi/l/mkin4py.svg\r\n :height: 100px\r\n :width: 200 px\r\n :scale: 50 %\r\n :alt: alternate text\r\n :align: right\r\n\r\n.. image:: https://img.shields.io/pypi/v/mkin4py.svg\r\n :height: 100px\r\n :width: 200 px\r\n :scale: 50 %\r\n :alt: alternate text\r\n :align: right\r\n\r\nA package for linearly defining and solving micr\r\nokinetic catalytic systems.\r\n\r\n----------------\r\n**Description**\r\n----------------\r\n\r\n A microkinetic package translated from the Linearized Microkinetic Catalytic System Solver\r\n\r\n By the author:\r\n\r\n *Gabriel S. Gusm\u00e3o* \r\n \r\n |ld|\r\n\r\n |rg|\r\n \r\n under *Dr. Phillip Christopher* advisement.\r\n\r\n For detailed information, refer to code comments or associated publication.\r\n Gusm\u00e3o, G. S. & Christopher, P., **A general and robust approach for defining and solving \r\n microkinetic catalytic systems.** AIChE J. 00, (2014).; http://dx.doi.org/10.1002/aic.14627\r\n\r\n The 17-Step Ethylene Epoxidation by Stegelmann et al. has been used as example.\r\n Stegelmann, C., Schi\u00f8dt, N. C., Campbell, C. T. & Stoltze, P.\r\n **Microkinetic modeling of ethylene oxidation over silver**. J. Catal. 221, 630\u2013649 (2004).\r\n\r\n 1. Set-up the environment conditions (temperature, pressure, gas constant)\r\n 2. Create a MK (microkinetic model object)\r\n - Define its dimensions: number of reactants (rows) and elementary reactions (columns) involved in the stoichiometry matrix, and parse the rows that refer to *free*-species (non-adsorbed)\r\n - Parse the stoichiometry matrix (must be of size number of reactants \u00d7 number of elementary reactions)\r\n - Set the kinetic parameters: Activation Energies and Pre-exponential factors (must be of the size of the involved elementary reactions)\r\n - Set the fixed concentration of *free*-species (molar fraction in non-adsorbed phase)\r\n - Parse the string-labels of involved species (array of size of number of species) \r\n 3. Solve the ensuing LP (linear problem)\r\n - For now, there is only a *Newton*-type method available.\r\n - Standard iterative-procedure adopted for solving the inner-loop LP (Quasi-minimum residue)\r\n\r\n The convergence parameters are set as default in the module `solver` in `.params`\r\n\r\n----------------\r\n**Features**\r\n----------------\r\n\r\n - **Linearization**\r\n\r\n The project makes use of explicit routines for the calculation of the MK model derivatives\r\n \r\n - *Jacobian*: Available as standard.\r\n - *Hessian*: Used in the convex two-step method (details in the aforementioned reference)\r\n\r\n----------------\r\n**On the way**\r\n----------------\r\n\r\n 1. Additional LP solvers in \"switchable\" fashion.\r\n 2. Evolutionary methods for the definition of best convergence parameters for *stiff* problems (when TOF`s are close to the machine precision)\r\n\r\n----------------\r\n**Instructions**\r\n----------------\r\n\r\n - **Installation**\r\n\r\n .. code-block:: python\r\n\r\n pip install mkin4py==version_no\r\n\r\n - **Example**: Stoltze's 17-Step Ethylene Epoxidation MK system\r\n\r\n .. code-block:: python\r\n\r\n import mkin4py\r\n import numpy as np\r\n \r\n # Environment Conditions\r\n T = 500; #K\r\n P = 2; #bar\r\n gas_constant = 8.31456e-3 # Gas Constant - kJ/(mol\u00d7K)\r\n \r\n # Set the environment conditions\r\n mkin4py.environment.set_temperature(T)\r\n mkin4py.environment.set_gas_constant(gas_constant)\r\n mkin4py.environment. set_pressure(P)\r\n \r\n # Stoichiometric Matrix\r\n ms = [\r\n [-1, 1, 0, 0,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 2,-2, 0, 0,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 1,-1,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 0, 0, 1,-1, 0, 0,-1, 1,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,-1, 1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,-1,-1, 1,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,-1,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0],\\\r\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,-1,-1, 1, 0, 0, 0, 0, 0, 0],\\\r\n ];\r\n \r\n nreac = [0, 1] # Reactant Rows in mS\r\n nprod = [2, 3, 4, 5] # Product Rows in mS\r\n stoichs = np.concatenate((nreac,nprod)) # Reactants and Products are not under PSSH\r\n mkin4py.mkmodel.create(np.shape(ms)[0],np.shape(ms)[1],stoichs) # Initialize the model\r\n mkin4py.mkmodel.set_ms(ms) # Set the stoichiometry matrix\r\n \r\n # Species labels \r\n splabels = ['O2','C2H4','C2H4O','CH3CHO','CO2','H2O','*','O2*','O*','OH*',\\\r\n 'H2O*','CO2*','C2H4*','O\u00b7O*','C2H4\u00b7O*','CH2CH2O\u00b7O*','C2H4O\u00b7O*','CH3CHO\u00b7O*',\\\r\n 'CH2CHOH\u00b7O*','CH2CHO\u00b7O*']\r\n \r\n mkin4py.mkmodel.set_splabels(splabels) # Set species labels\r\n \r\n # Pre-exponential Factors of Eelementary Reactions (1/s)\r\n va =[2.71e5, 1.1e12, 4.0e12, 8.0e14, 2.0e7, 1.3e15, 7.2e7,\\\r\n 2.2e11, 9.0e14, 5.3e14, 1.95e8, 4.8e12, 1.13e13, 2.11e12,\\\r\n 9.0e12, 4.5e10, 2.9e13, 2.6e9, 2.0e20, 5.3e13, 7.2e7, 2.2e11,\\\r\n 4.0e11, 3.1e14, 2.6e13, 1.3e9, 1.0e20, 5.5e13, 1.4e10, 1.0e11,\\\r\n 3.6e14, 1.0e8, 5.9e14, 1.4e9]\r\n \r\n # Activation Barriers for Elementary ReactionS (kJ/mol)\r\n vea = [5.7000, 47.3000, 75.0000, 157.5000, 20.0000, 96.9000, 0, 37.1000, 112.0000,\\\r\n 183.3000, 0, 39.1000, 95.0000, 93.5000, 95.0000, 204.3000, 41.9000, 4.4000,\\\r\n 11.0000, 791.6000, 0, 30.1000, 32.0000, 42.8000, 86.0000, 106.1000, 0, 906.6000,\\\r\n 65.6000, 50.0000, 38.9000, 0, 46.6000, 0]\r\n \r\n # Set the kinetic parameters\r\n mkin4py.mkmodel.set_kinetic_params(np.array(va,ndmin=2).T,np.array(vea,ndmin=2).T)\r\n \r\n y = [0.5, 0.5, 0, 0, 0, 0] # Reactants and Products Initial Fraction\r\n mkin4py.mkmodel.set_concentrations(y) # Set the *free*-species concentrations\r\n \r\n - **Evaluation**:\r\n \r\n .. code-block:: python\r\n\r\n sol = mkin4py.solver.solve.rk4() # 4th-order Runge-Kutta method coupled within the LP solved via QMR\r\n # Outupts\r\n print '...'\r\n print sol['msg'], 'time: ', sol['time']\r\n print 'Coverage'\r\n print sol['coverage']\r\n print 'Rates'\r\n print sol['rates']\r\n\r\n - **Output**:\r\n\r\n .. code-block:: python\r\n\r\n ...\r\n Convergence achieved time: 2.25999999046\r\n Coverage\r\n [[ 5.00000000e-01]\r\n [ 5.00000000e-01]\r\n [ 0.00000000e+00]\r\n [ 0.00000000e+00]\r\n [ 0.00000000e+00]\r\n [ 0.00000000e+00]\r\n [ 4.39342950e-01]\r\n [ 1.19743307e-03]\r\n [ 1.07992516e-01]\r\n [ 1.10447591e-01]\r\n [ 2.99730332e-09]\r\n [ 7.70711567e-10]\r\n [ 1.00256049e-01]\r\n [ 9.78269843e-02]\r\n [ 1.32727193e-01]\r\n [ 9.64368428e-03]\r\n [ 3.28419897e-08]\r\n [ 4.59118359e-13]\r\n [ 5.65562897e-04]\r\n [ 1.12150752e-15]]\r\n Rates\r\n [[ -4.24252190e+01]\r\n [ -2.49532633e+01]\r\n [ 1.29732696e+01]\r\n [ 5.58723011e-04]\r\n [ 2.39588699e+01]\r\n [ 2.39588699e+01]\r\n [ 0.00000000e+00]\r\n [ 3.65929509e-13]\r\n [ 0.00000000e+00]\r\n [ 4.32857086e-11]\r\n [ 2.76796815e-16]\r\n [ 2.87485591e-11]\r\n [ 0.00000000e+00]\r\n [ -2.27373675e-13]\r\n [ -4.65661287e-10]\r\n [ 9.86479981e-16]\r\n [ 0.00000000e+00]\r\n [ -1.60491195e-13]\r\n [ 4.65661287e-10]\r\n [ -1.42115222e-11]]\r\n\r\n.. |github| image:: https://img.shields.io/github/followers/gusmaogabriels.svg?style=social&label=Follow\r\n :scale: 25%\r\n :target: https://github.com/gusmaogabriels\r\n\r\n.. |fork| image:: https://img.shields.io/github/forks/gusmaogabriels/mkin4py.svg?style=social&label=Fork\r\n :scale: 25%\r\n :target: https://github.com/gusmaogabriels/mkin4py/fork\r\n\r\n.. |star| image:: https://img.shields.io/github/stars/gusmaogabriels/mkin4py.svg?style=social&label=Star\r\n :scale: 25%\r\n :target: https://github.com/gusmaogabriels/mkin4py/stargazers\r\n\r\n.. |watch| image:: https://img.shields.io/github/watchers/gusmaogabriels/mkin4py.svg?style=social&label=Watch\r\n :scale: 25%\r\n :target: https://github.com/gusmaogabriels/mkin4py/watchers\r\n\r\n.. |rg| image:: https://www.researchgate.net/images/public/profile_share_badge.png\r\n :height: 55 px\r\n :width: 166 px\r\n :scale: 30 %\r\n :target: https://www.researchgate.net/profile/Gabriel_Gusmao?cp=shp\r\n\r\n.. |ld| image:: https://static.licdn.com/scds/common/u/img/webpromo/btn_viewmy_160x25.png\r\n :height: 25 px\r\n :width: 160 px\r\n :scale: 50 %\r\n :target: https://br.linkedin.com/pub/gabriel-saben%C3%A7a-gusm%C3%A3o/115/aa6/aa8", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/gusmaogabriels/mkin4py/tarball/v1.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gusmaogabriels/mkin4py", "keywords": "python,microkinetics,linearized,solver,chemical,kinetics,power-law", "license": "The MIT License (MIT)", "maintainer": "Gabriel Saben\u00e7a Gusm\u00e3o", "maintainer_email": "gusmaogabriels@gmail.com", "name": "mkin4py", "package_url": "https://pypi.org/project/mkin4py/", "platform": "Python v2.7+", "project_url": "https://pypi.org/project/mkin4py/", "project_urls": { "Download": "https://github.com/gusmaogabriels/mkin4py/tarball/v1.0", "Homepage": "https://github.com/gusmaogabriels/mkin4py" }, "release_url": "https://pypi.org/project/mkin4py/1.0/", "requires_dist": null, "requires_python": null, "summary": "A package for linearly defining and solving microkinetic catalytic systems.", "version": "1.0" }, "last_serial": 2138466, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "7a0837139f7e8b9ef343d0897f6793a1", "sha256": "8350846a01c703419a9e27b3fc7477ffdff43dd96d8f7b13ac3b660295d45082" }, "downloads": -1, "filename": "mkin4py-1.0.zip", "has_sig": false, "md5_digest": "7a0837139f7e8b9ef343d0897f6793a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8815, "upload_time": "2015-10-27T23:28:49", "url": "https://files.pythonhosted.org/packages/a6/be/572df364d86241e2b1adaab20172bee58f62e0d2040cfa6ea034a15a2af3/mkin4py-1.0.zip" } ], "v1.0": [] }, "urls": [ { "comment_text": "", "digests": { "md5": "7a0837139f7e8b9ef343d0897f6793a1", "sha256": "8350846a01c703419a9e27b3fc7477ffdff43dd96d8f7b13ac3b660295d45082" }, "downloads": -1, "filename": "mkin4py-1.0.zip", "has_sig": false, "md5_digest": "7a0837139f7e8b9ef343d0897f6793a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8815, "upload_time": "2015-10-27T23:28:49", "url": "https://files.pythonhosted.org/packages/a6/be/572df364d86241e2b1adaab20172bee58f62e0d2040cfa6ea034a15a2af3/mkin4py-1.0.zip" } ] }