Compute a limit in two-dimensions

3 views (last 30 days)
Sergio Manzetti
Sergio Manzetti on 25 Nov 2017
Edited: John D'Errico on 25 Nov 2017
Hi, I am trying to calculate the limit of a function f(x,t):
syms h g x C t
h = 4
g = 3
C = 1
f(x,t) = (C*e^x + (g.*x)/2.*h.*1i)).*e.^(i.*g.*t);
limit(f(x,t), t, inf, Real);
however this does not work and the error is "Unexpected MATLAB operator".
It is formulated as given on https://se.mathworks.com/help/symbolic/limit.html nevertheless, something is wrong.
Can anyone suggest a solution?
Thanks

Answers (1)

John D'Errico
John D'Errico on 25 Nov 2017
Multiple issues here.
syms h g x C t
h = 4
g = 3
C = 1
People think they have created avariable like Cas symbolic, but then when you do
C = 1
that completely overrides the sym. C is now just a double, no longer symbolic.
As you can see,
whos x C
Name Size Bytes Class Attributes
C 1x1 8 double
x 1x1 8 sym
MATLAB sees X as a sym, but C is just a double.
Next, this is invalid MATLAB syntax.
f(x,t) = (C - (exp(-2.*g.*1i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*1i)).*e.^(i.*h//2.*t./h);
See that double / (thus a //) towards the end? NOT valid.
Next.
f = (C - (exp(-2.*g.*1i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*1i)).*e.^(i.*h/2.*t./h);
Undefined function or variable 'e'.
You never defined e. I assume that you intended exp as a function. But why you would know enough to use exp in the beginning of that line, but not at the end????
Ok, I'll fix that too.
f(x,t) = (C - (exp(-2.*g.*1i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*1i)).*exp(i.*h/2.*t./h);
Lets take a look at f.
pretty(f)
/ t 1i \ / / x 3i \ \
-exp| ---- | | exp| - ---- | (x 6i - 8 cos(x) + 1) - 1 |
\ 2 / \ \ 2 / /
So f is a simple product of two terms.
Do you want to compute this limit as t approaches inf? What value does x take on? You talk about a limit in two dimensions.
Start with the exp(t*i/2) term. We can write that as
exp(t*i/2) = cos(t/2) + i*sin(t/2)
There is no limit of that as t--> inf.
So your question has no answer. You cannot take that limit. Well, you can. But it will yield garbage.
  2 Comments
Sergio Manzetti
Sergio Manzetti on 25 Nov 2017
Edited: Sergio Manzetti on 25 Nov 2017
Thanks John. The entire clarification was helpful, although there were several errors in the original f(x,t) given. I'd like to simplify it to:
f(x,t) = exp^t*e^x
If I want to try the limit of this, as t goes to infinity and x goes towards zero, does it simply look like:
limit(f(x,t), t, inf, x, o);
?
Thanks!
John D'Errico
John D'Errico on 25 Nov 2017
Edited: John D'Errico on 25 Nov 2017
NO NO NO. I knew this was a question I should have left alone. This comes down to you needing to understand both limits, as well as complex variables, probably some multivariate calculus. So you need to review those areas of mathematics. I'm going to simplify things here.
This does NOT reduce to what you show. It reduces to a complex variables expression.
exp(t) is NOT the same animal as exp(i*t). You can expand
exp(i*t) = cos(t) + i*sin(t)
A basic law there. If you don't believe me, PLOT IT!
ezplot(@(t) real(exp(i*t)))
hold on
ezplot(@(t) imag(exp(i*t)))
As you can see, exp(i*t) is a function that takes on complex values, that oscillate with t. It does not go to inf or zero. It varies periodically FOREVER. There is no limit possible here.
Next, the x part is not exp(x), but an exponential of a complex variable.
Next, when you have TWO variables, what matters is along which path you follow to get to that limit.
This is the reason why people never seem to understand why 0/0 has no value that can be assigned, because they don't understand how things work. Call 0/0 the limit of x/y, as both x and y approach zero.
For example, if we think of 0/0 the limit of 0/y, as y approaches 0? In that case, 0/0 must arguably have a limit of 0.
Or is it that 0/0 is the limit of x/0, as x approaches zero? In that case we can make an argument that 0/0==inf.
Or, is it the limit as we follow the path where x==y? In that case, 0/0 is arguably 1.
Or, is it the limit along the path x==k*y? In that case, the limit of x/y would arguably be 1/k, for any value you choose for k.
How about the limit along the path y==x^2? Then the limit would be inf. But along the path x==y^2, the limit would be 0.
The point is, the path you take to approach that limit matters. ONLY if the limits exists along every path, and the limit is the same along every such path to the limit point can we say that the limit exists. In the end, your problem has no limit as posed. I'd suggest you spend some time reviewing a few areas of mathematics.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!