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.

exponential function error

Please login with a confirmed email address before reporting spam

Hello~

In global definition>funtions

I defined the function : exp(-1/(T-Tg)) , T was arguments.

At T=Tg, the exponential value should be zero but it was infinity.

can anybody help??


11 Replies Last Post Nov 16, 2011, 7:35 AM EST

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 8:21 AM EDT
Hi,

If you approach Tg from the left, i.e. is T is almost Tg but slightly less, then the function goes to +infinity (just try to solve the limit, the exponent wil go to +infinity), if you approach Tg from the right then it goes to zero (the exponent goes to -infinity) at the limit never really reaching zero.


Hello~

In global definition>funtions

I defined the function : exp(-1/(T-Tg)) , T was arguments.

At T=Tg, the exponential value should be zero but it was infinity.

can anybody help??


Hi, If you approach Tg from the left, i.e. is T is almost Tg but slightly less, then the function goes to +infinity (just try to solve the limit, the exponent wil go to +infinity), if you approach Tg from the right then it goes to zero (the exponent goes to -infinity) at the limit never really reaching zero. [QUOTE] Hello~ In global definition>funtions I defined the function : exp(-1/(T-Tg)) , T was arguments. At T=Tg, the exponential value should be zero but it was infinity. can anybody help?? [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 8:28 AM EDT
Dear am fa thank you for replying.

I understood your comment but, how can i treat that function to be zero?

Is there any limit operator in comsol?
Dear am fa thank you for replying. I understood your comment but, how can i treat that function to be zero? Is there any limit operator in comsol?

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 8:36 AM EDT
I tried with : exp(1/(Tg-T))

but the answer was infinity...

I tried with : exp(1/(Tg-T)) but the answer was infinity...

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 9:51 AM EDT
Hi,

The value becomes 0 or infinity depending on from which side you approach it. You are probably plotting a range that includes values on both sides of Tg.

Plotting exp(-1/(5-x)), for example, from 0 to 5, shows that the value approaches 0 "from the left." Plotting this function from 0 to 10, for example, means that you pass the singularity at 5, and an infinite value (or rather numerically very large number) makes the plot appear irregular.

Best regards,
Magnus Ringh, COMSOL
Hi, The value becomes 0 or infinity depending on from which side you approach it. You are probably plotting a range that includes values on both sides of Tg. Plotting exp(-1/(5-x)), for example, from 0 to 5, shows that the value approaches 0 "from the left." Plotting this function from 0 to 10, for example, means that you pass the singularity at 5, and an infinite value (or rather numerically very large number) makes the plot appear irregular. Best regards, Magnus Ringh, COMSOL

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 10:05 AM EDT
Hi,

you might consider a step-by-step definition to avoid the singularity:

f(T) = 0 for abs(T-Tg) < some very small value

Regards
Edgar
Hi, you might consider a step-by-step definition to avoid the singularity: f(T) = 0 for abs(T-Tg) < some very small value Regards Edgar

Nagi Elabbasi Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 10:53 AM EDT
I guess you only want to apply your original function for T > Tg since it behaves strangely for T < Tg (and not just at T = Tg). IF that is true, then set f(T) = 0 for all T< Tg + epsilon (a small value). Even if T never becomes less than Tg at any solution time, during iterations it may and it’s good to have a well behaved function in that case.

Nagi Elabbasi
Veryst Engineering
I guess you only want to apply your original function for T > Tg since it behaves strangely for T < Tg (and not just at T = Tg). IF that is true, then set f(T) = 0 for all T< Tg + epsilon (a small value). Even if T never becomes less than Tg at any solution time, during iterations it may and it’s good to have a well behaved function in that case. Nagi Elabbasi Veryst Engineering

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Mar 31, 2011, 11:57 AM EDT
Thank you!!!!

I've solved that problem.
Thank you!!!! I've solved that problem.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Apr 1, 2011, 3:05 AM EDT
Hi

a usefull "epsilon" or small value is the paameter (internal to COMSOL of "eps", smallest step value you might distinguish from "1" in the used binary numerical representation

--
Good luck
Ivar
Hi a usefull "epsilon" or small value is the paameter (internal to COMSOL of "eps", smallest step value you might distinguish from "1" in the used binary numerical representation -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Oct 14, 2011, 1:52 AM EDT
hii i guess what you wanna solve your equation that's less then and more then values are comparable in system equation original function for T > Tg since it behaves strangely for T < Tg (and not just at T = Tg)


Plotting your exponential function in exp(-1/(5-x)), for example, from 0 to 5, shows that the value approaches 0 "from the left." Plotting this function from 0 to 10 put in to values let - x=0,1,2,3,,,,and shown for more solving equation u can got help with the site here's the link
math.tutorvista.com/calculus/graphing-exponential-functions.html
hii i guess what you wanna solve your equation that's less then and more then values are comparable in system equation original function for T > Tg since it behaves strangely for T < Tg (and not just at T = Tg) Plotting your exponential function in exp(-1/(5-x)), for example, from 0 to 5, shows that the value approaches 0 "from the left." Plotting this function from 0 to 10 put in to values let - x=0,1,2,3,,,,and shown for more solving equation u can got help with the site here's the link http://math.tutorvista.com/calculus/graphing-exponential-functions.html

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 16, 2011, 1:54 AM EST
Help with Pre-Calc homework. Exponential functions?
So, our Pre-calc teacher thinks we are geniouses since we are in a pre calc class-__- so she never really explains us stuff.and doesnt teach the way book teaches.but im scared to come up to her because she's a freaking Gorgon and we got like 14 people left in this class cause they all switched out...anyways.. So here's the problem i cant figure out. You gotta use this exponential formula: y=Pe^rt (to the 'rt' power) .
The word problem: Radium-221 has a half-life of 30 sec. How long will it take for 95% of a sample to decay?
Could anyone please just explain what to put where? would you convert 95% into decimal and use is as P?

Thank you!!
NICK
Help with Pre-Calc homework. Exponential functions? So, our Pre-calc teacher thinks we are geniouses since we are in a pre calc class-__- so she never really explains us stuff.and doesnt teach the way book teaches.but im scared to come up to her because she's a freaking Gorgon and we got like 14 people left in this class cause they all switched out...anyways.. So here's the problem i cant figure out. You gotta use this exponential formula: y=Pe^rt (to the 'rt' power) . The word problem: Radium-221 has a half-life of 30 sec. How long will it take for 95% of a sample to decay? Could anyone please just explain what to put where? would you convert 95% into decimal and use is as P? Thank you!! NICK

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 16, 2011, 7:35 AM EST
the answer is here...: en.wikipedia.org/wiki/Mean_lifetime#Mean_lifetime

looks like you have to find a value for the radium decay constant...

I wouldn't convert 95% into decimals and use it as P...

isolate t...
the answer is here...: http://en.wikipedia.org/wiki/Mean_lifetime#Mean_lifetime looks like you have to find a value for the radium decay constant... I wouldn't convert 95% into decimals and use it as P... isolate 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.