Message Boards Message Boards

0
|
1900 Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Taking a limit inside a function and graphing it

Posted 10 years ago
Hello, thank you for your time.

I am trying to graph the following function:
f[x_] := 1/(Exp[(x-u)/(k*T)]+1);
Plot[f[x_],{x,0,1}]

I tried doing the above while setting T=0, but quickly learned that wouldn't work.   So I tried the following:
f[x_] := 1/(Limit[Exp[(x-u)/(k*T)],T->0]+1);
Then I tried to use the same plot.  This gave me no errors but now unfortunately nothing is showing up on my graph.  It should look like a step-function, where f(x) = 1 until x=u, then at that point f(x)=0 the rest of the way.

Any help is appreciated, thank you!
6 Replies
I actually got it working. I had to make f a function of x and T, like this:
f[x_,T_]...
Manipulate[Plot[f(x,T)......]
AHA got it! Its because I was using Plot[f[x_]]... I should have been using Plot[f]

Thanks everyone!

I do have one more question.  What If I want to use
Manipulate[Plot[f(x)],{x,0,10},{T,0,300}]
Will this work?  Because I am trying just that and it doesnt seem to be working
Bill, thank you so much for the sample!  Maybe I am doing something wrong, but it is still not working.  Here is the entirety of the code:
k=8.617*10^(-5);
In[1]:=u=5.49;
x=0;
f(x_):=1/(Limit[Exp[(x-u)/(k*T)],T->0]+1);
plot[f[x_],{x,0,10},AxesOrigin->{0,-.1}]
 
When I compile, nothing shows up on the graph
Posted 10 years ago
In[1]:= u = 5;
k = 10^-5;
f[x_] := 1/(Limit[Exp[(x - u)/(k*T)], T -> 0] + 1);
Plot[f[x], {x, 0, 10}, AxesOrigin -> {0, -.1}]

Out[4]= ...PlotSnipped...
POSTED BY: Bill Simpson
Hi thanks for the response.  I do have values for these constants. u=5, k=10^(-5), but T is approaching zero.
Need numerical values for u, k, T to plot a function of x. Possibly introduce ranges of values using Manipulate, In Plot, should have f not f[x_]. Sometimes missing plot region can be revealed by adding PlotRange->All.
POSTED BY: S M Blinder
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract