def run(): # Quantities for the response function # and randomization # construct a default response function for a single filament rf = ConstantFrictionFreeLengthFiniteFiber( tau = 0.5e6, l = 0.01, E = 70e9, A = 0.89e-6, slack = 0.0, L = 0.3, sigma_fu = 200e6 ) # construct the integrator and provide # it with the response function. max_u = 1.8 s = SPIRRID( rf = rf, min_eps = 0.00, max_eps = max_u, n_eps = 80, cached_dG = True, compiled_QdG_loop = False, compiled_eps_loop = False ) # construct the correlated integrator and # provide it with the response function. sc = CorSPIRRID( rf = rf, rho = -0.99, min_eps = 0.00, max_eps = max_u, n_eps = 80, cached_dG = True, compiled_QdG_loop = False, compiled_eps_loop = False ) n_int = 100 s.add_rv( 'tau', distribution = 'norm', loc = 0.3e6, scale = 0.1e6, n_int = n_int ) s.add_rv( 'l', distribution = 'norm', loc = 0.03, scale = 0.01, n_int = n_int ) sc.add_rv( 'tau', distribution = 'norm', loc = 0.3e6, scale = 0.1e6, n_int = n_int ) sc.add_rv( 'l', distribution = 'norm', loc = 0.03, scale = 0.01, n_int = n_int ) # define a tables with the run configurations to start in a batch print 'sum', sum( sc.dG_grid ) print 'sum', sum( s.dG_grid ) # z = sc.pdf_theta_grid # x, y = mgrid[-4:4:50j, -4:4:50j] # # mlab.surf(x, y, z) # mlab.show() s.mean_curve.plot( plt, color = 'red', linewidth = 2, label = 'spirrid' ) sc.mean_curve.plot( plt, color = 'blue', linewidth = 2, label = 'cor spirrid' ) plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( loc = 'lower right' ) plt.title( s.rf.title ) plt.show()
def _get_s_inner( self ): s = SPIRRID( rf = self.rf, cached_dG = True, compiled_QdG_loop = False, compiled_eps_loop = False ) # construct the random variables n_int = 10 s.add_rv( 'xi', distribution = 'weibull_min', scale = 0.02, shape = 10., n_int = n_int ) s.add_rv( 'theta', distribution = 'uniform', loc = self.loc_theta, scale = 0.01, n_int = n_int ) #.add_rv('lambd', distribution = 'uniform', loc = 0.0, scale = 0.01, n_int = n_int) return s
def run(): # Quantities for the response function # and randomization # construct a default response function for a single filament rf = ConstantFrictionFiniteFiber( fu=1200e15, qf=1200, L=0.02, A=0.00000002, E_mod=210.e9, z=0.004, phi=0.5, f=0.01 ) # construct the integrator and provide it with the response function. s = SPIRRID( rf=rf, min_eps=0.00, max_eps=0.0008, n_eps=80 ) # construct the random variables n_int = 15 s.add_rv( 'E_mod', distribution='uniform', loc=170.e9, scale=250.e9, n_int=n_int ) s.add_rv( 'L', distribution='uniform', loc=0.02, scale=0.03, n_int=n_int ) s.add_rv( 'phi', distribution='cos_distr', loc=0., scale=1., n_int=n_int ) s.add_rv( 'z', distribution='uniform', loc=0, scale=rf.L / 2., n_int=n_int ) # define a tables with the run configurations to start in a batch run_list = [ ( {'cached_qg' : False, 'compiled_qg_loop' : True, 'compiled_eps_loop' : True }, 'bx-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec' ), ( {'cached_qg' : False, 'compiled_qg_loop' : True, 'compiled_eps_loop' : False }, 'r-2', '$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec', ), ( {'cached_qg' : True, 'compiled_qg_loop' : True, 'compiled_eps_loop' : True }, 'go-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec', ), ( {'cached_qg' : True, 'compiled_qg_loop' : False, 'compiled_eps_loop' : False }, 'b--', '$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec' ), ] for idx, run in enumerate( run_list ): run_options, plot_options, legend_string = run print 'run', idx, s.set( **run_options ) s.mean_curve.plot( plt, plot_options, linewidth=2, label=legend_string % s.exec_time ) print 'execution time', s.exec_time, s.mu_q_peak plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( loc='lower right' ) plt.title( s.rf.title ) plt.show()
def run(): # Quantities for the response function # and randomization # construct a default response function for a single filament dict_var = {'fu':1200.0e6, 'qf':1500., 'L':0.02, 'A':5.30929158457e-10, 'E_mod':70.0e9, 'z':0.0, 'phi':0., 'f':0.0} outfile = open( 'pullout_comb_stat.dat', 'w' ) comb = 0 while_cond = 1 while while_cond == 1: #for comb in range( 1, n_com + 1 ): comb += 1 for i in range( 0, 2 ): # construct a default response function for a single filament rf = ConstantFrictionFiniteFiber() rf.set( **dict_var ) # construct the integrator and provide it with the response function. s = SPIRRID( rf=rf, min_eps=0.00, max_eps=0.05, n_eps=80 ) # construct the random variables n_int = 10 dict_rv = { 'fu':{'variable':'fu', 'distribution':'weibull_min', 'loc':1200.0e6, 'scale':200., 'n_int':n_int }, 'qf':{'variable':'qf', 'distribution':'uniform', 'loc':1500., 'scale':100., 'n_int':n_int }, 'L':{'variable':'L', 'distribution':'uniform', 'loc':0.02, 'scale':rf.L / 2., 'n_int':n_int}, 'A':{'variable':'A', 'distribution':'uniform', 'loc':5.30929158457e-10, 'scale':.03 * 5.30929158457e-10, 'n_int':n_int }, 'E_mod':{'variable':'E_mod', 'distribution':'uniform', 'loc':70.e9, 'scale':250.e9, 'n_int':n_int}, 'z':{'variable':'z', 'distribution':'uniform', 'loc':0., 'scale':.03, 'n_int':n_int }, 'phi':{'variable':'phi', 'distribution':'cos_distr', 'loc':0., 'scale':1., 'n_int':n_int}, 'f':{'variable':'f', 'distribution':'uniform', 'loc':0., 'scale':.03, 'n_int':n_int }, } n_var = len( dict_rv ) n_com = 0 for k in range( 6, 7 ): n_com += choose( n_var, k ) # end of the while loop if comb == n_com: while_cond = 0 list_rv_comb = list( powerset( dict_rv, par=6 ) ) for rv in list_rv_comb[comb]: s.add_rv( **dict_rv[rv] ) # define a tables with the run configurations to start in a batch run_list = [ ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'bx-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec' ), ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : False }, 'r-2', '$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'go-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : False, 'compiled_eps_loop' : False }, 'b--', '$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec' ), ] print 'Combination', list_rv_comb[comb], ' -- ', i outfile.write( "Combination %s -- %i\n" % ( list_rv_comb[comb], i ) ) outfile.write( "%s \t %s\n" % ( "Run", "Time" ) ) for idx, run in enumerate( run_list ): run_options, plot_options, legend_string = run print 'run', idx, s.set( **run_options ) plt.figure( comb ) s.mean_curve.plot( plt, plot_options, linewidth=2, label=legend_string % s.exec_time ) print 'execution time', s.exec_time, s.mu_q_peak outfile.write( "%s \t %s\n" % ( idx, s.exec_time ) ) outfile.write( "=================\n" ) plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( loc='lower right' ) plt.title( s.rf.title ) del s plt.show()
def run(): # Quantities for the response function # and randomization # dict_var = {'x' : 10, 'y' : 20, 'z' : 30, 'a' : 40} n_var = len( dict_var ) n_com = 0 for k in range( 0, n_var ): n_com += choose( n_var, k ) outfile = open( 'simple_comb_stat.dat', 'w' ) for comb in range( 1, n_com + 1 ): for i in range( 0, 2 ): # construct a default response function for a single filament rf = Filament() rf.set( **dict_var ) # (x=10, y=20, ...) # construct the integrator and provide it with the response function. s = SPIRRID( rf=rf, min_eps=0.00, max_eps=0.05, n_eps=1 ) # construct the random variables n_int = 35 dict_rv = { 'x':{'variable':'x', 'distribution':'norm', 'loc':10., 'scale':2., 'n_int':n_int}, 'y':{'variable':'y', 'distribution':'norm', 'loc':10., 'scale':2., 'n_int':n_int}, 'z':{'variable':'z', 'distribution':'norm', 'loc':10., 'scale':2., 'n_int':n_int}, 'a':{'variable':'a', 'distribution':'norm', 'loc':10., 'scale':2., 'n_int':n_int}, } list_rv_comb = list( powerset( dict_rv ) ) for rv in list_rv_comb[comb]: s.add_rv( **dict_rv[rv] ) # define a tables with the run configurations to start in a batch run_list = [ ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'bx-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec' ), ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : False }, 'r-2', '$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'go-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : False, 'compiled_eps_loop' : False }, 'y--', '$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec' ), ] legend = [] print 'Combination', list_rv_comb[comb], ' -- ', i outfile.write( "Combination %s -- %i\n" % ( list_rv_comb[comb], i ) ) outfile.write( "%s \t %s\n" % ( "Run", "Time" ) ) for idx, run in enumerate( run_list ): run_options, plot_options, legend_string = run print 'run', idx, s.set( **run_options ) s.mean_curve.plot( plt, plot_options ) print 'execution time', s.exec_time, s.mu_q_peak outfile.write( "%s \t %s\n" % ( idx, s.exec_time ) ) legend.append( legend_string % s.exec_time ) outfile.write( "=================\n" ) plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( legend ) plt.title( s.rf.title ) del s plt.show() outfile.close()
def run(): # Quantities for the response function # and randomization # dict_var = {"x": 10, "y": 20, "z": 30, "a": 40} n_var = len(dict_var) n_com = 0 for k in range(0, n_var): n_com += choose(n_var, k) outfile = open("simple_comb_loop_stat.dat", "w") for comb in range(1, n_com + 1): for i in range(0, 2): # construct a default response function for a single filament rf = Filament() rf.set(**dict_var) # (x=10, y=20, ...) # construct the integrator and provide it with the response function. s = SPIRRID(rf=rf, min_eps=0.00, max_eps=0.05, n_eps=1) # construct the random variables n_int = 35 dict_rv = { "x": {"variable": "x", "distribution": "norm", "loc": 10.0, "scale": 2.0, "n_int": n_int}, "y": {"variable": "y", "distribution": "norm", "loc": 10.0, "scale": 2.0, "n_int": n_int}, "z": {"variable": "z", "distribution": "norm", "loc": 10.0, "scale": 2.0, "n_int": n_int}, "a": {"variable": "a", "distribution": "norm", "loc": 10.0, "scale": 2.0, "n_int": n_int}, } list_rv_comb = list(powerset(dict_rv)) for rv in list_rv_comb[comb]: s.add_rv(**dict_rv[rv]) # define a tables with the run configurations to start in a batch run_list = [ ( {"cached_qg": False, "compiled_qg_loop": True, "compiled_eps_loop": True}, "bx-", "$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec", ), ( {"cached_qg": False, "compiled_qg_loop": True, "compiled_eps_loop": False}, "r-2", "$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec", ), ( {"cached_qg": True, "compiled_qg_loop": True, "compiled_eps_loop": True}, "go-", "$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec", ), ( {"cached_qg": True, "compiled_qg_loop": False, "compiled_eps_loop": False}, "y--", "$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec", ), ] legend = [] print "Combination", list_rv_comb[comb], " -- ", i outfile.write("Combination %s -- %i\n" % (list_rv_comb[comb], i)) outfile.write("%s \t %s\n" % ("Run", "Time")) for idx, run in enumerate(run_list): run_options, plot_options, legend_string = run print "run", idx, s.set(**run_options) s.mean_curve.plot(plt, plot_options) print "execution time", s.exec_time, s.mu_q_peak outfile.write("%s \t %s\n" % (idx, s.exec_time)) legend.append(legend_string % s.exec_time) outfile.write("=================\n") plt.xlabel("strain [-]") plt.ylabel("stress") plt.legend(legend) plt.title(s.rf.title) del s plt.show() outfile.close()
rf = Yarn() # control variable - strains # can be a float number or array cv = linspace( 0.0, 0.06, 10 ) # construct the outer integrator and provide it with the response function. s_outer = SPIRRID( rf = rf, cv = cv, cached_dG = True, compiled_QdG_loop = False, compiled_eps_loop = False ) # construct the random variables n_int = 3 s_outer.add_rv( 'loc_theta', distribution = 'uniform', loc = 0.00, scale = 0.01, n_int = n_int ) # plot the mean filament and mean yarn response plt.plot( cv, rf( cv, 0.01 ), linewidth = 2, label = 'random filament properties' ) plt.plot( cv, s_outer.results[0], linewidth = 2, label = 'random bundle properties' ) plt.legend( loc = 'best' ) plt.title( rf.title ) plt.show()
def run(): # Quantities for the response function # and randomization # E_mod = 70 * 1e+9 # Pa sig_u = 1.25 * 1e+9 # Pa D = 26 * 1.0e-6 # m A = ( D / 2.0 ) ** 2 * pi xi_u = sig_u / E_mod dict_var = {'E_mod':70.e9, 'xi':0.02, 'A':A, 'theta':0, 'lambd':0} outfile = open( 'filament_comb_stat.dat', 'w' ) comb = 0 while_cond = 1 while while_cond == 1: #for comb in range( 1, n_com + 1 ): comb += 1 for i in range( 0, 2 ): # construct a default response function for a single filament rf = Filament() rf.set( **dict_var ) # construct the integrator and provide it with the response function. s = SPIRRID( rf=rf, min_eps=0.00, max_eps=0.05, n_eps=80 ) # construct the random variables n_int = 32 dict_rv = { 'xi':{'variable':'xi', 'distribution':'weibull_min', 'scale':0.02, 'shape':10., 'n_int':n_int}, 'E_mod':{'variable':'E_mod', 'distribution':'uniform', 'loc':70e+9, 'scale':15e+9, 'n_int':n_int}, 'theta':{'variable':'theta', 'distribution':'uniform', 'loc':0.0, 'scale':0.01, 'n_int':n_int}, 'lambd':{'variable':'lambd', 'distribution':'uniform', 'loc':0.0, 'scale':.2, 'n_int':n_int}, 'A':{'variable':'A', 'distribution':'uniform', 'loc':A * 0.3, 'scale':0.7 * A, 'n_int':n_int}, } n_var = len( dict_rv ) n_com = 0 for k in range( 0, n_var ): n_com += choose( n_var, k ) print 'The only last combination' comb = n_com # end of the while loop if comb == n_com: while_cond = 0 list_rv_comb = list( powerset( dict_rv ) ) for rv in list_rv_comb[comb]: s.add_rv( **dict_rv[rv] ) # define a tables with the run configurations to start in a batch run_list = [ ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'bx-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec' ), ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : False }, 'r-2', '$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : False, 'compiled_eps_loop' : False }, 'y--', '$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec' ), ( {'cached_dG' : True, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'go-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec', ), ] legend = [] print 'Combination', list_rv_comb[comb], ' -- ', i outfile.write( "Combination %s -- %i\n" % ( list_rv_comb[comb], i ) ) outfile.write( "%s \t %s\n" % ( "Run", "Time" ) ) for idx, run in enumerate( run_list ): run_options, plot_options, legend_string = run print 'run', idx, s.set( **run_options ) plt.figure( comb ) s.mean_curve.plot( plt, plot_options ) print 'execution time', s.exec_time outfile.write( "%s \t %s\n" % ( idx, s.exec_time ) ) legend.append( legend_string % s.exec_time ) outfile.write( "=================\n" ) plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( legend ) plt.title( s.rf.title ) del s plt.show()
def run(): # Quantities for the response function # and randomization # xx = 10 # Pa yy = 20 # Pa zz = 30 aa = 40 # construct a default response function for a single filament rf = Filament( x=xx, y=yy, z=zz, a=aa ) # construct the integrator and provide it with the response function. s = SPIRRID( rf=rf, min_eps=0.00, max_eps=0.05, n_eps=1 ) # construct the random variables n_int = 80 s.add_rv( 'x', distribution='norm', scale=10., shape=2., n_int=n_int ) s.add_rv( 'y', distribution='norm', loc=10., scale=2., n_int=n_int ) s.add_rv( 'z', distribution='norm', loc=10., scale=2., n_int=n_int ) s.add_rv( 'a', distribution='norm', loc=10., scale=2., n_int=n_int ) # define a tables with the run configurations to start in a batch run_list = [ ( {'cached_qg' : False, 'compiled_qg_loop' : True, 'compiled_eps_loop' : True }, 'bx-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec' ), ( {'cached_qg' : False, 'compiled_qg_loop' : True, 'compiled_eps_loop' : False }, 'r-2', '$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec', ), ( {'cached_qg' : True, 'compiled_qg_loop' : True, 'compiled_eps_loop' : True }, 'go-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec', ), ( {'cached_qg' : True, 'compiled_qg_loop' : False, 'compiled_eps_loop' : False }, 'y--', '$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec' ), ] legend = [] for idx, run in enumerate( run_list ): run_options, plot_options, legend_string = run print 'run', idx, s.set( **run_options ) s.mean_curve.plot( plt, plot_options ) print 'execution time', s.exec_time legend.append( legend_string % s.exec_time ) plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( legend ) plt.title( s.rf.title ) plt.show()
def run(): # Quantities for the response function # and randomization # E_mod = 70 * 1e+9 # Pa sig_u = 1.25 * 1e+9 # Pa D = 26 * 1.0e-6 # m A = ( D / 2.0 ) ** 2 * pi xi_u = sig_u / E_mod # construct a default response function for a single filament rf = Filament( E_mod=70.e9, xi=0.02, A=A, theta=0, lambd=0 ) # construct the integrator and provide it with the response function. s = SPIRRID( rf=rf, min_eps=0.00, max_eps=0.05, n_eps=80 ) # construct the random variables n_int = 70 s.add_rv( 'xi', distribution='weibull_min', scale=0.02, shape=10., n_int=n_int ) # s.add_rv( 'E_mod', distribution = 'uniform', loc = 70e+9, scale = 15e+9, n_int = n_int ) s.add_rv( 'theta', distribution='uniform', loc=0.0, scale=0.01, n_int=n_int ) s.add_rv( 'lambd', distribution='uniform', loc=0.0, scale=.2, n_int=n_int ) s.add_rv( 'A', distribution='uniform', loc=A * 0.3, scale=0.7 * A, n_int=n_int ) # define a tables with the run configurations to start in a batch run_list = [ ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'bx-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) $ - %4.2f sec' ), ( {'cached_dG' : False, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : False }, 'r-2', '$\mathrm{P}_{e} ( \mathrm{C}_{\\theta} ( q(e,\\theta) \cdot g[\\theta_1] g[\\theta_2] \dots g[\\theta_n] ) ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : True, 'compiled_eps_loop' : True }, 'go-', '$\mathrm{C}_{e,\\theta} ( q(e,\\theta) \cdot G[\\theta] ) $ - %4.2f sec', ), ( {'cached_dG' : True, 'compiled_QdG_loop' : False, 'compiled_eps_loop' : False }, 'y--', '$\mathrm{P}_{e} ( \mathrm{N}_{\\theta} ( q(e,\\theta) \cdot G[\\theta] ) ) $ - %4.2f sec' ), ] legend = [] for idx, run in enumerate( run_list ): run_options, plot_options, legend_string = run print 'run', idx, s.set( **run_options ) s.mean_curve.plot( plt, plot_options ) print 'execution time', s.exec_time legend.append( legend_string % s.exec_time ) plt.xlabel( 'strain [-]' ) plt.ylabel( 'stress' ) plt.legend( legend ) plt.title( s.rf.title ) plt.show()