MATLAB: Limit of a symbolic expression

limitsymbolic

Hi,
I am trying to use the limit(expr,x,a) function of MATLAB to find the limit of the ratio of two norms with symbolic variables in them. Like below (I want to get rid of the abs in the solution as well). This is my goal: limit(N,norm(x),0) I am getting this error "The limit variable must be a symbolic variable." I don't understand since N,norm(x) are all symbolic.
N = (abs((49*x3)/50 + (49*x5)/50 + (2000*sin(x3)*x4^2 + 1000*sin(x5)*x6^2 – u + 980*cos(x3)*sin(x3) + 980*cos(x5)*sin(x5))/(100*cos(x3)^2 + 100*cos(x5)^2 – 1200))^2 + abs((49*x3)/500 + (539*x5)/500 + (49*sin(x5))/100 – (cos(x5)*(2000*sin(x3)*x4^2 + 1000*sin(x5)*x6^2 – u + 980*cos(x3)*sin(x3) + 980*cos(x5)*sin(x5)))/(20*(100*cos(x3)^2 + 100*cos(x5)^2 – 1200)))^2 + abs((539*x3)/1000 + (49*x5)/1000 + (49*sin(x3))/100 – (cos(x3)*(2000*sin(x3)*x4^2 + 1000*sin(x5)*x6^2 – u + 980*cos(x3)*sin(x3) + 980*cos(x5)*sin(x5)))/(20*(100*cos(x3)^2 + 100*cos(x5)^2 – 1200)))^2)^(1/2)/(abs(x1)^2 + abs(x2)^2 + abs(x3)^2 + abs(x4)^2 + abs(x5)^2 + abs(x6)^2)^(1/2)

Best Answer

You want to do this:
limit(N,norm(x),0)
norm(x) is NOT a symbolic variable. It is a construct that contains symbolic variables, so it is a symbolic expression containing symbolic variables. But it is NOT a symbolic variable. The difference is important here.
x is what, a vector of length 6? Think about it like this: we can approach 0 with norm(x) along MANY paths in that 6 dimensional space. Infinitely many of them in fact. I'd not be amazed if some of those paths have different limits.
For example, consider the problem as you want to write it:
limit(x/y,norm([x,y]),0)
Thus take the limit of x/y, as the norm of the vector [x,y] approaches zero. If we fix x at zero, then vary y, allowing y to approach zero. Then the limit is equivalent to
syms y
limit(0/y,y,0)
ans =
0
But if we fix y to 0, then allow x to approach zero? MATLAB predicts this is essentially a NaN, undefined.
Or, we can follow the path where x==y. That reduces to
syms x
limit(x/x,x,0)
ans =
1
But what if we take the limit along the path x==2*y?
limit(x/(2*x),x,0)
ans =
1/2
The point is, your question is not well posed in general, since such a limit may well have infinitely many solutions.