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.

Boolean expression error in variable.

Please login with a confirmed email address before reporting spam

dear all,

i have a boolean logic expression,

if t >= 0, t < 0.2
F = 1./(1+exp(-140*(t-0.08)))
if t >= 0.2 and t< 1
F = 1./(1+exp(60.61*(t-0.35)))


when i use below boolean expression in the variable, it end up that the the two statement is added up and the maximum y magnitude jump to 2, while when i use matlab, it is 1.

(t>=0)*(1/(1+exp(-140*(t[s]-0.08))))+(t>0 && t<0.2)*(1/(1+exp(-140*(t[s]-0.08))))+(t>=0.2&&t<1)*(1/(1+exp(60.61*(t[s]-0.35))))

can someone give me some me some help or hint where i make the mistake?

Thank you.

1 Reply Last Post Apr 2, 2012, 12:51 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 2, 2012, 12:51 p.m. EDT

(t>=0)*(1/(1+exp(-140*(t[s]-0.08))))+(t>0 && t<0.2)*(1/(1+exp(-140*(t[s]-0.08))))+(t>=0.2&&t<1)*(1/(1+exp(60.61*(t[s]-0.35))))


shouldn't the first term be for t<=0?
[QUOTE] (t>=0)*(1/(1+exp(-140*(t[s]-0.08))))+(t>0 && t=0.2&&t

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.