当前位置: 首页>>代码示例>>Golang>>正文


Golang Environment.F0方法代码示例

本文整理汇总了Golang中github.com/tflovorn/scExplorer/tempAll.Environment.F0方法的典型用法代码示例。如果您正苦于以下问题:Golang Environment.F0方法的具体用法?Golang Environment.F0怎么用?Golang Environment.F0使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/tflovorn/scExplorer/tempAll.Environment的用法示例。


在下文中一共展示了Environment.F0方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: D1MuBetaSolve

// Solve the (D1, Mu_h, Beta) system with x and F0 fixed.
func D1MuBetaSolve(env *tempAll.Environment, epsAbs, epsRel float64) (vec.Vector, error) {
	// our guess for beta should be above beta_c
	if env.A == 0.0 && env.B == 0.0 {
		D1, Mu_h, F0 := env.D1, env.Mu_h, env.F0
		env.F0 = 0.0 // F0 is 0 at T_c
		_, err := tempCrit.CritTempSolve(env, epsAbs, epsRel)
		if err != nil {
			return nil, err
		}
		fmt.Printf("%v; Tc = %f\n", env, 1.0/env.Beta)
		omegaFit, err := tempCrit.OmegaFit(env, tempCrit.OmegaPlus)
		if err != nil {
			return nil, err
		}
		env.A, env.B = omegaFit[0], omegaFit[2]
		env.PairCoeffsReady = true
		env.Beta += 0.1
		// we are at T < T_c; uncache env
		env.D1, env.Mu_h, env.F0 = D1, Mu_h, F0
	}
	//fmt.Printf("%v; Tc = %f\n", env, 1.0 / env.Beta)
	// solve low temp system for reasonable values of D1 and Mu_h first
	_, err := D1MuSolve(env, epsAbs, epsRel)
	if err != nil {
		return nil, err
	}
	// solve the full low temp system
	system, start := D1MuBetaSystem(env)
	solution, err := solve.MultiDim(system, start, epsAbs, epsRel)
	if err != nil {
		return nil, err
	}
	return solution, nil
}
开发者ID:tflovorn,项目名称:scExplorer,代码行数:35,代码来源:system.go

示例2: SolveNoninteracting

func SolveNoninteracting(env *tempAll.Environment, epsAbs, epsRel float64) (vec.Vector, error) {
	env.F0 = 0.0
	env.Mu_h = 0.3
	env.Beta = 50.0
	system, start := NoninteractingSystem(env)
	solution, err := solve.MultiDim(system, start, epsAbs, epsRel)
	if err != nil {
		return nil, err
	}
	return solution, nil
}
开发者ID:tflovorn,项目名称:scExplorer,代码行数:11,代码来源:system.go

示例3: D1MuF0Solve

// Solve the (D1, Mu_h, F0) system with x and Beta fixed.
func D1MuF0Solve(env *tempAll.Environment, epsAbs, epsRel float64) (vec.Vector, error) {
	if env.A == 0.0 && env.B == 0.0 {
		// We must have T < T_c < T_p (Beta > Beta_c > Beta_p).
		// Getting Beta_p is fast, so do that first.
		D1, Mu_h, F0, Beta := env.F0, env.Mu_h, env.F0, env.Beta // cache env
		env.F0 = 0.0                                             // F0 is 0 at T_c and T_p
		_, err := tempPair.PairTempSolve(env, epsAbs, epsRel)
		if err != nil {
			return nil, err
		}
		if Beta < env.Beta {
			return nil, fmt.Errorf("Beta = %f less than Beta_p in env %s", Beta, env.String())
		}
		_, err = tempCrit.CritTempSolve(env, epsAbs, epsRel)
		if err != nil {
			return nil, err
		}
		if Beta < env.Beta {
			return nil, fmt.Errorf("Beta = %f less than Beta_c in env %s", Beta, env.String())
		}
		fmt.Printf("%v; Tc = %f\n", env, 1.0/env.Beta)
		omegaFit, err := tempCrit.OmegaFit(env, tempCrit.OmegaPlus)
		if err != nil {
			return nil, err
		}
		env.A, env.B = omegaFit[0], omegaFit[2]
		env.PairCoeffsReady = true
		// we are at T < T_c; uncache env
		env.D1, env.Mu_h, env.F0, env.Beta = D1, Mu_h, F0, Beta
	}
	// solve low temp system for reasonable values of D1 and Mu_h first
	_, err := D1MuSolve(env, epsAbs, epsRel)
	if err != nil {
		return nil, err
	}
	// solve the full low temp system
	system, start := D1MuF0System(env)
	solution, err := solve.MultiDim(system, start, epsAbs, epsRel)
	if err != nil {
		return nil, err
	}
	return solution, nil
}
开发者ID:tflovorn,项目名称:scExplorer,代码行数:44,代码来源:system.go


注:本文中的github.com/tflovorn/scExplorer/tempAll.Environment.F0方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。