Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

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 view (last 30 days)
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 Comments
Stephen23
Stephen23 on 17 Sep 2018
Edited: Stephen23 on 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 on 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!

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!