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.

how to enter If cases in COMSOL

Please login with a confirmed email address before reporting spam

Some parameters vary with respect to temperature. Is it possible to enter such things in comsol, Kindly do help.

eg:
if(T(j,1)<800)
A=31.995;
B=11.54;
C=41.322;
D=37.6127;

elseif (T(j,1)>=800 && T(j,1)<1025)
A= 94.7509;
B= 0;
C= 72.1439;
D= 0;
elseif (T(j,1)>=1025 && T(j,1)<1175)
A= -439.488;
B= 0;
C= 835.878;
D=377.668;
else (T(j,1)>=1175 && T(j,1)<1500)
A=-22.6774;
B=0;
C=57.1977;
D=16.5732;
end
Kfe=A+((B*1000)/T(j,1))+((C*T(j,1))/1000)+(D*(T(j,1)^2))/(10^6);

1 Reply Last Post 21 juin 2016, 16:43 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 21 juin 2016, 16:43 UTC−4
Well, one way is:

A = 31.995 + (T(j,1)>=800)*(94.7509-31.995) + (T(j,1)>=1025)*(-439.488 - 94.7509) + (T(j,1)>=1175)*(-22.6774 - -439.488)

Etc.

Well, one way is: A = 31.995 + (T(j,1)>=800)*(94.7509-31.995) + (T(j,1)>=1025)*(-439.488 - 94.7509) + (T(j,1)>=1175)*(-22.6774 - -439.488) Etc.

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.