easy question : why i get NaN here ?
Show older comments
>> u=1/(1+limit(K/(w*(((J*w+b)*(L*w+R))+K^2)),w,0))
or
>> limit(K/(w*(((J*w+b)*(L*w+R))+K^2)),w,0)
6 Comments
yahya elyan
on 30 May 2020
yahya elyan
on 30 May 2020
Walter Roberson
on 30 May 2020
Those both involve the limit of K/0 . That would not necessarily result in NaN, depending on what is known about K.
If K is 0, then it would be limit 0/0 which would be nan.
yahya elyan
on 30 May 2020
yahya elyan
on 30 May 2020
Edited: yahya elyan
on 30 May 2020
yahya elyan
on 30 May 2020
Accepted Answer
More Answers (1)
Walter Roberson
on 31 May 2020
J = 0.01;
b = 0.0737;
K = 0.072;
R = 1.17;
L = 0.024;
syms w
temp = K/(w*(((J*w+b)*(L*w+R))+K^2));
tempc = collect(temp, w);
disp(tempc)
ans =
120000/(400*w^3 + 22448*w^2 + 152355*w)
Examing this, we see that as w approaches 0, the controlling expression would be the 152355*w part -- the w^3 and w^2 parts would vanish compared to the w component. So the limit of temp as w goes to 0 would be like
limit( (120000/152355)/w, w, 0)
When w approaches from the right, that is positive divided by +0, which is +infinity
When w approaches from the left, that is positive divided by -0, which is -infinity
Therefore the left and right limits are different, so the limit is not defined.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!