find a root problem
Show older comments
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,,
Answers (1)
Walter Roberson
on 26 Mar 2013
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 Comments
emre karakoc
on 26 Mar 2013
Walter Roberson
on 27 Mar 2013
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
on 27 Mar 2013
Try using assume() to add the assumption that hr > 0.
emre karakoc
on 28 Mar 2013
Edited: emre karakoc
on 28 Mar 2013
Walter Roberson
on 28 Mar 2013
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.
Categories
Find more on Common Operations 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!