Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Problem with exponents in Comsol 4.4

Please login with a confirmed email address before reporting spam

Hello everybody

I would like to give following equation in COMSOL 4a as a variable:

rNO=-A*exp(-Ea/(R*T))*cNO^0.71
where cNO is given in mol/m^3, but I want it to be unitless.

How can I do it? It seems that COMSOL does not accept it, as it has problems with the units.
I have tried using exp and log:
rNO=-A*exp(-Ea/(R*T))*exp(0.71*log(cNO))

But it gives several errors:
Attempt to evaluate real logarithm of negative number.
- Function: log
Failed to evaluate variable.
- Variable: comp1.r_NO
- Defined as: ((exp(((-Ea)/(T*R)))*(-A))*exp((0.70999999999999996*log(comp1.cNO))))
Failed to evaluate variable.
- Variable: comp1.chds.R_cN2
- Defined as: (-comp1.r_NO)
Failed to evaluate variable.
- Variable: comp1.chds.Res_cN2
- Defined as: (((comp1.cN2r*comp1.chds.u)+(comp1.chds.w*comp1.cN2z))-comp1.chds.R_cN2)
Failed to evaluate expression.
- Expression: abs(comp1.chds.Res_cN2)
Failed to evaluate expression.
- Expression: nojac(((1.4142135623730951^(1-shapeorder(comp1.cN2)))*max((((((abs(comp1.chds.Res_cN2)*0.5)*comp1.chds.xicwd_cN2)*sqrt(comp1.chds.gcgijgc_cN2))/((sqrt(eps)*(h^2))+comp1.chds.gcgijgc_cN2))-(((comp1.chds.Res_cN2^2)*comp1.chds.tauMassCr_cN2)/(eps+comp1.chds.gcgijgc_cN2))),0)))
Failed to evaluate variable.
- Variable: comp1.chds.nuh_cN2
- Defined as: nojac(((1.4142135623730951^(1-shapeorder(comp1.cN2)))*max((((((abs(comp1.chds.Res_cN2)*0.5)*comp1.chds.xicwd_cN2)*sqrt(comp1.chds.gcgijgc_cN2))/((sqrt(eps)*(h^2))+comp1.chds.gcgijgc_cN2))-(((comp1.chds.Res_cN2^2)*comp1.chds.tauMassCr_cN2)/(eps+comp1.chds.gcgijgc_cN2))),0)))
Failed to evaluate temporary symbolic derivative variable.
- Variable: comp1.chds.crosswind@VDN${test@8}
- Defined as: (-(((comp1.cN2z*comp1.chds.gijrz)+(comp1.cN2r*comp1.chds.gijrr))*comp1.chds.nuh_cN2))
Failed to evaluate expression.
- Expression: d((2*comp1.chds.crosswind*pi*r)*(dvol),{test@8})

Best regards

Unai De La Torre

1 Reply Last Post 30 gen 2014, 07:17 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 30 gen 2014, 07:17 GMT-5
Hi,

You can use following procedure to make variable unitless.

rNO=-A*exp(-Ea/(R*T))*(cNO[m^3/mol])^0.71

Best regads

Tero Hietanen
Hi, You can use following procedure to make variable unitless. rNO=-A*exp(-Ea/(R*T))*(cNO[m^3/mol])^0.71 Best regads Tero Hietanen

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.