Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

I am using the element names as symbolic variables to make the answer look nice. Why will it not perform the function when my equivalence ratio is more than one?

1 Ansicht (letzte 30 Tage)
if phi > 1
N_rO2 = a/phi;
N_rN2 = a*3.76/phi;
N_CO2 = x/phi;
N_H2O = y/(2*phi);
N_pO2 = 0;
N_pN2 = N_rN2;
N_pfuel = (1 - (1/phi))*fuel;
end
fuel + N_rO2*O2 + N_rN2*N2
disp('<=>')
(N_CO2*CO2)+(N_H2O*H2O)+(N_pO2*O2)+(N_pN2*N2)+(N_pfuel*fuel)
Error using *
Inner matrix dimensions must agree.
Error in ReactantMolFractions (line 59)
(N_CO2*CO2)+(N_H2O*H2O)+(N_pO2*O2)+(N_pN2*N2)+(N_pfuel*fuel)
  2 Kommentare
Stephen23
Stephen23 am 17 Sep. 2018
Bearbeitet: Stephen23 am 17 Sep. 2018
@Elizabeth Browne: I suspect that you need to learn about the differences between matrix operations and array operations:
If any of phi, a, x, y, etc. are non-scalar, then probably none of your * and / operations are actually doing what you think they are doing. But because your code contains no comments or explanation, this is just a guess.
Elizabeth Browne
Elizabeth Browne am 17 Sep. 2018
I am sure I need to learn more. I am a newbie, but I figured out which variable was not a scalar.
I appreciate the quick response though! I struggled with this for quite awhile before asking for help. Funny that as soon as I asked I figured it out.
Thank you!

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by