Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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 visualizzazione (ultimi 30 giorni)
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 Commenti
Stephen23
Stephen23 il 17 Set 2018
Modificato: Stephen23 il 17 Set 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 il 17 Set 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!

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by