Beispiel #1
0
double Actions_AxisymmetricFudge_InterpTables::Getu0(double utry,double E,double Delta,double Iu,double Lzsq,double sh1sq, double v, double sv2){
    uturn_st UVV(this,E,Delta,Iu,Lzsq,sh1sq,v,sv2);
    double ui,uo=0.,dut=duturnfn(utry,&UVV);
    if(dut>0){//inside
        while(dut>0){
            ui=utry; utry*=1.2; dut=duturnfn(utry,&UVV);
        } uo=utry;
    }else{//outside
        while(dut<0){
            uo=utry; utry*=.8; dut=duturnfn(utry,&UVV);
        } ui=utry;
    }
    if(ui<TINY_UV and uo<TINY_UV){
        int status;
        minimiser1D min(&negduturnfn,1e-1,1e-5,100.,10.,1e-3,&status,&UVV);
        return min.minimise(100);
    }
    if(dut!=dut or std::isinf(dut) or std::isnan(dut)){
        std::cerr<<"duturnfn is nan in Getu0\n";
        return us;
    }
    root_find RF(TINY_UV,100);
    double ufound = RF.findroot(&duturnfn,ui,uo,&UVV);
    return ufound;
}
Beispiel #2
0
static double negduturnfn(double u,void*p){return -duturnfn(u,p);}