Simple question about symbolic limits

2 次查看(过去 30 天)
Hello,
I am checking results derived by hand in a MATLAB (2019a) live script and have encountered the following problem (MWE below): When I try to take the limit of the expression as (symbolic) variable l approaches 0, restricting , MATLAB cannot find the limit I obtain by hand. However, when I choose arbitrary values for instead of using an assumption, I get the same limit I derived by hand (which is independent of c). I suspect there is an obvious explanation for this that I am overlooking.
MWE:
%Declare symbolic variables:
syms l real;
syms t real; assumeAlso(t>1);
syms a real; assumeAlso(0<a<1);
syms p real; assumeAlso(0<p<1);
syms e real; assumeAlso(e>0);
syms c real; assumeAlso(c>0);
syms w real; assumeAlso(0<w<1);
%Functions:
phi = e/(1+c)*l^(1+c);
z = t/l*(1-exp(-l/t));
n = p*(1+c)/(p*(1+c)+z*l/phi*w);
pn = t*p*(1-n)*exp(-l/t)/n*(1-exp(-1*(t*p*(1-n)*exp(-l/t)/(a*n))^(-1)));
%Limits:
limit(pn,l,0,'right')
MATLAB cannot reduce this limit. However, when I instead impose, e.g., , via
syms l real;
syms t real; assumeAlso(t>1);
syms a real; assumeAlso(0<a<1);
syms p real; assumeAlso(0<p<1);
syms e real; assumeAlso(e>0);
syms c real; assumeAlso(c>0);
syms w real; assumeAlso(0<w<1);
%Functions:
phi = e/(1+0.1)*l^(1+0.1);
z = t/l*(1-exp(-l/t));
n = p*(1+0.1)/(p*(1+0.1)+z*l/phi*w);
pn = t*p*(1-n)*exp(-l/t)/n*(1-exp(-1*(t*p*(1-n)*exp(-l/t)/(a*n))^(-1)));
%Limits:
limit(pn,l,0,'right')
I get the result I derived by hand. The same holds for seemingly all other positive values of c. Any idea what I'm overlooking?
Thanks in advance.

回答(1 个)

Ayush Gupta
Ayush Gupta 2020-6-12
The limit specified is also dependent on c if c does not have small values. For small values of c, a simplified expression is yielded. Refer to the following link to know more about limit:
  1 个评论
Tristan Potter
Tristan Potter 2020-6-13
编辑:Tristan Potter 2020-6-13
Thanks for your response. However, I don't see that this resolves the issue for several reasons:
1) I don't see the dependence on c in a manual derivation of the limit via L'Hopital's rule (the limit I obtain manually corresponds to what MATLAB gives when I use a particular value of c, so I don't think I'm making a mistake in the manual derivation).
2) If I substitute the expression for n into the expression for above, I obtain:
pn = (t^2*(w-b)/e*exp(-l/t)*(1-exp(-l/t))/l^(c+1)*exp(-a/t*exp(-l*z)/exp(-l/t))*(1-exp(-a*(t^2*(w-b)/e*exp(-l/t)*(1-exp(-l/t))/l^(c+1))^(-1)));
When I evaluate this limit, seemingly any value of c gives the same limit that I get when I do the derivation manually. For example, I can choose and I get the same answer.
3) Finally, I tried writing where and applying L'Hopital's rule manually by taking the derivative of the numerator and denominator. I then used MATLAB to take the limit of the resulting ratio of the derivatives. When I simplify the ratio of derivatives and take the limit in MATLAB, I get the same result that I get manually. When I don't simplify, the problem remains:
n0 = 1-exp(-a*(t^2*(w-b)/e*exp(-l/t)*(1-exp(-l/t))/l^(c+1))^(-1));
d0 = 1/(t^2*(w-b)/e*exp(-l/t)*(1-exp(-l/t))/l^(c+1));
n1 = diff(n0,l);
d1 = diff(d0,l);
limit(n1/d1,l,0,'right')
limit(simplify(n1/d1),l,0,'right')
Am I missing something?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by