Exemplo n.º 1
0
def func(pars):
    

        cropdai=DaisyModel('./hhj.v2-wclover.dai')
        cropdai.Input['defcrop']['Prod']['RtDR'][1].setvalue(pars[0])
        #cropdai.Input['defcrop']['Prod']['RtDR'][3].setvalue(pars[1])
        #cropdai.Input['defcrop']['Prod']['RtDR'][4].setvalue(pars[2])
        #cropdai.Input['defAOM']['C_per_N'].setvalue(pars[1])
        cropdai.save()
               
#        cropdai=DaisyModel('./hhj.v2-wclover.dai')
 #       cropdai.Input['defcrop']['LeafPhot']['Fm'].setvalue(pars[1])
        #cropdai.Input['defAOM']['C_per_N'].setvalue(pars[3])
  #      cropdai.save()
        
        
        run_sub_folders(r'.','setup.dai')
        print('Simulations done')
        r=opti('Wclover','cloverDM')
        r+=opti('Ryegrass','grassDM')
        r+=0.035*opti('Ryegrass','grassN','N')
        r+=0.035*opti('Wclover','cloverN','N')
        f = open("myfile3.txt", "a")
        f.write(str(pars) + " " + str(r) +"\n")
        f.close()
        return r
Exemplo n.º 2
0
def func(pars):
# Optimering for RSR parameteren i ryegrass    

        cropdai=DaisyModel('./hhj-ryegrass.dai')
        cropdai.Input['defAOM']['C_per_N'].setvalue(pars[0])
        cropdai.Input['defcrop']['LeafPhot']['Fm'].setvalue(pars[1])
        
        cropdai.save()
               
        cropdai=DaisyModel('./hhj.v2-wclover.dai')
        cropdai.Input['defcrop']['CrpN']['fixate_factor'].setvalue(pars[2])
        cropdai.Input['defAOM']['C_per_N'].setvalue(pars[3])
        cropdai.Input['defcrop']['LeafPhot']['Fm'].setvalue(pars[4])
        cropdai.save()
        
        
        run_sub_folders(r'.','setup.dai')
        print('Simulations done')
        r=opti('Wclover','cloverDM')
        r+=opti('Ryegrass','grassDM')
        r+=0.035*opti('Ryegrass','grassN','N')
        r+=0.035*opti('Wclover','cloverN','N')
        f = open("myfile16.txt", "a")
        f.write(str(pars) + " " + str(r) +"\n")
        f.close()
        return r
Exemplo n.º 3
0
def func(pars):

    cropdai = DaisyModel('..\common\SB-ryegrass.dai')
    cropdai.Input['defcrop']['LeafPhot']['Fm'].setvalue(pars[0])
    cropdai.save()

    run_sub_folders(r'.', 'setup.dai')
    r = opti('Wclover', 'cloverDM')
    r += opti('Ryegrass', 'grassDM')
    r += 0.01 * opti('Ryegrass', 'grassN', 'N')
    r += 0.01 * opti('Wclover', 'cloverN', 'N')
    return r
Exemplo n.º 4
0
def func(pars):
    cropdai = DaisyModel('..\common\SB-ryegrass.dai')
    cropdai.Input['defcrop']['LeafPhot']['Fm'].setvalue(pars[0])
    cropdai.Input['defAOM']['C_per_N'].setvalue(pars[0])
    cropdai.save()

    cropdai = DaisyModel('..\common\SB-wclover.dai')
    cropdai.Input['defcrop']['LeafPhot']['Fm'].setvalue(pars[0])
    cropdai.Input['defAOM']['C_per_N'].setvalue(pars[0])
    cropdai.save()

    run_sub_folders(r'.', 'setup.dai')
    print('Simulations done')
    r = opti('Wclover', 'cloverDM')
    r += opti('Ryegrass', 'grassDM')
    r += 0.035 * opti('Ryegrass', 'grassN', 'N')
    r += 0.035 * opti('Wclover', 'cloverN', 'N')
    return r