Tag Info

New answers tagged

4

I assume that the error arises because 5.0 is only precise to one decimal place...or rather to $MachinePrecision. You can try the following: fun = SetPrecision[(# - 5.0)^2.0 &, 30]; FindMinimum[fun[x], x, WorkingPrecision -> 30] which returns (with no error): {0, {x -> 5.00000000000000000000000000000}} Indeed, try: Precision[(# - 5.0)^2.0 ...


6

Note that FindFit was first introduced in version 5 and updated in version 7. Since then, FindFit has not been modified. NonlinearModelFit was introduced in 7 and appears to have remained unchanged since then. The two use the same format for arguments; however, FindFit returns the best fit parameters whereas NonlinearModelFit returns a model. The model ...


6

Introduction The update of the question invalidates my original approach, which depended on the problem being a simple special case. The current problem consists of a linear objective function with linear constraints, to be maximized over the integers. Theoretically, one can solve the problem with LinearProgramming. In the OP's setup, the variables betha ...


3

Edited answer If I reinterpret your constraints so they make sense, constraints = Apply[And, Flatten@{ Apply[LessEqual, {0, #, 1}] & /@ Flatten@subcindexSet, Map[Total@# == 1 &, Transpose@subcindexSet, {1}] }] (* 0 <= betha11 <= 1 && 0 <= betha12 <= 1 && 0 <= betha13 <= 1 ...


3

So we have a couple things going on here. First, as mentioned in an answer to your previous question, ExpIntegralEi is not compilable (MainEvaluate called). So speedup from compiling this function will be negligible and it may be easier to not even compile in this case. Second, to properly use NMaximize we need the function to accept numeric arguments ...


1

NMinimize[{f[t], 0 < t < 10}, t, Method -> SimulatedAnnealing] {-0.467368, {t -> 1.57162}}


0

ans=NMaximize[ {testfun[f0, alpha, beta], f0 >= 0 && alpha >= 0 && beta >= 0}, {f0, alpha, beta}, Method -> {"RandomSearch", "SearchPoints" -> 200} ] he = D[testfun[f0, alpha, beta], {{f0, alpha, beta}, 2}] he /. ans[[2]] // MatrixForm Inverse[%] Diagonal[-%] Sqrt[%] After some trial and error, I believe ...



Top 50 recent answers are included