Векторы выглядят так:
Код: Выделить всё
'O2 ','N2 ','H2O ','CO2 ','NH3 ','CH4 ','CO ','H2 ','H2S '
0.0000002 0.5 0.02 0.47 0.000000001 0.01 0.001 0.0001 3.13e-5
Код: Выделить всё
...
H2 33.19 1.313 -0.216
H2O 647.096 22.064 0.3449
H2O2 730.155 21.7 .358233
H2S 373.53 8.963 0.0942
H3N 405.65 11.28 0.2526
NH3 405.65 11.28 0.2526
H4N2 653.15 14.7 0.3143
HCN 456.65 5.39 0.4099
HNO3 520 6.8901 .714406
He 5.2 0.2275 -0.39
NO 180.15 6.48 0.5829
NO2 431.15 10.1325 .851088
N2 126.2 3.4 0.0377
N2O 309.57 7.245 0.1409
Ne 44.4 2.653 -0.0396
O2 154.58 5.043 0.0222
...
Код: Выделить всё
q = size(n);
if q(1)>q(2)
n=n';
end
for q = 1:length(names) % For each species passed.
index(q) = searchDataB(names(q)); % Get the index in the database of the species
if index(q) == -1 % If the species isn't there, throw an exception.
throw(MException('Catling:missingSpecies',['Species ' names{q} ' is missing from the database.']))
end
%disp(['Using species: ' names(q)]) % Display which species are being used.
Однако когда я запускаю этот код, вызывая его из Python, я получаю сообщение об ошибке
Код: Выделить всё
Species N2 is missing from the database.
Error in Gibbs_energy_minimization>totalGibbsInternal (line 137)
lnPhi = fugCoef(T,P,onlyPhase(1,names),onlyPhase(1,n'));
Error in Gibbs_energy_minimization (line 69)
G1=totalGibbsInternal(n_true); % Calculate the total Gibbs energy of the true initial state.
Error in Main_script_iterate (line 27)
vals=[vals; n Gibbs_energy_minimization(n')]; % run the Gibbs energy minimization routine and store the output in the vals array
Traceback (most recent call last):
File "/home/tessa/Alien Earths/phi_calc/phi calc.py", line 181, in
phi=eng.Main_script_iterate()
File "/usr/local/lib/python3.10/dist-packages/matlab/engine/matlabengine.py", line 71, in __call__
_stderr, feval=True).result()
File "/usr/local/lib/python3.10/dist-packages/matlab/engine/futureresult.py", line 62, in result
return self.__future.result(timeout)
File "/usr/local/lib/python3.10/dist-packages/matlab/engine/fevalfuture.py", line 76, in result
self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.MatlabExecutionError:
File /home/tessa/Alien Earths/phi_calc/Multiphase_disequilibrium/fugCoef.m, line 32, in fugCoef
File /home/tessa/Alien Earths/phi_calc/Multiphase_disequilibrium/Gibbs_energy_minimization.m, line 137, in totalGibbsInternal
File /home/tessa/Alien Earths/phi_calc/Multiphase_disequilibrium/Gibbs_energy_minimization.m, line 69, in Gibbs_energy_minimization
File /home/tessa/Alien Earths/phi_calc/Multiphase_disequilibrium/Main_script_iterate.m, line 27, in Main_script_iterate
Species N2 is missing from the database.
Есть идеи, почему скрипт не может найти эти конкретные химические вещества в базе данных?
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/788 ... base-entry
Мобильная версия