- #36
Bill Simpson
- 1,077
- 33
aminbkh said:Hi thanks for your help,I have attached the file
I would appreciate it if you could help me.
If I try this
B[t_, Y_] := Y^(3/4)*t;t = 10; g = Random[Real, {.01, 3}]; u = Random[Real, {.01, 3}];
B[10, Y] /. NSolve[1 - (1 - u)*Y == u*(1 - g/(t*Y^.3))^.5*Y^.32, Y]
just to see how long your innermost step might take, it does not finish in several minutes. That does not give me a good feeling for how long it might take when NMinimize might want to do several hundred or tens of thousands such evaluations looking for a minimum.
When I then do this
Table[1 - (1 - u)*Y - u*(1 - g/(t*Y^.3))^.5*Y^.32, {Y, -10, 10, .1}]
it completes in a fraction of a second and I can see from the result that it does look like that crosses zero. But it looks like trying to understand why your NSolve takes so long is the first thing to do. If that can be fixed then your problem may be solved. But I am a little worried about what will happen in the situation when there is no solution from the NSolve. Then you will be trying to minimize something that is undefined in some domains.
So can you make any progress on speeding up the NSolve step?
Last edited: