How to run Cantera with Matlab

Hello,
I am trying to use Cantera with Matlab to solve a chemical recation problem. However, I can't get the Cantera examples to work in matlab.
Such as,
clear;
clc;
help equil;
if nargin == 1
gas = g;
else
gas = IdealGasMix('gri30.cti');
end
nsp = nSpecies(gas);
phi = [];
Matlab gives me an error when i try to use IdealGasMix('gri30.cti'). I've added the Cantera toolbox to the subfolders and followed the installation instructions on the Cantera website but can't seem to solve this issue.
Any advice?

6 Kommentare

Githin John
Githin John am 27 Jan. 2020
What is the error you get regarding IdealGasMix?
Walter Roberson
Walter Roberson am 27 Jan. 2020
nargin cannot be used with scripts in any recent version of MATLAB -- not since 2013 or so.
If this is part of a function, then there should not be any clear call in it.
Jordan Ruffner
Jordan Ruffner am 27 Jan. 2020
This is the error that populates when I try to run the code, attachedmatlab_error.png
Walter Roberson
Walter Roberson am 27 Jan. 2020
It cannot find cantera.py
Jordan Ruffner
Jordan Ruffner am 27 Jan. 2020
Do you know how I can go about mapping it correctly so it can find Cantera?
Walter Roberson
Walter Roberson am 27 Jan. 2020
https://www.mathworks.com/matlabcentral/fileexchange/62703-py_addpath-directory-matlab_too

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Chemistry finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 24 Jan. 2020

Kommentiert:

am 27 Jan. 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by