3

I'm currently working on a project in Julia where I am starting with an input beta which is assumed to be incorrect. I'm running through a sequence of code that updates this beta to be the correct value and checking the error. As beta gets larger, I expect this error to reach 100%. This code ultimately does a minimization of some parameter chi which is why I've chosen to employ the optimize function from Optim.jl. The output I'm getting is below.

optimmethod

When I perform this calculation by hand (using 1st and 2nd derivative to update) I get this

myway

I see that this still has some numerical instability, but it holds up longer than the Optim way does. I would expect it to behave the other way around. My optimize function is set up as

result = optimize(β -> TEfunc(E,nc,onecut,β,pcutoff,μcutoff,N),β/2,2.2*β,Brent(),abs_tol=tempcutoff,rel_tol=sqrt(tempcutoff))

βstar=Optim.minimizer(result)

Is there an argument that I'm missing in the optimize call? I just want to figure out why I have numerical instability so quickly.

  • It would probably help to include the source of `TEfunc` as well. – phipsgabler Jan 08 '22 at 09:22
  • it is indeed impossible to say much without TEfunc. That said, you're showing beta_star / beta. Is that the optimizer divided by the starting point? Why would that consistently be 2?What is the comparison like if you look at the objective function at the candidate optimizers for each method? so `Optim.minimum(result)` for Brent for example. – pkofod Jan 09 '22 at 07:22
  • yes, sorry I should definitely include that. I expect to see 2 for the beta_star/beta because the error will increase to 100%. If they were the same then it should just stay 1. I should subtract 1 from the vertical axis to make that more clear so thank you. As for the TEfunc, you can see it on my file found [here](https://github.com/csobecks/FFDG/blob/main/EnergySpectraGenerator.jl). It's essentially going point by point and comparing the difference between two arrays. One array is from all the calculations. The other is the shape of the array and the beta value is changed to see what gives – Casey Sobecks Jan 11 '22 at 16:57
  • see what gives the smallest difference. Essentially, I'm just trying to find the correct beta for the new function. The difference between the two should increase as the original beta increases. – Casey Sobecks Jan 11 '22 at 16:59

0 Answers0