# Discussion Forum

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
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??

Please login with a confirmed email address before reporting spam

Posted: 8 years ago
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
I tried with : exp(1/(Tg-T))

but the answer was infinity...

Please login with a confirmed email address before reporting spam

Posted: 8 years ago
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
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

Please login with a confirmed email address before reporting spam

Posted: 8 years ago
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
Thank you!!!!

I've solved that problem.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago
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
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

Please login with a confirmed email address before reporting spam

Posted: 8 years ago
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