find a root problem
显示 更早的评论
syms hr;
Bo=2106192442915567908282078859207/4494983136974228414275670063706112 - (2106192442915567908282078859207*exp(-18446744073709551616/(1147831826363933*(81508471552582434684928/(3187597375937011*hr) + 22182.30127333101796019592417497))))/4494983136974228414275670063706112
hr1=solve(hr-661*230*Bo^0.5,hr)
I found a hr1=2.3145157172213798324089674315726e-40 - 1.8416117030019738856259409912694e-48*i through matlab
But It must be,true answers are 1997.001744 and 0,
I'm waiting your solutions pls Thanks,,
回答(1 个)
Walter Roberson
2013-3-26
You are encountering round=off error. 2106192442915567908282078859207/4494983136974228414275670063706112 is being converted to floating point by MATLAB before the expression reaches MuPAD.
V2106 = sym('2106192442915567908282078859207');
V4494 = sym('4494983136974228414275670063706112');
Bo = V2106/V4494 - (V2106 * exp( sym('-18446744073709551616') / (sym('1147831826363933') * (sym('81508471552582434684928') / (sym('3187597375937011') * hr) + sym('22182.30127333101796019592417497'))))) / V4494;
hr1 = solve( hr - sym('661') * sym('230') * sqrt(Bo), hr)
5 个评论
emre karakoc
2013-3-26
Walter Roberson
2013-3-27
You did not code them as symbolic values, not here and not in your duplicate question. If you are generating this code, then alter the generation routine to generate symbolic numbers.
Walter Roberson
2013-3-27
Try using assume() to add the assumption that hr > 0.
emre karakoc
2013-3-28
编辑:emre karakoc
2013-3-28
Walter Roberson
2013-3-28
You are encountering round-off error, and the slope is very very steep near the 1997 solution. The program probably cannot isolate the root. You might need to increase Digits a fair bit (to 40 or so) to find the second root.
I do not have MuPAD, so I cannot test in MuPAD. The symbolic package I use does find the 1997-ish root.
类别
在 帮助中心 和 File Exchange 中查找有关 Common Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!