Empty Sym 0-by-1
2 次查看(过去 30 天)
显示 更早的评论
Hi, I have this code which returns empty sym for ustar. I thought it's because maybe I can't get u as a closed form solution from ustar. but it is not the case apparently. Can soneone please help me?
syms Z f u T Tp lm D ro p l ge k2 C gw gc alp r hstar ustar
Z = ((T-Tp)*lm*u)/f + ((p*f*gw)/k2) + ((p^2)*f*l*alp*r*gc)/(D*u*C) + (ro*p*(l^2)*u*ge)/f*D;
df = diff(Z,f);
fstar = solve (df==0,f);
Z = subs(Z,f,fstar(1,1));
du = diff(Z,u);
ustar = solve(du==0,u);
0 个评论
回答(2 个)
Torsten
2022-4-8
If you print out "du", you will see that it has no zero (the numerator does not depend on u):
du = (sym)
/ 2 \
-C*D*gw*\D*ge*l *p*ro + T*lm - Tp*lm/
------------------------------------------------------------------------
______________________________________
/ / 2 \
/ C*D*k2*\D*ge*l *p*ro + T*lm - Tp*lm/
/ ------------------------------------ *(C*D*gw*u + alp*gc*k2*l*p*r)
\/ p*(C*D*gw*u + alp*gc*k2*l*p*r)
Walter Roberson
2022-4-9
It is not completely correct to say that du has no zero, on the basis that the numerator is independent of u. You must look at the denominator as well, and ask if there are conditions under which it is infinite.
The denominator involves u in a couple of places. If you extract the denominator it is the product of three terms. The first term is independent of u. Take the limit of the second term as u approaches inf or -inf and you get inf, hinting that possibly you can make the overall denominator infinite. The third term involves an expression divided by a function of u, raised to a power. As u goes to infinity, that would lead to 1/inf which would be 0. So... we have adjacent terms that progress to infinity times 1/infinity, which is a potential problem.
If you make the assumption that p is positive then you can lift it p outside the denominator of the third term. You end up with an expression in u, squared, times something divided by the same expression in u but raised to the 3/2. If you assume that the expression is positive, then you can merge powers and you end up with the square root of an expression in u, times some things that do not involve u. And that can indeed go to infinity as u goes to inf...
All of which means that there is an overall zero for du, at +inf or -inf or both... but depending on the signs of some variables you might potentially be working with a complex infinity.
2 个评论
Walter Roberson
2022-4-10
We took a derivative using diff(); we are pretty much already assuming that it is meaningful to calculate with infinities.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Values 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!