model-builder-0.4.1.orig/0000755000175000017500000000000010745437177013322 5ustar godgodmodel-builder-0.4.1.orig/Model_Builder.egg-info/0000755000175000017500000000000010745437177017522 5ustar godgodmodel-builder-0.4.1.orig/Model_Builder.egg-info/PKG-INFO0000644000175000017500000000076110745437176020622 0ustar godgodMetadata-Version: 1.0 Name: Model-Builder Version: 0.4.1 Summary: Model Builder is a graphical ODE simulator Home-page: http://model-builder.sourceforge.net Author: Flavio Codeco Coelho Author-email: fccoelho@fiocruz.br License: GPL Download-URL: http://sourceforge.net/project/showfiles.php?group_id=164374 Description: Model Builder is a graphical tool for designing, simulating and analyzing Mathematical model consisting of a system of ordinary differential equations(ODEs). Platform: UNKNOWN model-builder-0.4.1.orig/Model_Builder.egg-info/SOURCES.txt0000644000175000017500000000430010745437176021402 0ustar godgodCHANGELOG COPYING MANIFEST MANIFEST.in README ez_setup.py setup.py Model_Builder.egg-info/PKG-INFO Model_Builder.egg-info/SOURCES.txt Model_Builder.egg-info/dependency_links.txt Model_Builder.egg-info/entry_points.txt Model_Builder.egg-info/top_level.txt model_builder/Introduction.html model_builder/MB.hhc model_builder/MB.hhk model_builder/MB.hhp model_builder/MB.htb model_builder/MB.ico model_builder/Model.py model_builder/ModelBuilder_About.html model_builder/PlotFigure.py model_builder/PyMB.py model_builder/The_main_Interface.html model_builder/__init__.py model_builder/__version__.py model_builder/about.py model_builder/backup_section.png model_builder/cwt.png model_builder/cwt.py model_builder/filesave.png model_builder/folder_open.png model_builder/gnuplot.png model_builder/graphics_section.png model_builder/icones.py model_builder/index.html model_builder/lhsframe.py model_builder/lhsframe_glade.py model_builder/mathematics_section.png model_builder/model-builder.desktop model_builder/odexml.py model_builder/quivVarFrame.py model_builder/spreadsheet_section.png model_builder/timemanagement_section.png model_builder/uncertaintyMiniFrame.py model_builder/wxFrame1.py model_builder/wxFrame2.py model_builder/wxMiniFrame1.py model_builder/Bayes/Bayeshelp.py model_builder/Bayes/Melding.py model_builder/Bayes/Meldingbas.py model_builder/Bayes/__init__.py model_builder/Bayes/flib.f model_builder/Bayes/gibbs.py model_builder/Bayes/kde1d.py model_builder/Bayes/lhs.py model_builder/Bayes/like.py model_builder/Bayes/metropolis.py model_builder/Bayes/rejectBayes.py model_builder/Bayes/rejection.py model_builder/Docs/Quick-start.pdf model_builder/Examples/2eqs.ode model_builder/Examples/3eqs.ode model_builder/Examples/HH.ode model_builder/Examples/bmeld_example.ode model_builder/Examples/exponencial.ode model_builder/Examples/gastric.ode model_builder/Examples/lotka-volterra.ode model_builder/Examples/lotka-volterra2.ode model_builder/Examples/lotka-volterra2_unc.spec model_builder/Examples/nagumo.ode model_builder/Examples/pk.ode model_builder/Examples/sir.ode model_builder/Examples/sir_unc.spec model_builder/Examples/sirdemog.ode model_builder/Examples/sprucebudworm.ode model_builder/Examples/verhulst.ode model-builder-0.4.1.orig/Model_Builder.egg-info/dependency_links.txt0000644000175000017500000000000110745437176023567 0ustar godgod model-builder-0.4.1.orig/Model_Builder.egg-info/entry_points.txt0000644000175000017500000000005610745437176023020 0ustar godgod[gui_scripts] PyMB = model_builder.PyMB:main model-builder-0.4.1.orig/Model_Builder.egg-info/top_level.txt0000644000175000017500000000004210745437176022247 0ustar godgodmodel_builder/Bayes model_builder model-builder-0.4.1.orig/model_builder/0000755000175000017500000000000010745437177016130 5ustar godgodmodel-builder-0.4.1.orig/model_builder/Bayes/0000755000175000017500000000000010745437177017173 5ustar godgodmodel-builder-0.4.1.orig/model_builder/Bayes/Bayeshelp.py0000755000175000017500000000016110473670477021462 0ustar godgod# The simplest way to view a helpbook from wxPython.tools import helpviewer helpviewer.main(['', 'Bayes.hhp']) model-builder-0.4.1.orig/model_builder/Bayes/Melding.py0000755000175000017500000005221310602020251021077 0ustar godgod# -*- coding:latin-1 -*- #----------------------------------------------------------------------------- # Name: Melding.py # Purpose: Bayesian melding # # Author: Flávio Codeço Coelho # # Created: 2003/08/10 # RCS-ID: $Id: Melding.py $ # Copyright: (c) 2003 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- ##import psyco ##psyco.full() import scipy.stats.kde as kde #from random import * #from cmath import * import pylab as P from numpy import * from numpy.random import * import lhs #import random import like import sys def model(r, p0, n=1): """ Model (r,p0, n=1) Simulates the Population dynamic Model (PDM) Pt = rP0 for n time steps. P0 is the initial population size. Example model for testing purposes. """ Pt = zeros(n, float) # initialize the output vector P = p0 for i in xrange(n): Pt[i] = r*P P = Pt[i] return Pt def Run(k): """ Run (k) Draw k samples of Theta from its prior distribution, run the model with it and obtain phi = M(theta). For testing purposes only. """ #---q1theta--------------------------------------------------------------------- #r = genprior('uniform',(2,4), k) # Uniform [2,4] #r = lhs.lhs(['r'],['Uniform'],[[2,4]],k)[0] #p0 = genprior('uniform',(0,5), k)# Uniform[0,5] #p0 = lhs.lhs(['p0'],['Uniform'],[[0,5]],k)[0] r,p0 = lhs.lhs(['r', 'p0'],['Uniform','Uniform'],[[2,4],[0,5]],k,noCorrRestr=False) q1theta = (r, p0) #------------------------------------------------------------------------------- phi=zeros(k, float) print r.shape, p0.shape for i in xrange(k): phi[i] = model(r[i], p0[i])[-1] # Sets phi[i] to the last point of the simulation return phi, q1theta def KDE(x, (ll, ul)=('','')): """ KDE(x) performs a kernel density estimate using the R function density if (ll,ul) enforce limits for the distribution. Returns a dictionary. """ #r.assign("x", x) if not ll == '': rn=arange(ll,ul,(ul-ll)/512.) #print x.shape,rn.shape est = kde.gaussian_kde(x.ravel()).evaluate(rn) #r.assign("ll", ll) #r.assign("ul", ul) #est = r('density(x,from=ll, to=ul)') #trims the density borders else: ll = min(x) ul = max(x) rn=arange(ll,ul,(ul-ll)/512.) est = kde.gaussian_kde(x).evaluate(rn) #est = r('density(x)') print 'No - KDE' return {'y':est,'x':rn} def Likeli(data, dist, limits,**kwargs): """ Generates the likelihood function of data given dist. limits is a tuple setting the interval of the parameter space that will be used as the support for the Likelihood function. returns a vector (512 elements). """ n = len(data) # Number of data points data = array(data) (ll,ul) = limits #limits for the parameter space step = (ul-ll)/512. if dist == 'normal': # In this case, L is a function of the mean. sd = std(data) #standard deviation of data prec = 1/sd #precision of the data res = [exp(like.Normal(data,mu,prec)) for mu in arange(ll,ul,step)] #empty list of results #for mu in arange(ll,ul,step): #print res#mu, sd #res.append(exp(-0.5*sum(((data-mu)/sd)**2))) # Makes a list of the likelihood of every datum. Removed this constant term from formula because of dependence on n :1./((sd*sqrt(2*pi))**n) res = array(res) lik = res/max(res) # Likelihood function print max(lik), min(lik) elif dist == 'exponential': res = [lamb**n*exp(-lamb*sum(data)) for lamb in arange(ll,ul,step)] ## for lamb in arange(ll,ul,step): ## res.append(lamb**n*exp(-lamb*sum(data))) lik = array(res)/max(array(res)) elif dist == 'bernoulli': if ll<0 or ul>1: print "Parameter p of the bernoulli is out of range[0,1]" res = [exp(like.Bernoulli(data,p)) for p in arange(ll,ul,step)] #for p in arange(ll,ul,step): #res.append(p**sum(data)*(1-p)**(n-sum(data))) #res.append(exp(flib.bernoulli(data,p))) lik = array(res)/max(array(res)) elif dist == 'poisson': res = [exp(like.Poisson(data,lb)) for lb in arange(ll,ul,step)] ## for lb in arange(ll,ul,step): ## res.append(exp(-n*lb)*(lb*sum(data))/product(factorial(data))) lik = array(res)/max(array(res)) elif dist == 'lognormal': sd = std(data) #standard deviation of data prec = 1/sd #precision of the data res = [exp(like.Lognormal(data,mu,prec)) for mu in arange(ll,ul,step)] lik = array(res)/max(array(res)) else: print 'Invalid distribution type. Valid distributions: normal, exponential, bernoulli and poisson' return lik def factorial(numb): """ calculates the factorial of a number, or a sequence of numbers. """ l = ["","",""] if not str(type(numb)) in l: n = int(numb) if n == 0: return 1 else: return n * factorial(n-1) else: res=[] for i in numb: res.append(factorial(i)) return array(res) def Filt(cond, x, (ll, ul)): """ filtering out Out-of-boundary thetas and phis. for single output models. ul and ll are the pre-model boundaries of phi. cond is a vector over which the conditional operations will be applied. x is a vector or matrix of data. matrices are filtered line by line """ #print cond.shape, x.shape, ll, ul cond = array(cond) cond = cond.ravel() if isinstance(x,tuple): l = len(x) x = array(x) x.shape = (l,x.size/float(l)) print 'shape of x is', x.shape else: print 'shape of x is', x.shape pass try: #When more filtering theta f = compress(less(cond,ul) & greater(cond,ll),x, axis=1) except: #when iltering phi f = compress(less(cond,ul) & greater(cond,ll),x) assert f.any() return f def FiltM(cond,x,limits): """ Multiple condition filtering. for multiple output models cond is an array of condition vectors x is an array of data limits is a list of tuples (ll,ul) with the length of cond """ cond = array(cond) cnd = ones(len(cond[0]),int) for i,j in zip(cond,limits): ll = j[0] ul = j[1] #print cond.shape,cnd.shape,i.shape,ll,ul cnd = cnd & less(i,ul) & greater(i,ll) f = compress(cnd,x, axis=1) assert f.any() return f def SIR(alpha,q2phi,limits,q2type,q1theta, phi,L, lik=[]): """ Sampling Importance Resampling. alpha = pooling weight; q2phi = premodel of phi(vector or a tuple of vectors); limits = limits for q2phi (tuple or list/tuple of tuples); q2type = dist. type of q2phi (string or list of strings); q1theta = premodel dists of thetas (tuple); phi = model output (vector or tuple of vectors); L = size of the resample. Lik = list of likelihoods available """ ##==On Uniform Priors we have to trim the density borders======================== ## The Density estimation with a gaussian kernel, extends beyond the limits of ## an uniform distribution, due to this fact, we clip the ends of the kde ## output in order the avoid artifacts. ##=============================================================================== np = len(q1theta) # Number of parameters(theta) in the model #---for multicompartimental models----------------------------------------------- multi = ["",""] #possible types of data structures of q2phi and phi if not str(type(phi)) in multi: (ll,ul) = limits # limits of q2phi for single compartment models no = None if str(type(q2phi)) in multi: no = len(phi) #Number of output variables q2phi = array(q2phi) q2pd =[] for i in xrange(no): (ll,ul) = limits[i] # limits of q2phi[i] if q2type[i] == 'uniform': q2pd.append(KDE(q2phi[i],(ll,ul))) else: q2pd.append(KDE(q2phi[i])) q2phi = q2pd #---for single compartiment models---------------------------------------------------------------------------- else: if q2type == 'uniform': q2phi = KDE(q2phi, (ll,ul)) #calculating the kernel density print 'Ok' else: q2phi = KDE(q2phi) print 'No - SIR1' #------------------------------------------------------------------------------- #---filtering out Out-of-boundary thetas and phis------------------------------- if str(type(phi)) in multi: #Multicompartimental models #phi = array(phi)# Convert list/tuple of vectors in array, where each vector becomes a line of the array. phi_filt=[] q1theta2 = array(q1theta) #Temporary copy to allow multiple filtering phi_filt = FiltM(phi,phi,limits) #filter Phis #print type(phi_filt) if not phi_filt.any(): print "Due to bad specification of the prior distributions or of the model\nthe inference can't continue. please verify that your priors include at least\npart of the range of the output variables." return None #Remove thetas that generate out-of-bound phis for every phi q1theta_filt = FiltM(phi,q1theta2,limits) q1theta2 = q1theta_filt ## for i in xrange(no): ## (ll,ul) = limits[i] # limits of q2phi[i] ## print 'no = %s'%no ## phi_filt.append(Filt(phi[i],phi[i],(ll,ul))) #filter Phis ## if not phi_filt[i].any(): ## print "Due to bad specification of the prior distributions or of the model\nthe inference can't continue. please verify that your priors include at least\npart of the range of the output variables." ## return None ## q1theta_filt = Filt(phi[i],q1theta2,(ll,ul)) #Remove thetas that generate out-of-bound phis for every phi ## q1theta2 = q1theta_filt phi_filt = array(phi_filt) # TODO: check to see if thetas or phis go to empty due to bad priors!!!! else: #Single compartment phi_filt = Filt(phi,phi,(ll,ul)) #remove out-of-bound phis q1theta_filt = Filt(phi,q1theta,(ll,ul)) #remove thetas that generate out-of-bound phis #------------------------------------------------------------------------------- #---Calculate Kernel Density of the filtered phis---------------------------------------------------------------------------- if no: #multicompartimental q1ed = [] for i in xrange(no): (ll,ul) = limits[i] # limits of q2phi[i] if q2type[i] == 'uniform': q1ed.append(KDE(phi_filt[i],(ll,ul))) else: q1ed.append(KDE(phi_filt[i])) q1est = q1ed else: #Single compartment if q2type == 'uniform': q1est = KDE(phi_filt,(ll,ul)) # Density of of model outputs restricted to the range determined by the Priors, so that we can pool q1est and q2phi. print 'Ok' else: q1est = KDE(phi_filt) print 'No - SIR2' #------------------------------------------------------------------------------- ##============================================================================== ##Now, the two priors for Phi q2phi (derived from prior information and q1est ##(generated by the model from the q1theta(priors on the inputs)), are pooled. ##The pooling is done by logarithmic pooling using alpha as a weighting factor. ##The higher the value of alpha the more wight is given to q1est. ##============================================================================== #---Calculating the pooled prior of Phi------------------------------------------ if no: #multicompartimental qtilphi = [] for i in xrange(no): qtilphi.append((array(q2phi[i]['y'])**(1-alpha))*(array(q1est[i]['y'])**alpha)) qtilphi = array(qtilphi) else: #Single compartment qtilphi = (array(q2phi['y'])**(1-alpha))*(array(q1est['y'])**alpha) # Pooled prior of Phi #------------------------------------------------------------------------------- #---Calculating first term of the weigth expression----------------------------- # TODO: Consider having a different alpha for each phi if no:#multicompartimental denslist=[] for i in xrange(no): #pairwise pooling of the phis and q2phis denslist.append((array(q2phi[i]['y'])/array(q1est[i]['y']))**(1-alpha)) firstterm = product(denslist,axis=0) else:#Single compartment firstterm = (array(q2phi['y'])/array(q1est['y']))**(1-alpha) #---Weights--------------------------------------------------------------------- if not lik: w = firstterm #---- without likelihoods -----# else: if len(lik)>1: prodlik = product(array(lik),axis=0) else: #only one likelihood function prodlik = lik[0] w = firstterm*prodlik #------------------------------------------------------------------------------- ##========Link weights with each phi[i]========================================= ## The weight vector (w) to be used in the resampling of the thetas is calculated ## from operations on densities. Consequently,its values are associated with ## values on the support of Phi, not with the actual Phi[i] as output by the ## model. Thus, its is necessary to recover the asso- ## ciation between the Phi[i] (the outputs of each model run), and the weights ## associated with them. For that, the support for phi is divided into 512 bins ## (the length of the weight vector), and the filtered Phi[i] are assigned to these bins ## according to their value. This mapping is represented by the variable phi_bins ## in which each element is the bin number of the correponding element in Phi. ## A new weight vector(wi) is then created in which the elements of w are posi- ## tioned according to the position of the Phi[i] to which it corresponds. That ## is: w[i] = w[phi_bin[i]] repeated for each element i. ##============================================================================== if no:#multicompartimental bin_bound = [] phi_bins = [] wi = [] for i in xrange(no): (ll,ul) = limits[i] #limits of phi step = (ul-ll)/512. bin_bound.append(arange(ll,ul,step)) # Bin boundaries of the weight vector phi_bins.append(searchsorted(bin_bound[i], phi_filt[i])) # Return a vector of the bins for each phi g = lambda x:w[x-1] # searchsorted returns 1 as the index for the first bin, not 0 phi_bins = array(phi_bins) for i in xrange(no): wi.append(map(g,phi_bins[i])) wi = mean(wi, axis=0) #ATTENTION: Should this be averaged? else: #single compartment (ll,ul) = limits step = (ul-ll)/512. bin_bound = arange(ll,ul,step) # Bin boundaries of the weight vector phi_bins = searchsorted(bin_bound, phi_filt) # Return a vector of the bins for each phi g = lambda x:w[x-1] # searchsorted returns 1 as the index for the first bin, not 0 wi = map(g,phi_bins.ravel()) #------------------------------------------------------------------------------- #---creating a biased die based on probabilities of w--------------------------- #die = cumsum(wi)#-Cumulative sum of resampling probabilities #roll = uniform(die[0],die[-1],L) ##========Resampling q1theta===================================================== ## Here, the filtered q1theta are resampled according to the weight vector. ## L values are generated as indices to the weight vector wi(resamples) and used to resample ## the parameters. ##=============================================================================== #sampled_is = searchsorted(die, roll) #qtiltheta = transpose(array(map(h,sampled_is))) #qtiltheta=zeros((np,L), Float) # Initialize the qtiltheta matrix #resamples = randint(0,len(wi),(L,))# Random order of resamples # A given value is going to be resampled if random() < wi # A column of q1theta_filt is extracted for each value in resamples q = [0]*L wi = array(wi) print wi.size, wi.shape if max(wi) == 0: sys.exit('Resampling weights are all zero, please check your model or data.') j = 0 while j < L: # Extract L samples from q1theta_filt i=randint(0,wi.size)# Random position of wi and q1theta_filt if random()<= wi[i]: #print i, q1theta_filt.shape q[j]=q1theta_filt[:,i]# retain the sample according with resampling prob. j+=1 # q is a list of arrays which is converted to an array and then transposed. print len(q) qtiltheta = transpose(array(q)) ##---teste----------------------------------------------------------------------- ## figure(1) ## subplot(311) ## plotmat(phi_filt) ## title('phi_filt') ## subplot(312) ## plotmat(q1theta_filt[0]) ## title('r_filt') ## subplot(313) ## plotmat(q1theta_filt[1]) ## title('p0_filt') return (w, qtiltheta, qtilphi, q1est) def plotmat(x, tit='title', b=50): """ This funtion implements a simple 50 bin, normalized histogram using the matplotlib module. """ P.hist(x,bins=b,normed=1) P.ylabel(tit, fontsize=18) def genprior(type, params, shape=[]): """ genprior(type, params, shape) The function returns a vector or a matrix containinin a sample of the specified distribution with size given by shape. """ seed() distlist=['uniform', 'normal', 'exponential', 'beta', 'gamma', 'chi-square', 'F', 'binomial', 'neg-binomial', 'poisson', 'multinomial'] if type == 'uniform': prior = uniform(params[0], params[1], shape) elif type == 'normal': prior = normal(params[0], params[1], shape) elif type == 'exponential': prior = exponential(params, shape) elif type == 'beta': prior = beta(params[0], params[1], shape) elif type == 'gamma': prior = gamma(params[0], params[1], shape) elif type == 'chi-square': prior = chi_square(params, shape) elif type == 'F': prior = F(params[0], params[1], shape) elif type == 'binomial': prior = binomial(params[0], params[1], shape) elif type == 'neg-binomial': prior = negative_binomial(params[0], params[1], shape) elif type == 'poisson': prior = poisson(params, shape) elif type == 'multinomial': prior = multinomial(params) else: print 'Invalid distribution type.' return prior # TODO: Implement calculation of Bayes factors! #------------------------------------------------------------------------------- ##==MAIN======================================================================== #------------------------------------------------------------------------------- def main(): """ testing function """ k = 20000 # Number of model runs L = 2000 ll = 6 ul = 9 #data = [7,8,7,8,7,8,7] data = normal(7.5,1,400) lik = [] #initialize list of likelihoods lik.append(Likeli(data,'normal',(ll,ul))) #q2phi = genprior('uniform', (ll,ul), k) # uniform[6,9] - pre-model distribution of Phi q2phi = lhs.lhs(['p'],['Uniform'],[[ll,ul]],k)[0] (phi, q1theta) = Run(k) # Runs the model print len(q1theta) #---Restricting the range of phi------------------------------------------------ (w, post_theta, qtilphi, q1est) = SIR(0.5,q2phi,(ll,ul), 'uniform',q1theta, phi,L, lik) print "out of SIR" print post_theta.shape #--generating the posterior of phi------------------------------------------------------- r = uniform(0,len(post_theta[0]),L) #random index for the marginal posterior of r p = uniform(0,len(post_theta[1]),L) #random index for the marginal posterior of p0 post_phi = zeros(L,float) #initializing post_phi for i in xrange(L): #Monte Carlo with values of the posterior of Theta post_phi[i] = model(post_theta[0][int(r[i])],post_theta[1][int(p[i])])[-1] #---Plotting with matplotlib---------------------------------------------------------------------------- P.figure(1) P.subplot(411) plotmat(post_theta[0], tit=r'$\pi^{[r]}(\theta)$') P.title('Posteriors and weight vector') P.subplot(412) plotmat(post_theta[1], tit=r'$\pi^{[P_0]}(\theta)$') P.subplot(413) plotmat(post_phi, tit=r'$\pi^{[P]}(\phi)$') ##plot(q1est['x'],qtilphi) ##ylabel(r'$P$', fontsize=12) P.subplot(414) P.plot(w) P.ylabel(r'$W_i$', fontsize=12) P.figure(2) P.subplot(411) plotmat(q1theta[0], tit=r'$\theta r$') P.title('Priors') P.subplot(412) plotmat(phi, tit=r'$\phi$') P.subplot(413) plotmat(q1theta[1], tit=r'$\theta p_0$') P.subplot(414) plotmat(q2phi, tit=r'$q_2 \phi$') P.show() if __name__ == '__main__': from time import clock start = clock() main() end = clock() print end-start, ' seconds' model-builder-0.4.1.orig/model_builder/Bayes/Meldingbas.py0000755000175000017500000000310710473670477021616 0ustar godgod#----------------------------------------------------------------------------- # Name: Melding.py # Purpose: Bayesian melding # # Author: Flávio Codeço Coelho # # Created: 2003/06/10 # RCS-ID: $Id: Melding.py $ # Copyright: (c) 2003 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- from Numeric import * from RandomArray import * from math import * #from matplotlib.matlab import * def Pooling(priors): """ Pooling(priors) Returns the logarithmic pooling of priors. priors is a list of one dimensional arrays (distributions) """ l = len(priors) # number of priors to pool alfa = 1.0/float(l) # geometric pooling print(alfa) pw=[0]*l # initializing a list with l elements for i in range(l): pw[i] = priors[i]**alfa #weighting p = product(pw) p2 = p/sum(p) #renormalization return p2 def invMod(q1,q1est,qtilphi): """ invMod(q1,q1est,qtilphi) calculates and returns qtilteta from the three argumens above. """ l = len(q1est) L = len(q1) qtilteta = zeros(L, Float) for i in range(l): qtilteta[i] = qtilphi[i]*(q1[i]/q1est[i]) # Equation 13 on Poole & Raftery, 1998 qtilteta[L-1] = 1-sum(qtilteta) return qtilteta if __name__ == '__main__': q1 = array([0.7,0.2, 0.1]) q2 = array([0.6,0.4]) q1est = array([.7,.3]) qtilphi=Pooling([q2,q1est]) print ['qtilphi = ',qtilphi] qtilteta=invMod(q1,q1est,qtilphi) print (qtilteta) pass # add a call to run your script here model-builder-0.4.1.orig/model_builder/Bayes/__init__.py0000755000175000017500000000071310745414314021274 0ustar godgod#----------------------------------------------------------------------------- # Name: __init__.py # Purpose: Package that include various modules useful for BAyesian inference # # Author: Flavio Codeco Coelho # # Created: 2003/06/10 # RCS-ID: $Id: __init__.py $ # Copyright: (c) 2003 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- # Package initialisation model-builder-0.4.1.orig/model_builder/Bayes/flib.f0000644000175000017500000010025310476603316020246 0ustar godgod real function whrand() c c Algorithm AS 183 Appl. Statist. (1982) vol.31, no.2 c c Returns a pseudo-random number rectangularly distributed c between 0 and 1. The cycle length is 6.95E+12 (See page 123 c of Applied Statistics (1984) vol.33), not as claimed in the c original article. c c IX, IY and IZ should be set to integer values between 1 and c 30000 before the first entry. c c Integer arithmetic up to 30323 is required. c integer ix, iy, iz common /randc/ ix, iy, iz c ix = 171 * mod(ix, 177) - 2 * (ix / 177) iy = 172 * mod(iy, 176) - 35 * (iy / 176) iz = 170 * mod(iz, 178) - 63 * (iz / 178) c if (ix .lt. 0) ix = ix + 30269 if (iy .lt. 0) iy = iy + 30307 if (iz .lt. 0) iz = iz + 30323 c c If integer arithmetic up to 5212632 is available, the preceding c 6 statements may be replaced by: c c ix = mod(171 * ix, 30269) c iy = mod(172 * iy, 30307) c iz = mod(170 * iz, 30323) c whrand = mod(float(ix) / 30269. + float(iy) / 30307. + + float(iz) / 30323., 1.0) return end real function uniform() c c Generate uniformly distributed random numbers using the 32-bit c generator from figure 3 of: c L`Ecuyer, P. Efficient and portable combined random number c generators, C.A.C.M., vol. 31, 742-749 & 774-?, June 1988. c c The cycle length is claimed to be 2.30584E+18 c c Seeds can be set by calling the routine set_uniform c c It is assumed that the Fortran compiler supports long variable c names, and integer*4. c integer*4 z, k, s1, s2 common /unif_seeds/ s1, s2 save /unif_seeds/ c k = s1 / 53668 s1 = 40014 * (s1 - k * 53668) - k * 12211 if (s1 .lt. 0) s1 = s1 + 2147483563 c k = s2 / 52774 s2 = 40692 * (s2 - k * 52774) - k * 3791 if (s2 .lt. 0) s2 = s2 + 2147483399 c if (z .lt. 1) z = z + 2147483562 c uniform = z / 2147483563. return end subroutine set_uniform(seed1, seed2) c c Set seeds for the uniform random number generator. c integer*4 s1, s2, seed1, seed2 common /unif_seeds/ s1, s2 save /unif_seeds/ s1 = seed1 s2 = seed2 return end SUBROUTINE rcat(hist,mn,step,n,s,k) c Returns n samples from categorical random variable (histogram) cf2py real dimension(k),intent(in) :: hist cf2py real intent(in) :: mn,step cf2py integer intent(in) :: n cf2py real dimension(n),intent(out) :: s cf2py integer intent(hide),depend(hist) :: k=len(hist) REAL hist(k),s(n),mn,step,sump,u,rand INTEGER n,k,i,j c repeat for n samples do i=1,n c initialize sum sump = 0.0 c random draw u = rand() j = 0 c find index to value 1 if (u.gt.sump) then sump = sump + hist(j+1) j = j + 1 goto 1 endif c assign value to array s(i) = mn + step*(j-1) enddo return END SUBROUTINE categor(x,hist,mn,step,n,k,like) c Categorical log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real dimension(k),intent(in) :: hist cf2py real intent(in) :: mn,step cf2py integer intent(hide),depend(x) :: n=len(x) cf2py integer intent(hide),depend(hist) :: k=len(hist) cf2py real intent(out) :: like REAL hist(k),x(n),mn,step,val,like INTEGER n,k,i,j like = 0.0 c loop over number of elements in x do i=1,n c initialize current value val = mn j = 1 c check for appropriate bin 1 if (x(i).gt.val) then c increment value val = val + step j = j + 1 goto 1 endif c increment log-likelihood like = like + log(hist(j)) enddo return END SUBROUTINE hazard(x,sigma,b,k,like) c Hazard-rate log-likelihood function (used mainly for distance sampling) cf2py real dimension(k),intent(in) :: x cf2py real intent(in) :: sigma,b cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: k=len(x) REAL x(k) INTEGER i,k REAL like,sigma,b like = 0.0 do i=1,k like = like + log(1 - exp( -(x(i) / sigma) ** (-b) )) enddo return END SUBROUTINE simple(x,w,a,start,m,n,like) cf2py real intent(in) :: w cf2py real dimension(m),intent(in) :: a cf2py integer intent(hide),depend(a) :: m=len(a) cf2py real dimension(n),intent(in) :: x cf2py integer intent(hide),depend(x) :: n=len(x) cf2py integer intent(in) :: start cf2py real intent(out) :: like real summ integer i,n,j,m real w,a(m),x(n),like like=0.0 do i=1,n summ=0.0 do j=start,m summ = summ + (a(j)*(x(i)/w)**(2*j)) enddo like = like + log(1 + summ) enddo return END SUBROUTINE cosine(x,w,a,start,n,m,like) cf2py real intent(in) :: w cf2py real dimension(m),intent(in) :: a cf2py integer intent(hide),depend(a) :: m=len(a) cf2py real dimension(n),intent(in) :: x cf2py integer intent(hide),depend(x) :: n=len(x) cf2py integer intent(in) :: start cf2py real intent(out) :: like real summ integer i,n,j,m real w,a(m),x(n),like DOUBLE PRECISION PI PARAMETER (PI=3.141592653589793238462643d0) like=0.0 do i=1,n summ=0.0 do j=start,m summ = summ + (a(j) * cos(j * PI * x(i) / w)) enddo like = like + log(1 + summ) enddo return END SUBROUTINE hermite(x,w,a,start,h,n,m,like) cf2py real intent(in) :: w cf2py real dimension(m),intent(in) :: a cf2py integer intent(hide),depend(a) :: m=len(a) cf2py real dimension(n),intent(in) :: x cf2py integer intent(hide),depend(x) :: n=len(x) cf2py integer intent(in) :: start, h cf2py real intent(out) :: like real summ,like,w integer i,n,j,m,h real a(m),x(n),herm(h) like=0.0 do i=1,n summ=0.0 do j=start,m call hermpoly(h,x(i)/w,herm) summ = summ + (a(j) * herm(h)) enddo like = like + log(1 + summ) enddo return END SUBROUTINE hyperg(x,d,red,total,n,like) c Hypergeometric log-likelihood function c Distribution models the probability of drawing x red balls in d c draws from an urn of 'red' red balls and 'total' total balls. cf2py integer dimension(n),intent(in) :: x cf2py integer intent(in) :: d,red,total cf2py integer intent(hide),depend(x) :: n=len(x) cf2py real intent(out) :: like INTEGER x(n),d,red,total INTEGER i,n REAL like like = 0.0 do i=1,n c Combinations of x red balls like = like + factln(red)-factln(x(i))-factln(red-x(i)) c Combinations of d-x other balls like = like + factln(total-red)-factln(d-x(i)) +-factln(total-red-d+x(i)) enddo c Combinations of d draws from total like = like - n * like - (factln(total)-factln(d) +-factln(total-d)) return END SUBROUTINE mvhyperg(x,color,k,like) c Multivariate hypergeometric log-likelihood function cf2py integer dimension(k),intent(in) :: x,color cf2py integer intent(hide),depend(x) :: k=len(x) cf2py real intent(out) :: like INTEGER x(k),color(k) INTEGER d,total,i,k REAL like total = 0 d = 0 like = 0.0 do i=1,k c Combinations of x balls of color i like = like + factln(color(i))-factln(x(i)) +-factln(color(i)-x(i)) d = d + x(i) total = total + color(i) enddo c Combinations of d draws from total like = like - (factln(total)-factln(d)-factln(total-d)) return END SUBROUTINE poisson(x,mu,n,like) c Poisson log-likelihood function cf2py integer dimension(n),intent(in) :: x cf2py real intent(in) :: mu cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER x(n) REAL mu,like,sumx INTEGER n,i sumx = 0.0 sumfact = 0.0 do i=1,n sumx = sumx + x(i)*log(mu) - mu sumfact = sumfact + factln(x(i)) enddo like = sumx - sumfact return END SUBROUTINE weibull(x,alpha,beta,n,like) c Weibull log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: alpha,beta cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) REAL x(n) REAL alpha,beta,like INTEGER n,i c normalizing constant like = n * (log(alpha) - alpha*log(beta)) c kernel of distribution do i=1,n like = like + (alpha-1) * log(x(i)) - (x(i)/beta)**alpha enddo return END SUBROUTINE cauchy(x,alpha,beta,n,like) c Cauchy log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: alpha,beta cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) REAL x(n) REAL alpha,beta,like INTEGER n,i PARAMETER (PI=3.141592653589793238462643d0) c normalization constant like = -n*(log(PI) + log(beta)) c kernel do i=1,n like = like - log( 1. + ((x(i)-alpha) / beta) ** 2 ) enddo return END SUBROUTINE negbin(x,r,p,n,like) c Negative binomial log-likelihood function cf2py integer dimension(n),intent(in) :: x cf2py integer intent(in) :: r cf2py real intent(in) :: p cf2py integer intent(hide),depend(x) :: m=len(x) cf2py real intent(out) :: like REAL like,p INTEGER r,n,i INTEGER x(n) like = 0.0 do i=1,n like = like + r*log(p) + x(i)*log(1.-p) like = like + factln(x(i)+r-1)-factln(x(i))-factln(r-1) enddo return END SUBROUTINE binomial(x,n,p,m,like) c Binomial log-likelihood function cf2py integer dimension(m),intent(in) :: x cf2py integer intent(in) :: n cf2py real intent(in) :: p cf2py integer intent(hide),depend(x) :: m=len(x) cf2py real intent(out) :: like REAL like,p INTEGER n,m,i INTEGER x(m) like = 0.0 do i=1,m like = like + x(i)*log(p) + (n-x(i))*log(1.-p) like = like + factln(n)-factln(x(i))-factln(n-x(i)) enddo return END SUBROUTINE bernoulli(x,p,m,like) c Binomial log-likelihood function cf2py integer dimension(m),intent(in) :: x cf2py real intent(in) :: p cf2py integer intent(hide),depend(x) :: m=len(x) cf2py real intent(out) :: like REAL like,p INTEGER m,i INTEGER x(m) like = 0.0 do i=1,m like = like + x(i)*log(p) + (1-x(i))*log(1.-p) enddo return END SUBROUTINE multinomial(x,n,p,m,like) c Multinomial log-likelihood function cf2py integer dimension(m),intent(in) :: x cf2py integer intent(in) :: n cf2py real dimension(m),intent(in) :: p cf2py integer intent(hide),depend(x) :: m=len(x) cf2py real intent(out) :: like REAL like,sump,pp REAL p(m) INTEGER m,i,n,sumx INTEGER x(m) like = 0.0 sumx = 0 sump = 0.0 do i=1,m pp = p(i)+1E-10 like = like + x(i)*log(pp) - factln(x(i)) sumx = sumx + x(i) sump = sump + pp enddo like = like + factln(n) + (n-sumx)*log(max(1.0-sump,1E-10)) +- factln(n-sumx) return END SUBROUTINE normal(x,mu,tau,n,like) c Normal log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: mu,tau cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER n,i REAL like,mu,tau REAL x(n) DOUBLE PRECISION PI PARAMETER (PI=3.141592653589793238462643d0) like = 0.0 do i=1,n like = like - 0.5 * tau * (x(i)-mu)**2 enddo like = like + n*0.5*log(0.5*tau/PI) return END SUBROUTINE hnormal(x,tau,n,like) c Half-normal log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: tau cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER n,i REAL like,tau REAL x(n) DOUBLE PRECISION PI PARAMETER (PI=3.141592653589793238462643d0) like = n * 0.5 * (log(2. * tau / PI)) do i=1,n like = like - (0.5 * x(i)**2 * tau) enddo return END SUBROUTINE lognormal(x,mu,tau,n,like) c Log-normal log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: mu,tau cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER n,i REAL like,mu,tau REAL x(n) DOUBLE PRECISION PI PARAMETER (PI=3.141592653589793238462643d0) like = n * 0.5 * (log(tau) - log(2.0*PI)) do i=1,n like = like - 0.5*tau*(log(x(i))-mu)**2 - log(x(i)) enddo return END SUBROUTINE gamma(x,alpha,beta,n,like) c Gamma log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: alpha,beta cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER i,n REAL like,alpha,beta REAL x(n) c normalizing constant like = -n * (gammln(alpha) + alpha*log(beta)) do i=1,n c kernel of distribution like = like + (alpha - 1.0)*log(x(i)) - x(i)/beta enddo return END SUBROUTINE igamma(x,alpha,beta,n,like) c Inverse gamma log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: alpha,beta cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER i,n REAL like,alpha,beta REAL x(n) c normalizing constant like = -n * (gammln(alpha) + alpha*log(beta)) do i=1,n c kernel of distribution like = like - (alpha+1.0)*log(x(i)) - 1./(x(i)*beta) enddo return END SUBROUTINE beta(x,a,b,n,like) c Beta log-likelihood function cf2py real dimension(n),intent(in) :: x cf2py real intent(in) :: a,b cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=len(x) INTEGER i,n REAL like,a,b REAL x(n) c normalizing constant like = n * (gammln(a+b) - gammln(a) - gammln(b)) do i=1,n c kernel of distribution like = like + (a-1.0)*log(x(i)) + (b-1.0)*log(1.0-x(i)) enddo return END SUBROUTINE dirichlet(x,theta,p,n,like) c Dirichlet log-likelihood function cf2py real dimension(n,p),intent(in) :: x,theta cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: n=shape(x,0), p=shape(x,1) INTEGER i,j,n,p REAL like,sumt REAL x(n,p),theta(n,p) like = 0.0 do 111 i=1,n sumt = 0.0 do 222 j=1,p c kernel of distribution like = like + (theta(i,j)-1.0)*log(x(i,j)) c normalizing constant like = like - gammln(theta(i,j)) sumt = sumt + theta(i,j) 222 continue like = like + gammln(sumt) 111 continue return END SUBROUTINE wishart(X,k,n,sigma,like) c Wishart log-likelihood function cf2py real dimension(k,k),intent(in) :: X,sigma cf2py real intent(in) :: n cf2py real intent(out) :: like cf2py integer intent(hide),depend(X) :: k=len(X) INTEGER i,k REAL X(k,k),sigma(k,k),bx(k,k) REAL dx,n,db,tbx,a,g,like c determinants call dtrm(X,k,dx) call dtrm(sigma,k,db) c trace of sigma*X call matmult(sigma,X,bx,k,k,k,k) call trace(bx,k,tbx) like = (n - k - 1)/2.0 * log(dx) like = like + (n/2.0)*log(db) like = like - 0.5*tbx like = like - (n*k/2.0)*log(2.0) do i=1,k a = (n - i + 1)/2.0 call gamfun(a, g) like = like - log(g) enddo return END SUBROUTINE mvnorm(x,mu,tau,k,like) c Multivariate normal log-likelihood function cf2py real dimension(k),intent(in) :: x,mu cf2py real dimension(k,k),intent(in) :: tau cf2py real intent(out) :: like cf2py integer intent(hide),depend(x) :: k=len(x) INTEGER i,k REAL x(k),dt(1,k),dtau(k),mu(k),d(k),tau(k,k) REAL like,det,dtaud DOUBLE PRECISION PI PARAMETER (PI=3.141592653589793238462643d0) c calculate determinant of precision matrix call dtrm(tau,k,det) c calculate d=x-mu do i=1,k d(i) = x(i)-mu(i) enddo c transpose call trans(d,dt,k,1) c mulitply t(d) by tau call matmult(dt,tau,dtau,1,k,k,k) c multiply dtau by d call matmult(dtau,d,dtaud,1,k,k,1) like = 0.5*log(det) - (k/2.0)*log(2.0*PI) - (0.5*dtaud) return END SUBROUTINE trace(mat,k,tr) c matrix trace (sum of diagonal elements) INTEGER k,i REAL mat(k,k),tr tr = 0.0 do i=1,k tr = tr + mat(k,k) enddo return END SUBROUTINE gamfun(xx,gx) c the gamma function cf2py real intent(in) :: xx cf2py real intent(out) :: gx INTEGER i REAL x,xx,ser,tmp,gx DIMENSION coeff(6) DATA coeff/76.18009173,-86.50532033,24.01409822, +-1.231739516,0.00120858003,-0.00000536382/ x = xx tmp = x + 5.5 tmp = tmp - (x+0.5) * log(tmp) ser = 1.000000000190015 do i=1,6 x = x+1 ser = ser + coeff(i)/x enddo gx = -tmp + log(2.50662827465*ser/xx) return END SUBROUTINE trans(mat,tmat,m,n) c matrix transposition cf2py real dimension(m,n),intent(in) :: mat cf2py real dimension(n,m),intent(out) :: tmat cf2py integer intent(hide),depend(mat) :: m=len(mat) cf2py integer intent(hide),depend(mat) :: n=shape(mat,1) INTEGER i,j,m,n REAL mat(m,n),tmat(n,m) do 88 i=1,m do 99 j=1,n tmat(j,i) = mat(i,j) 99 continue 88 continue return END SUBROUTINE matmult(mat1, mat2, prod, m, n, p, q) c matrix multiplication cf2py real dimension(m,q),intent(out) :: prod cf2py real dimension(m,n),intent(in) :: mat1 cf2py real dimension(p,q),intent(in) :: mat2 cf2py integer intent(hide),depend(mat1) :: m=len(mat1),n=shape(mat1,1) cf2py integer intent(hide),depend(mat2) :: p=len(mat2),q=shape(mat2,1) INTEGER i,j,k,m,n,p,q REAL mat1(m,n), mat2(p,q), prod(m,q) REAL sum if (n.eq.p) then do 30 i = 1,m do 20 j = 1,q sum = 0.0 do 10 k = 1,n sum = sum + mat1(i,k) * mat2(k,j) 10 continue prod(i,j) = sum 20 continue 30 continue else pause 'Matrix dimensions do not match' end if return END c Updated 10/24/2001. c ccccccccccccccccccccccccc Program 4.2 cccccccccccccccccccccccccc c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c c Please Note: c c c c (1) This computer program is part of the book, "An Introduction to c c Computational Physics," written by Tao Pang and published and c c copyrighted by Cambridge University Press in 1997. c c c c (2) No warranties, express or implied, are made for this program. c c c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c SUBROUTINE DTRM(A,N,D) C C Subroutine for evaluating the determinant of a matrix using C the partial-pivoting Gaussian elimination scheme. C cf2py real dimension(N,N),intent(in) :: A cf2py real intent(out) :: D cf2py integer intent(hide),depend(A) :: N=len(A) DIMENSION A(N,N),INDX(N) CALL ELGS(A,N,INDX) C D = 1.0 DO 100 I = 1, N D = D*A(INDX(I),I) 100 CONTINUE C MSGN = 1 DO 200 I = 1, N DO 150 WHILE (I.NE.INDX(I)) MSGN = -MSGN J = INDX(I) INDX(I) = INDX(J) INDX(J) = J 150 END DO 200 CONTINUE D = MSGN*D RETURN END SUBROUTINE ELGS(A,N,INDX) C Subroutine to perform the partial-pivoting Gaussian elimination. C A(N,N) is the original matrix in the input and transformed C matrix plus the pivoting element ratios below the diagonal in C the output. INDX(N) records the pivoting order. DIMENSION A(N,N),INDX(N),C(N) C Initialize the index DO 50 I = 1, N INDX(I) = I 50 CONTINUE C Find the rescaling factors, one from each row DO 100 I = 1, N C1= 0.0 DO 90 J = 1, N C1 = AMAX1(C1,ABS(A(I,J))) 90 CONTINUE C(I) = C1 100 CONTINUE C Search the pivoting (largest) element from each column DO 200 J = 1, N-1 PI1 = 0.0 DO 150 I = J, N PI = ABS(A(INDX(I),J))/C(INDX(I)) IF (PI.GT.PI1) THEN PI1 = PI K = I ELSE ENDIF 150 CONTINUE C Interchange the rows via INDX(N) to record pivoting order ITMP = INDX(J) INDX(J) = INDX(K) INDX(K) = ITMP DO 170 I = J+1, N PJ = A(INDX(I),J)/A(INDX(J),J) C Record pivoting ratios below the diagonal A(INDX(I),J) = PJ C Modify other elements accordingly DO 160 K = J+1, N A(INDX(I),K) = A(INDX(I),K)-PJ*A(INDX(J),K) 160 CONTINUE 170 CONTINUE 200 CONTINUE RETURN END FUNCTION gammln(xx) C Returns the value ln[gamma(xx)] for xx > 0. REAL gammln,xx INTEGER j DOUBLE PRECISION ser,stp,tmp,x,y,cof(6) C Internal arithmetic will be done in double precision, C a nicety that you can omit if five-figure accuracy is good enough. SAVE cof,stp DATA cof,stp/76.18009172947146d0,-86.50532032941677d0, +24.01409824083091d0,-1.231739572450155d0,.1208650973866179d-2, +-.5395239384953d-5,2.5066282746310005d0/ x=xx y=x tmp=x+5.5d0 tmp=(x+0.5d0)*log(tmp)-tmp ser=1.000000000190015d0 do j=1,6 y=y+1.d0 ser=ser+cof(j)/y enddo gammln=tmp+log(stp*ser/x) return END FUNCTION factrl(n) C Returns the value n! as a floating-point number. INTEGER n REAL factrl INTEGER j,ntop C Table to be filled in only as required. REAL a(33),gammln SAVE ntop,a C Table initialized with 0! only. DATA ntop,a(1)/0,1./ if (n.lt.0) then pause 'negative factorial in factrl' else if (n.le.ntop) then C Already in table. factrl=a(n+1) else if (n.le.32) then C Fill in table up to desired value. do j=ntop+1,n a(j+1)=j*a(j) enddo ntop=n factrl=a(n+1) else C Larger value than size of table is required. Actually, C this big a value is going to overflow on many computers, C but no harm in trying. factrl=exp(gammln(n+1.)) endif return END FUNCTION factln(n) C USES gammln Returns ln(n!). INTEGER n REAL factln REAL a(100),gammln SAVE a C Initialize the table to negative values. DATA a/100*-1./ if (n.lt.0) pause 'negative factorial in factln' C In range of the table. if (n.le.99) then C If not already in the table, put it in. if (a(n+1).lt.0.) a(n+1)=gammln(n+1.) factln=a(n+1) else C Out of range of the table. factln=gammln(n+1.) endif return END FUNCTION bico(n,k) C USES factln Returns the binomial coefficient as a C floating point number. INTEGER k,n REAL bico C The nearest-integer function cleans up roundoff error C for smaller values of n and k. bico=nint(exp(factln(n)-factln(k)-factln(n-k))) return END subroutine chol(n,a,c) c...perform a Cholesky decomposition of matrix a, returned as c implicit real*8 (a-h,o-z) real c(n,n),a(n,n) cf2py real dimension(n,n),intent(in) :: a cf2py real dimension(n,n),intent(out) :: c cf2py integer intent(in),depend(a) :: n=len(a) c(1,1) = sqrt(a(1,1)) do i=2,n c(i,1) = a(i,1) / c(1,1) enddo do j=2,n do i=j,n s = a(i,j) do k=1,j-1 s = s - c(i,k) * c(j,k) enddo if(i .eq. j) then c(j,j) = sqrt(s) else c(i,j) = s / c(j,j) c(j,i) = 0.d0 endif enddo enddo return end SUBROUTINE rbin(n,pp,x) cf2py real intent(in) :: pp cf2py integer intent(in) :: n cf2py integer intent(out) :: x INTEGER n,x REAL pp,PI C USES gammln,rand PARAMETER (PI=3.141592654) C Returns as a floating-point number an integer value that is a random deviate drawn from C a binomial distribution of n trials each of probability pp, using rand as a source C of uniform random deviates. INTEGER j,nold REAL am,em,en,g,oldg,p,pc,pclog,plog,pold,sq,t,y,gammln,rand SAVE nold,pold,pc,plog,pclog,en,oldg C Arguments from previous calls. DATA nold /-1/, pold /-1./ if(pp.le.0.5)then C The binomial distribution is invariant under changing pp to C 1.-pp, if we also change the answer to n minus itself; C we’ll remember to do this below. p=pp else p=1.-pp endif C This is the mean of the deviate to be produced. am=n*p if (n.lt.25) then C Use the direct method while n is not too large. This can C require up to 25 calls to ran1. x=0. do 11 j=1,n if(rand().lt.p) x=x+1. 11 enddo else if (am.lt.1.) then C If fewer than one event is expected out of 25 or more tri- C als, then the distribution is quite accurately Poisson. Use C direct Poisson method. g=exp(-am) t=1. do 12 j=0,n t=t*rand() if (t.lt.g) goto 1 12 enddo j=n 1 x=j else C Use the rejection method. if (n.ne.nold) then C If n has changed, then compute useful quantities. en=n oldg=gammln(en+1.) nold=n endif if (p.ne.pold) then C If p has changed, then compute useful quantities. pc=1.-p plog=log(p) pclog=log(pc) pold=p endif sq=sqrt(2.*am*pc) C The following code should by now seem familiar: rejection C method with a Lorentzian comparison function. 2 y=tan(PI*rand()) em=sq*y+am C Reject. if (em.lt.0..or.em.ge.en+1.) goto 2 C Trick for integer-valued distribution. em=int(em) t=1.2*sq*(1.+y**2)*exp(oldg-gammln(em+1.) +-gammln(en-em+1.)+em*plog+(en-em)*pclog) C Reject. This happens about 1.5 times per deviate, on average. if (rand().gt.t) goto 2 x=em endif C Remember to undo the symmetry transformation. if (p.ne.pp) x=n-x return END SUBROUTINE RNORM(U1, U2) C C ALGORITHM AS 53.1 APPL. STATIST. (1972) VOL.21, NO.3 C C Sets U1 and U2 to two independent standardized random normal C deviates. This is a Fortran version of the method given in C Knuth(1969). C C Function RAND must give a result randomly and rectangularly C distributed between the limits 0 and 1 exclusive. C REAL U1, U2 REAL RAND C C Local variables C REAL X, Y, S, ONE, TWO DATA ONE /1.0/, TWO /2.0/ C 1 X = RAND() Y = RAND() X = TWO * X - ONE Y = TWO * Y - ONE S = X * X + Y * Y IF (S .GT. ONE) GO TO 1 S = SQRT(- TWO * LOG(S) / S) U1 = X * S U2 = Y * S RETURN END SUBROUTINE WSHRT(D, N, NP, NNP, SB, SA) C C ALGORITHM AS 53 APPL. STATIST. (1972) VOL.21, NO.3 C C Wishart variate generator. On output, SA is an upper-triangular C matrix of size NP * NP (written in linear form, column ordered) C whose elements have a Wishart(N, SIGMA) distribution. C C D is an upper-triangular array such that SIGMA = D'D (see AS 6) C C Auxiliary function required: a random no. generator called RAND. C The Wichmann & Hill generator is included here. It should be C initialized in the calling program. cf2py real dimension(NNP),intent(in) :: D cf2py real dimension(NNP),intent(out) :: SA cf2py real dimension(NNP),intent(hide) :: SB cf2py integer intent(hide),depend(D) :: NNP=len(D) cf2py integer intent(in) :: NP cf2py integer intent(in) :: N INTEGER N, NP, NNP REAL D(NNP), SB(NNP), SA(NNP) C C Local variables C INTEGER K, NS, I, J, NR, IP, NQ, II REAL DF, U1, U2, RN, C REAL ZERO, ONE, TWO, NINE DATA ZERO /0.0/, ONE /1.0/, TWO /2.0/, NINE /9.0/ C K = 1 1 CALL RNORM(U1, U2) C C Load SB with independent normal (0, 1) variates C SB(K) = U1 K = K + 1 IF (K .GT. NNP) GO TO 2 SB(K) = U2 K = K + 1 IF (K .LE. NNP) GO TO 1 2 NS = 0 C C Load diagonal elements with square root of chi-square variates C DO 3 I = 1, NP DF = N - I + 1 NS = NS + I U1 = TWO / (NINE * DF) U2 = ONE - U1 U1 = SQRT(U1) C C Wilson-Hilferty formula for approximating chi-square variates C SB(NS) = SQRT(DF * (U2 + SB(NS) * U1)**3) 3 CONTINUE C RN = N NR = 1 DO 5 I = 1, NP NR = NR + I - 1 DO 5 J = I, NP IP = NR NQ = (J*J - J) / 2 + I - 1 C = ZERO DO 4 K = I, J IP = IP + K - 1 NQ = NQ + 1 C = C + SB(IP) * D(NQ) 4 CONTINUE SA(IP) = C 5 CONTINUE C DO 7 I = 1, NP II = NP - I + 1 NQ = NNP - NP DO 7 J = 1, I IP = (II*II - II) / 2 C = ZERO DO 6 K = I, NP IP = IP + 1 NQ = NQ + 1 C = C + SA(IP) * SA(NQ) 6 CONTINUE SA(NQ) = C / RN NQ = NQ - 2 * NP + I + J - 1 7 CONTINUE C RETURN END C SUBROUTINE hermpoly( n, x, cx ) C******************************************************************************* C CC HERMPOLY evaluates the Hermite polynomials at X. C C Differential equation: C C Y'' - 2 X Y' + 2 N Y = 0 C C First terms: C C 1 C 2 X C 4 X**2 - 2 C 8 X**3 - 12 X C 16 X**4 - 48 X**2 + 12 C 32 X**5 - 160 X**3 + 120 X C 64 X**6 - 480 X**4 + 720 X**2 - 120 C 128 X**7 - 1344 X**5 + 3360 X**3 - 1680 X C 256 X**8 - 3584 X**6 + 13440 X**4 - 13440 X**2 + 1680 C 512 X**9 - 9216 X**7 + 48384 X**5 - 80640 X**3 + 30240 X C 1024 X**10 - 23040 X**8 + 161280 X**6 - 403200 X**4 + 302400 X**2 - 30240 C C Recursion: C C H(0,X) = 1, C H(1,X) = 2*X, C H(N,X) = 2*X * H(N-1,X) - 2*(N-1) * H(N-2,X) C C Norm: C C Integral ( -Infinity < X < Infinity ) exp ( - X**2 ) * H(N,X)**2 dX C = sqrt ( PI ) * 2**N * N! C C H(N,X) = (-1)**N * exp ( X**2 ) * dn/dXn ( exp(-X**2 ) ) C C Modified: C C 01 October 2002 C C Author: C C John Burkardt C C Reference: C C Milton Abramowitz and Irene Stegun, C Handbook of Mathematical Functions, C US Department of Commerce, 1964. C C Larry Andrews, C Special Functions of Mathematics for Engineers, C Second Edition, C Oxford University Press, 1998. C C Parameters: C C Input, integer N, the highest order polynomial to compute. C Note that polynomials 0 through N will be computed. C C Input, real ( kind = 8 ) X, the point at which the polynomials are C to be evaluated. C C Output, real ( kind = 8 ) CX(0:N), the values of the first N+1 Hermite C polynomials at the point X. C cf2py real intent(in) :: x cf2py integer intent(in) :: n cf2py real dimension(n+1),intent(out) :: cx integer n,i real cx(n+1) real x if ( n < 0 ) then return end if cx(1) = 1.0 if ( n == 0 ) then return end if cx(2) = 2.0 * x do i = 3, n+1 cx(i) = 2.0 * x * cx(i-1) - 2.0 * real(i - 1) * cx(i-2) end do return end model-builder-0.4.1.orig/model_builder/Bayes/gibbs.py0000755000175000017500000000201610473670477020635 0ustar godgod# -*- coding:iso8859-1 -*- #----------------------------------------------------------------------------- # Name: gibbs.py # Purpose: This simple routine implements a simple Gibbs sampler. # # Author: Flávio Codeço Coelho # # Created: 2003/25/09 # RCS-ID: $Id: module1.py $ # Copyright: (c) 2003 # Licence: GPL # Acknowledgements: Whatever #----------------------------------------------------------------------------- from math import * from RandomArray import * from matplotlib.pylab import * n=10000 rho=.99 #correlation #Means m1 = 10 m2 = 20 #Standar deviations s1 = 1 s2 = 1 #Initialize vectors x=zeros(n, Float) y=zeros(n, Float) sd=sqrt(1-rho**2) # the core of the method: sample recursively from two normal distributions # Tthe mean for the current sample, is updated at each step. for i in range(1,n): x[i] = normal(m1+rho*(y[i-1]-m2)/s2,s1*sd) y[i] = normal(m2+rho*(x[i-1]-m1)/s1,s2*sd) scatter(x,y,marker='d',c='r') title('Amostrador de Gibbs') xlabel('x') ylabel('y') grid() show() model-builder-0.4.1.orig/model_builder/Bayes/kde1d.py0000755000175000017500000001464210473670477020547 0ustar godgod# -*- coding:iso8859-1 -*- #----------------------------------------------------------------------------- # Name: kde1d.py # Purpose: Univariate Kernel density estimator # # Author: Flávio Codeço Coelho # # Created: 2003/22/12 # RCS-ID: $Id: kde1d.py $ # Copyright: (c) 2003 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- #from FFT import * #from MLab import * #from cmath import * #from crat import * from RandomArray import * def KDE(x, A, k='knorm', h=0): """ performs the kernel density estimation and returns (y,h) where y is the KDE for each point of x x is a vector containing the points at which the estimates are to be calculated A contains the data h is window width will be optimal if not specified. k is the kernel for the estimation: 'KNORM' Univariate Normal 'KEPAN' epanechnikov kernel 'KBIWE' Bi-weight kernel 'KTRIA' triangular kernel 'KRECT' Rectangular Kernel """ n = len(A) if h == 0: h= hste(A,k) #calculate optimal window size if k == 'knorm': soma = knorm((x-A*ones(len(x), Float))/h) for i in xrange(2,n): #Sum Over all data points soma += knorm((x-A[i]*ones(len(x), Float))/h) y = soma/(n*h) return [y,h] def hste(A,k): """ Solve the equation Estimate of h A is data k is kernel type returns h """ n = len(A) inc = 512. if k == 'knorm': R = 1/(2*sqrt(pi)) mu2 = 1 r = 4 P = inc*2 xmin = min(A) xmax = max(A) rangex = xmax-xmin if siqr(A) > 0: s = min([std(A), siqr(A)/1.34]) else: s = std(A) ax = xmin-rangex/8. bx = xmax+rangex/8. xa = linspace(ax,bx,inc) #x axis vector, i.e. where the kernel density function will be evaluated c = zeros(int(inc), Float) deltax = (bx-ax)/float((inc-1)) binx = (floor((A-ax)/deltax)+1).astype(Int) #obtain the grid counts for i in xrange(n): c[binx[i]] = c[binx[i]]+(xa[binx[i]+1]-A[i])/deltax c[binx[i]+1] = c[binx[i]+1]+(A[i]-xa[binx[i]])/deltax psi6 = -15/(16*sqrt(pi)*s**7) psi8 = 105/(32*sqrt(pi)*s**9) k40 = deriv(0,k)[0] g1 = (-2*k40/(mu2*psi6*n))**(1./7.) [k40,k60] = deriv(0,k)[:2] g2 = (-2*k60/(mu2*psi8*n))**(1./9) #estimate psi6 #obtain the kernel weights [kw4,kw6] = deriv((bx-ax)*arange(inc)/((inc-1)*g2),k)[:2] #apply 'fftshift' to kw kw= concatenate((kw6,zeros(1),kw6[int(inc-1):0:-1]),1) #perform the convolution #z = inverse_real_fft(fft(c,P)*fft(kw)) z = convolve(ravel(c),kw) psi6 = sum(c*z[:int(inc)])/(n*(n-1)*g2*7) psi6 = sum(psi6) #Now estimate psi4 #obtain the kernel weights kw4 = deriv((bx-ax)*arange(inc)/((inc-1)*g1),k)[0] #apply 'fftshift' to kw kw = concatenate((kw4,zeros(1),kw4[int(inc)-1:0:-1]),1) #perform the convolution #z = inverse_real_fft(fft(c,P)*fft(kw)) z = convolve(ravel(c),kw) psi4 = sum(c*z[:int(inc)])/(n*(n-1)*g1**5) psi4 = sum(psi4) ho = 0. h=hns(A,k) k40 = deriv(0,k)[0] while abs(ho-h)/abs(h) > 0.01: temp = h gamma = ((2*k40*mu2*psi4*h**5)/(-psi6*R))**(1/7.) #now estimate psi4 #Obtain the kernel weights t = (bx-ax)*arange(inc)/((inc-1)*gamma) kw4 = deriv(t,k)[0] #Apply 'fftshift' to kw kw = concatenate((kw4,zeros(1),kw4[int(inc)-1:0:-1]),1) #perform the convolution #z = inverse_real_fft(fft(c,P)*fft(kw)) z = convolve(ravel(c),kw) #print c.shape,kw.shape num = c*z[:int(inc)] p4 = sum(num)/(n*(n-1)*gamma**5) h = mu2**(-2/5.)*R**(1/5.)*(p4*n)**(-1/5.) #print abs(ho-h)/abs(h) ho = temp return h def hns(A,k): """ Basic Normal Scale estimate of Smoothing Parameter. A is the data, k is the kernel type. This function evaluates an 'optimal' value of h for use with univariate data A and kernel k. 'KNORM' Univariate Normal; 'KEPAN' epanechnikov kernel; 'KBIWE' Bi-weight kernel; 'KTRIW' is the tri-weight kernel; 'KTRIA' triangular kernel; 'KRECT' Rectangular Kernel; 'KLAPL' Laplace kernel; 'KLOGI' Logistic kernel. """ n = len(A) if k == 'knorm': a = 1.0592 elif k == 'kepan': a = 2.34 elif k =='kbiwe': a = 2.7779 elif k == 'ktria': a = 2.5760 elif k == 'krect': a = 1.8431 elif k == 'klapl': a = 0.7836 elif k == 'ktriw': a = 3.1545 elif k == 'klogi': a = 0.5921 if siqr(A) > 0: s = min((std(A), siqr(A)/1.34)) else: s = std(A) h = a*s*n**(-1/5.) return h def siqr(x): """ Calculates the sample interquartile range of x """ n = len(x) order = sort(x) mlo = int(ceil(n/4.)) mhi = int(ceil(3*n/4.)) if mlo > 0 & mlo < n: zlo = (order[mlo]+order[mlo+1])/2. if mhi > 0 & mhi < n: zhi = (order[mhi]+order[mhi+1])/2. y = zhi-zlo return y def deriv(t,k): """ 4th, 6th, 8th and 10th derivative of the Normal kernel This function finds the derivatives kernel k at point t. (only normal kernel ) """ if k == 'knorm': y4 = (t**4-6*t**2+3)*exp(-0.5*t**2)/sqrt(2*pi) y6 = (t**6-15*t**4+45*t**2-15)*exp(-0.5*t**2)/sqrt(2*pi) y8 = (t**8-28*t**6+210*t**4-420*t**2+105)*exp(-0.5*t**2)/sqrt(2*pi) y10 = (t**10-45*t**8+630*t**6-3150*t**4+4725*t**2-945)*exp(-0.5*t**2)/sqrt(2*pi) return (y4,y6,y8,y10) def knorm(x,y=None,z=None): """ Uni-, Bi- or Tri-variate Normal density function """ if z != None: s = x*x+y*y+z*z d = 3 elif y != None: s = x*x+y*y d = 2 else: s = x*x d = 1 k = (2*pi)**(-d/2.)*exp(-0.5*s) return k if __name__ == '__main__': import matplotlib matplotlib.use('WX') from pylab import * A = normal(.5,1,5000) x = arange(-5,5,0.002) [y,h] = KDE(x,A) nb, bins, patches = hist(A, bins=20, normed=1) plot(x,y,'r-o') show() model-builder-0.4.1.orig/model_builder/Bayes/lhs.py0000755000175000017500000001106510603206240020313 0ustar godgod#----------------------------------------------------------------------------- # Name: lhs.py # Purpose: Implements the Latin Hypercube Sampling technique as described by # Iman and Conover, 1982, including correlation control both for no # correlation or for a specified correlation matrix for the sampled # parameters. # # Author: Antonio Guilherme Pacheco, Flavio Codeco Coelho # # Created: 2006/08/27 # RCS-ID: $Id: lhs.py $ # Copyright: (c) 2004 # Licence: gpl # New field: Whatever #----------------------------------------------------------------------------- #!/usr/bin/python """ Implements the Latin Hypercube Sampling technique as described by Iman and Conover, 1982, including correlation control both for no correlation or for a specified correlation matrix for the sampled parameters """ from pylab import plot, figure,hist,show #import random import scipy.stats as stats import numpy, sys from numpy.linalg import cholesky,inv #import psyco #psyco.full() valid_dists = ['normal','triangular','uniform'] def rank_restr(nparms=4, Iter=100, noCorrRestr=True, matCorr=None): """ Does the correlation control. """ x=[numpy.arange(1,Iter+1)for i in xrange(nparms)] if noCorrRestr: for i in xrange(nparms): numpy.random.shuffle(x[i]) #x.append(numpy.array(random.sample(xrange(1,Iter+1), Iter))) return x else: if matCorr==None: C=numpy.core.numeric.identity(nparms) else: C=numpy.matrix(matCorr) s0=numpy.arange(1.,Iter+1)/(Iter+1.) s=stats.norm().ppf(s0) s1=[] for i in xrange(nparms): numpy.random.shuffle(s) s1.append(s.copy()) S=numpy.matrix(s1) #print S,S.shape E=numpy.corrcoef(S) P=cholesky(C) Q=cholesky(E) Final=S.transpose()*inv(Q).transpose()*P.transpose() for i in xrange(nparms): x.append(stats.stats.rankdata(Final.transpose()[i,])) return x def sample_cum(Iter=100): """ Calculates samples on the quantile axis One sample per quantile """ perc = numpy.arange(0,1,1./Iter) smp = [stats.uniform(i,1./Iter).rvs()[0] for i in perc] return smp def sample_dist(cum, dist='normal', parms=[0,1]): """ Return a sample from from the given distribution by inverting the cumulative prob. density function """ if dist == 'normal': if len(parms) == 2: n = stats.norm(parms[0],1./parms[1]) d = n.ppf(cum) elif dist=='triangular': if len(parms) ==3 and parms[0]<=parms[1]<=parms[2]: loc=parms[0] scale=parms[2]-parms[0] t = stats.triang((float(parms[1])-loc)/scale,loc=loc,scale=scale) d = t.ppf(cum) elif dist == 'uniform': loc = parms[0] scale = parms[1]-parms[0] d = stats.uniform(loc,scale).ppf(cum) else: sys.exit('%s is an unsupported distribution!'%dist) return d def lhs(Pars, dists, parms, Iter=100, noCorrRestr=True, matCorr=None): """ Returns tuple of vectors Pars: list of strings with parameter names dists: List of strings with distribution names Iter: sample size defaults to no correlation between sampled parameters """ ParsList=[] if len(Pars)==len(dists): indexes=rank_restr(nparms=len(dists), Iter=Iter, noCorrRestr=noCorrRestr, matCorr=matCorr) for i in xrange(len(dists)): v=sample_dist(sample_cum(Iter), dist=dists[i], parms=parms[i]) index=map(int,indexes[i]-1) ParsList.append(v[index]) return ParsList if __name__=='__main__': #c=lhs(['Par1', 'Par2', 'Par3'],['Normal','Triangular','Uniform'], [[0,1], [1,5,8], [1,2]],100000) c=lhs(['Par1', 'Par2', 'Par3'],['normal','triangular','uniform'], [[0,1], [1,5,8], [1,2]],10000, noCorrRestr=True) # m=[[1,.3595,-.2822],[.3595,1,-.1024],[-.2822,-.1024,1]] # c=lhs(['Par1', 'Par2', 'Par3'],['Normal','Triangular','Uniform'], [[0,1], [1,5,8], [1,2]],100000, noCorrRestr=False, matCorr=m) print stats.spearmanr(c[0],c[1]) print stats.spearmanr(c[0],c[2]) print stats.spearmanr(c[1],c[2]) ## print c ## print 'done!' #a=sample_cum(10000) #b=sample_dist(a, dist='Triangular', parms=[1,5,8]) #plot(b,a, 'bo') ## print c[0].shape,c[1].shape,c[2].shape ## print c[0][0], type(c[0][0]) hist(c[0], bins=30) figure() hist(c[1], bins=30) figure() hist(c[2], bins=30) show() model-builder-0.4.1.orig/model_builder/Bayes/like.py0000644000175000017500000000630410600275302020450 0ustar godgod#-*-encoding:latin-1-*1 # Funções de log verossimilhança # copyright 2007 by Flávio Codeço Coelho # License: GPL # import scipy from scipy.special import gammaln from numpy import * def Categor(x,hist): """ Log-like categorica x: vetor de dados hist: tupla (prob,classes) classes contem L.S. da classe >>> Categor([1],([.3,.7],[0,1])) -0.356674943939 """ like =0.0 x = array(x) prob = array(hist[0]) sup = array(hist[1]) ind = searchsorted(sup,x) like += sum(log(prob[ind])) return like def Normal(x,mu,tau): """ Log-like normal mu: média tau: precisao (1/sd) >>> Normal([0],0,1) -0.918938533205 """ x = array(x) n = x.size like = sum(-0.5 * tau * (x-mu)**2) like += n*0.5*log(0.5*tau/pi) return like def Lognormal(x,mu,tau): """ Log-like Lognormal mu: média tau: precisao (1/sd) >>> Lognormal([0.5,1,1.2],0,0.5) -3.15728720569 """ x = array(x) n = x.size like = n * 0.5 * (log(tau) - log(2.0*pi)) + sum(0.5*tau*(log(x)-mu)**2 - log(x)) return like def Poisson(x,mu): """ Log-Like Poisson >>> Poisson([2],2) -1.30685281944 """ x=array(x) sumx = sum(x*log(mu)-mu) sumfact = sum(log(scipy.factorial(x))) like = sumx-sumfact return like def Negbin(x,r,p): """ Log-Like negative Binomial >>> Negbin([2,3],6,0.3) -9.16117424315 """ x = array(x) like = sum(r*log(p)+x*log(1-p)+log(scipy.factorial(x+r-1))-log(scipy.factorial(x))-log(scipy.factorial(r-1))) return like def Binomial(x,n,p): """ Log-Like Binomial >>> Binomial([2,3],6,0.3) -2.81280615454 """ x = array(x) like = sum(x*log(p)+ (n-x)*log(1.-p)+log(scipy.factorial(n))-log(scipy.factorial(x))-log(scipy.factorial(n-x))) return like def Weibull(x,alpha,beta): """ Log-Like Weibull >>> Weibull([2,1,0.3,.5,1.7],1.5,3) -7.811955373 """ x=array(x) beta = float(beta) n = x.size #Normalizing constant like = n * (log(alpha) - alpha*log(beta)) # Kernel of the distribution like += sum((alpha-1) * log(x) - (x/beta)**alpha) return like def Bernoulli(x,p): """ Log-Like Bernoulli >>> Bernoulli([0,1,1,1,0,0,1,1],0.5) -5.54517744448 """ x=array(x) like = sum(x*log(p) + (1-x)*log(1.-p)) return like def Gamma(x,alpha,beta): """ Log-Like Gamma >>> Gamma([2,3,7,6,4],2,2) -11.015748357 """ x = array(x) beta = float(beta) n = x.size #Normalizing constant like = -n * (gammaln(alpha) + alpha*log(beta)) # Kernel of the distribution like += sum((alpha - 1.0)*log(x) - x/beta) return like def Beta(x,a,b): """ Log-Like Beta >>> Beta([.2,.3,.7,.6,.4],2,5) -0.434845728904 """ x = array(x) n = x.size #Normalizing constant like = n * (gammaln(a+b) - gammaln(a) - gammaln(b)) # Kernel of the distribution like += sum((a-1.0)*log(x) + (b-1.0)*log(1.0-x)) return like def Simple(x,w,a,start=0): """ find out what it is. not implemented. """ m=len(a) n=len(x) pass if __name__=="__main__": import doctest doctest.testmod(verbose=True) model-builder-0.4.1.orig/model_builder/Bayes/metropolis.py0000755000175000017500000000226110473670477021746 0ustar godgod#!/usr/bin/env python #----------------------------------------------------------------------------- # Name: metropolis.py # Purpose: Metropolis hastings sampler # # Author: Flávio Codeço Coelho # # Created: 2003/25/09 # RCS-ID: $Id: module1.py $ # Copyright: (c) 2003 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- from math import * from RandomArray import * from matplotlib.pylab import * def sdnorm(z): """ Standard normal pdf (Probability Density Function) """ return exp(-z*z/2.)/sqrt(2*pi) n = 10000 alpha = 1 x = 0. vec = [] vec.append(x) innov = uniform(-alpha,alpha,n) #random inovation, uniform proposal distribution for i in xrange(1,n): can = x + innov[i] #candidate aprob = min([1.,sdnorm(can)/sdnorm(x)]) #acceptance probability u = uniform(0,1) if u < aprob: x = can vec.append(x) #plotting the results: #theoretical curve x = arange(-3,3,.1) y = sdnorm(x) subplot(211) title('Metropolis-Hastings') plot(vec) subplot(212) hist(vec, bins=30,normed=1) plot(x,y,'ro') ylabel('Frequency') xlabel('x') legend(('PDF','Samples')) show() model-builder-0.4.1.orig/model_builder/Bayes/rejectBayes.py0000755000175000017500000000444510473670477022017 0ustar godgod# -*- coding:iso8859-1 -*- #----------------------------------------------------------------------------- # Name: rejectBayes.py # Purpose: The Bayes theorem by the rejection sampling algorithm. # # Author: Flávio Codeço Coelho (fccoelho@cienciaaberta.org> # # Created: 2003/26/09 # RCS-ID: $Id: rejection.py $ # Copyright: (c) 2003 # Licence: GPL #----------------------------------------------------------------------------- from math import * from RandomArray import * from matplotlib.pylab import * def Likeli(data, limits, nl): """ Generates the likelihood function of data assuming a normal distribution. limits is a tuple setting the interval be used as the support for the Likelihood function. returns a vector. """ n = len(data) # Number of data points data = array(data) (ll,ul) = limits #limits for the parameter space step = (ul-ll)/float(nl) res = [] #empty list of results sd = std(data) #standard deviation of data for mu in arange(ll,ul,step): res.append(exp(-0.5*sum(((data-mu)/sd)**2))) lik = array(res)/max(array(res)) # Likelihood function return lik def sampler(n, data): """ This function samples from x and returns a vector shorter that len(vector size) """ x=uniform(0,1,n) #support limits = 0,1 L=Likeli(data, limits, n) fx=6*x*(1-x) # prior, f(x) is a beta(2,2) PDF #return only those x values that satisfy the condition s=compress(L[:len(x)] # # Created: 2003/26/09 # RCS-ID: $Id: rejection.py $ # Copyright: (c) 2003,2004,2005 # Licence: GPL #----------------------------------------------------------------------------- from math import * from RandomArray import * from matplotlib.pylab import * def sampler(n): """ This function samples from x and returns a vetor shorter that len(vector size) """ x=uniform(0,1,n) #Sample y=uniform(0,1,n)*1.5 #Envelope fx=6*x*(1-x) # Target. x has a beta distribution s=compress(y 2eqs.ode sin(t)*y[1]+10 cos(p[0]*(t+1))*y[0]-10 2 10.0 (array([[ 1. , 2. ], [ 2.00643704, 0.92282897], [ 3.01066458, -0.24535659], [ 3.98796902, -1.52647749], [ 4.91085649, -2.92924229], [ 5.74974928, -4.44706601], [ 6.4745164 , -6.05785571], [ 7.0566759 , -7.72595908], [ 7.47192678, -9.40623457], [ 7.70255132, -11.04978082], [ 7.73921283, -12.61047163], [ 7.58177755, -14.05121154], [ 7.23899246, -15.348843 ], [ 6.72709936, -16.4969104 ], [ 6.06769129, -17.50593531], [ 5.28526068, -18.40134768], [ 4.40491833, -19.21960762], [ 3.45068461, -20.0032577 ], [ 2.44460275, -20.79565258], [ 1.40674354, -21.63597945], [ 0.35600133, -22.55499734], [ -0.68855155, -23.57176845], [ -1.70607141, -24.69157412], [ -2.67246643, -25.90519705], [ -3.55937966, -27.18976303], [ -4.33390763, -28.5113019 ], [ -4.95920789, -29.82905168], [ -5.39597903, -31.10127314], [ -5.60460035, -32.29200251], [ -5.54753885, -33.37783725], [ -5.19152076, -34.35364874], [ -4.50896612, -35.23613634], [ -3.47831539, -36.06441223], [ -2.08312123, -36.89728098], [ -0.31007533, -37.80741032], [ 1.8535785 , -38.87303061], [ 4.42259595, -40.16803813], [ 7.41552139, -41.75139432], [ 10.85503877, -43.65658084], [ 14.76636973, -45.8817331 ], [ 19.17345504, -48.38106574], [ 24.09297875, -51.05839452], [ 29.52668192, -53.76391915], [ 35.45284608, -56.29580254], [ 41.81826128, -58.40822583], [ 48.53233477, -59.82724764], [ 55.46511042, -60.27477462], [ 62.45071308, -59.49928241], [ 69.29702209, -57.30991908], [ 75.80125173, -53.60884865], [ 81.76978163, -48.415836 ], [ 87.03937666, -41.87968102], [ 91.4962487 , -34.27328535], [ 95.08951504, -25.97244189], [ 97.83654254, -17.42193664], [ 99.81920095, -9.09517262], [ 101.17174973, -1.45445992], [ 102.0624895 , 5.08187889], [ 102.67208409, 10.16191394], [ 103.17152281, 13.51146672], [ 103.70219607, 14.93663571], [ 104.35980067, 14.32141212], [ 105.18307416, 11.62461487], [ 106.14788183, 6.87935649], [ 107.16696689, 0.1962874 ], [ 108.09560629, -8.23049574], [ 108.74328099, -18.11814562], [ 108.8910762 , -29.09495866], [ 108.31378567, -40.71009678], [ 106.8046979 , -52.45626431], [ 104.20005564, -63.80560805], [ 100.39958493, -74.25554321], [ 95.37962005, -83.37794261], [ 89.19635943, -90.86325319], [ 81.97853056, -96.55136205], [ 73.91079133, -100.44348703], [ 65.21099446, -102.6933107 ], [ 56.10549199, -103.57980567], [ 46.80671739, -103.46746923], [ 37.49642533, -102.76117146], [ 28.31653026, -101.8624012 ], [ 19.36789989, -101.13187402], [ 10.71610046, -100.86109522], [ 2.40216924, -101.25338144], [ -5.54396106, -102.41357807], [ -13.08982753, -104.3453915 ], [ -20.18882968, -106.95564282], [ -26.77249387, -110.06538099], [ -32.74789045, -113.42815579], [ -38.00074454, -116.7554661 ], [ -42.40387579, -119.74835913], [ -45.82962408, -122.13258887], [ -48.16406252, -123.69317981], [ -49.32028341, -124.30329287], [ -49.24808867, -123.94249768], [ -47.93807721, -122.70103651], [ -45.41930921, -120.7691493 ], [ -41.7510864 , -118.41319774], [ -37.01066325, -115.94256448], [ -31.27949788, -113.67235556], [ -24.63086379, -111.88674407]]), {'nfe': array([ 37, 49, 57, 63, 69, 73, 77, 81, 85, 89, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 139, 145, 149, 153, 157, 161, 165, 169, 171, 175, 177, 181, 183, 189, 191, 195, 199, 203, 207, 209, 213, 217, 219, 223, 225, 229, 231, 235, 239, 241, 245, 247, 251, 257, 259, 265, 275, 281, 289, 291, 295, 301, 305, 309, 317, 323, 329, 333, 337, 341, 345, 349, 353, 355, 359, 363, 367, 371, 373, 377, 381, 385, 387, 393, 403, 409, 417, 421, 425, 429, 433, 437, 441, 445, 447, 451, 455, 457, 461, 465]), 'nje': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'nqu': array([5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7]), 'tolsf': array([ 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322]), 'lenrw': 52, 'tcur': array([ 0.10534465, 0.21542142, 0.3194078 , 0.41339316, 0.52368199, 0.61894581, 0.71420964, 0.80947346, 0.90473729, 1.00000111, 1.14289685, 1.23816067, 1.3334245 , 1.42868832, 1.52395215, 1.61921597, 1.7144798 , 1.80974362, 1.90500744, 2.00027127, 2.11369581, 2.22712036, 2.31294225, 2.40896967, 2.50499709, 2.60102451, 2.71729625, 2.85381233, 2.92207037, 3.05858644, 3.12684448, 3.26336055, 3.33161859, 3.45344615, 3.50701567, 3.61415472, 3.72129376, 3.82843281, 3.94547017, 4.00893802, 4.13587371, 4.2628094 , 4.32627725, 4.45321294, 4.51668078, 4.64361647, 4.70708432, 4.83402001, 4.9609557 , 5.02442355, 5.15135924, 5.21482708, 5.34570593, 5.45375012, 5.50777221, 5.60665822, 5.70676711, 5.80324167, 5.95536052, 6.0110048 , 6.12229337, 6.22315532, 6.31359065, 6.40402599, 6.50889468, 6.61376337, 6.7319255 , 6.82842482, 6.92492414, 7.02142347, 7.12580267, 7.23806176, 7.35032085, 7.4064504 , 7.51870948, 7.63096857, 7.74322766, 7.85548675, 7.91161629, 8.02387538, 8.13613447, 8.24839356, 8.3045231 , 8.4023183 , 8.50648244, 8.60200233, 8.72936218, 8.85775773, 8.9090592 , 9.01166213, 9.11426506, 9.21686799, 9.33480603, 9.45274406, 9.51171308, 9.62965111, 9.74758914, 9.80655816, 9.93184774, 10.06448888]), 'hu': array([ 0.02741782, 0.02066474, 0.03132846, 0.03132846, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.04763191, 0.03780818, 0.03780818, 0.04801371, 0.04801371, 0.04801371, 0.04801371, 0.06825804, 0.06825804, 0.06825804, 0.06825804, 0.06825804, 0.06825804, 0.06825804, 0.05356952, 0.05356952, 0.05356952, 0.05356952, 0.05356952, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06346785, 0.06543943, 0.05402209, 0.05402209, 0.04486392, 0.03215819, 0.03215819, 0.05564428, 0.05564428, 0.05564428, 0.04521767, 0.04521767, 0.04521767, 0.03495623, 0.03495623, 0.04824966, 0.04824966, 0.04824966, 0.04824966, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.05612954, 0.02083283, 0.02083283, 0.03183996, 0.03183996, 0.06419778, 0.05130147, 0.05130147, 0.05130147, 0.05130147, 0.05896902, 0.05896902, 0.05896902, 0.05896902, 0.05896902, 0.05896902, 0.06632057, 0.06632057]), 'imxer': -1214171296, 'leniw': 22, 'tsw': array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'message': 'Integration successful.', 'nst': array([ 16, 21, 25, 28, 31, 33, 35, 37, 39, 41, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 65, 68, 70, 72, 74, 76, 78, 80, 81, 83, 84, 86, 87, 89, 90, 92, 94, 96, 98, 99, 101, 103, 104, 106, 107, 109, 110, 112, 114, 115, 117, 118, 120, 122, 123, 125, 128, 131, 135, 136, 138, 140, 142, 144, 147, 150, 153, 155, 157, 159, 161, 163, 165, 166, 168, 170, 172, 174, 175, 177, 179, 181, 182, 185, 190, 193, 197, 199, 200, 202, 204, 206, 208, 210, 211, 213, 215, 216, 218, 220]), 'mused': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])}) 0.0 1 2 0.1 [array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2. , 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3. , 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4. , 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5. , 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6. , 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7. , 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8. , 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9. , 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10. ])] model-builder-0.4.1.orig/model_builder/Examples/3eqs.ode0000644000175000017500000003177110476603432021251 0ustar godgod 3eqs.ode sin(t)*y[2] cos(2*(t+1))*y[0] exp(-t)*y[1] 10.0 (array([[ 1. , 2. , 3. ], [ 1.01562367, 1.94931723, 3.1880976 ], [ 1.06464285, 1.88026336, 3.35315768], [ 1.14949721, 1.79187932, 3.49639779], [ 1.27159321, 1.68281591, 3.61906694], [ 1.43133672, 1.55205273, 3.72242806], [ 1.62818819, 1.39975382, 3.80778943], [ 1.86074001, 1.22812513, 3.87656213], [ 2.12681604, 1.04213414, 3.93032035], [ 2.423591 , 0.84996295, 3.97084492], [ 2.74772501, 0.66310008, 4.00013676], [ 3.09550518, 0.49601619, 4.02039383], [ 3.46298435, 0.36542293, 4.03395261], [ 3.84610651, 0.28916253, 4.0432007 ], [ 4.2408095 , 0.2848198 , 4.05047127], [ 4.64309853, 0.36817916, 4.05793181], [ 5.04908779, 0.55166583, 4.06747954], [ 5.45501175, 0.84291237, 4.0806542 ], [ 5.85721147, 1.24358133, 4.09857596], [ 6.25210423, 1.7485547 , 4.1219129 ], [ 6.63614643, 2.34557433, 4.15087941], [ 7.00579975, 3.01538626, 4.18526347], [ 7.35750949, 3.73240839, 4.22447903], [ 7.68770149, 4.46590414, 4.2676375 ], [ 7.99280136, 5.18160813, 4.31363179], [ 8.26927636, 5.84371239, 4.3612261 ], [ 8.5136974 , 6.41708741, 4.40914459], [ 8.72281615, 6.86958456, 4.45615325], [ 8.89365067, 7.17424815, 4.50113015], [ 9.0235723 , 7.31126086, 4.54312056], [ 9.11038676, 7.26945909, 4.58137495], [ 9.15240326, 7.04727967, 4.6153694 ], [ 9.1484874 , 6.65304777, 4.644809 ], [ 9.09809492, 6.10456338, 4.66961644], [ 9.00128593, 5.4280089 , 4.68990826], [ 8.85872051, 4.65625537, 4.70596235], [ 8.67163816, 3.82669863, 4.71817994], [ 8.44182446, 2.97879575, 4.72704582], [ 8.17156845, 2.1514961 , 4.73308949], [ 7.86361445, 1.38076723, 4.73685005], [ 7.52111135, 0.69740433, 4.73884643], [ 7.14756175, 0.12528447, 4.73955417], [ 6.74677245, -0.31981382, 4.73938926], [ 6.32280723, -0.63075406, 4.73869867], [ 5.8799418 , -0.80893051, 4.73775718], [ 5.42262078, -0.86353796, 4.73676933], [ 4.95541576, -0.810307 , 4.73587544], [ 4.48298395, -0.66983017, 4.73516036], [ 4.01002659, -0.46563328, 4.73466378], [ 3.54124677, -0.22216174, 4.73439108], [ 3.08130635, 0.03714788, 4.73432371], [ 2.63478226, 0.29155404, 4.73442849], [ 2.20612238, 0.52432515, 4.73466542], [ 1.79960162, 0.72359145, 4.73499376], [ 1.41927891, 0.88268705, 4.73537629], [ 1.06895575, 0.99998369, 4.73578193], [ 0.75213703, 1.0782645 , 4.73618699], [ 0.47199489, 1.12372636, 4.73657514], [ 0.23133594, 1.14473304, 4.73693676], [ 0.03257241, 1.15045875, 4.73726764], [-0.12230241, 1.14956956, 4.7375675 ], [-0.23173442, 1.14908074, 4.73783855], [-0.29462433, 1.15350684, 4.73808416], [-0.31033856, 1.16438911, 4.73830786], [-0.27871557, 1.18024386, 4.73851265], [-0.20006735, 1.19693167, 4.73870059], [-0.07517629, 1.20840256, 4.73887275], [ 0.09471263, 1.20773318, 4.73902931], [ 0.30790431, 1.1883403 , 4.73916987], [ 0.56227038, 1.14523488, 4.7392938 ], [ 0.85527047, 1.07617409, 4.73940058], [ 1.18397764, 0.98257596, 4.73949014], [ 1.54510768, 0.87008154, 4.73956305], [ 1.93505202, 0.74868203, 4.73962064], [ 2.34991396, 0.63236899, 4.73966502], [ 2.78554774, 0.53831199, 4.73969896], [ 3.2376001 , 0.48561446, 4.73972571], [ 3.70155395, 0.49374189, 4.73974874], [ 4.17277351, 0.58075167, 4.73977155], [ 4.64655069, 0.76147853, 4.73979734], [ 5.11815212, 1.04584021, 4.73982882], [ 5.58286631, 1.43742398, 4.73986807], [ 6.03605067, 1.9324964 , 4.73991638], [ 6.47317774, 2.51954636, 4.73997425], [ 6.88988031, 3.17942928, 4.74004139], [ 7.28199497, 3.88613104, 4.74011681], [ 7.6456036 , 4.60811613, 4.74019893], [ 7.97707255, 5.31017687, 4.74028577], [ 8.27308891, 5.95565246, 4.74037508], [ 8.53069367, 6.50885551, 4.74046454], [ 8.74731139, 6.93752041, 4.7405519 ], [ 8.92077601, 7.21508328, 4.74063514], [ 9.04935261, 7.322613 , 4.74071253], [ 9.13175484, 7.25023805, 4.74078274], [ 9.16715784, 6.99795277, 4.74084487], [ 9.1552066 , 6.57573451, 4.74089843], [ 9.09601947, 6.00295833, 4.74094334], [ 8.99018706, 5.3071509 , 4.74097989], [ 8.83876626, 4.52217838, 4.74100862], [ 8.64326971, 3.68600725, 4.74103033], [ 8.40565063, 2.83821003, 4.74104594]]), {'nfe': array([ 27, 35, 43, 47, 53, 57, 61, 63, 69, 73, 77, 81, 85, 87, 91, 95, 99, 101, 103, 107, 109, 111, 115, 117, 119, 121, 123, 125, 129, 133, 135, 137, 139, 143, 145, 147, 149, 151, 155, 157, 159, 161, 165, 167, 169, 171, 173, 179, 181, 185, 187, 191, 193, 197, 197, 203, 207, 209, 213, 215, 219, 221, 225, 227, 229, 231, 235, 237, 239, 241, 247, 249, 251, 253, 255, 259, 261, 263, 265, 267, 271, 273, 273, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, 305, 307, 309, 311, 313]), 'nje': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'tolsf': array([ 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320, 2.02369289e-320]), 'nqu': array([4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9]), 'lenrw': 68, 'tcur': array([ 0.10410601, 0.20417229, 0.32870234, 0.41382151, 0.54150027, 0.62661944, 0.75246977, 0.81539494, 0.91764015, 1.01988535, 1.12213056, 1.22437577, 1.34231117, 1.40127887, 1.51921427, 1.63714967, 1.75508507, 1.83033273, 1.90558039, 2.0560757 , 2.13132336, 2.20657102, 2.35706633, 2.43231399, 2.53097745, 2.6296409 , 2.72830436, 2.82696782, 2.90863378, 3.07196572, 3.15363169, 3.23529766, 3.31696363, 3.48029557, 3.56196154, 3.6436275 , 3.72529347, 3.80695944, 3.97029138, 4.05195735, 4.13362332, 4.21528929, 4.37862122, 4.46028719, 4.54195316, 4.62361913, 4.7052851 , 4.85492915, 4.92290722, 5.05886338, 5.12684146, 5.26279761, 5.33077569, 5.50477955, 5.50477955, 5.67221034, 5.74105925, 5.80990817, 5.94760601, 6.01645492, 6.15415276, 6.22300167, 6.37102695, 6.4502033 , 6.52937966, 6.60855601, 6.76690872, 6.84608508, 6.92526143, 7.00443779, 7.17123125, 7.25462798, 7.33802471, 7.42142144, 7.50481817, 7.67161163, 7.75500836, 7.83840509, 7.92180182, 8.00519855, 8.19782483, 8.30705438, 8.30705438, 8.4887814 , 8.5796449 , 8.67050841, 8.76137192, 8.85223542, 8.94309893, 9.03396243, 9.12482594, 9.21568945, 9.32769738, 9.43970531, 9.55171324, 9.6449315 , 9.73814976, 9.83136803, 9.92458629, 10.01780455]), 'hu': array([ 0.01890063, 0.03113251, 0.03113251, 0.04255959, 0.04255959, 0.04255959, 0.06292517, 0.06292517, 0.0511226 , 0.0511226 , 0.0511226 , 0.0511226 , 0.0589677 , 0.0589677 , 0.0589677 , 0.0589677 , 0.0589677 , 0.07524766, 0.07524766, 0.07524766, 0.07524766, 0.07524766, 0.07524766, 0.07524766, 0.09866346, 0.09866346, 0.09866346, 0.09866346, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.08166597, 0.06797808, 0.06797808, 0.06797808, 0.06797808, 0.06797808, 0.06797808, 0.10602578, 0.10602578, 0.0837154 , 0.06884892, 0.06884892, 0.06884892, 0.06884892, 0.06884892, 0.06884892, 0.07917636, 0.07917636, 0.07917636, 0.07917636, 0.07917636, 0.07917636, 0.07917636, 0.07917636, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.08339673, 0.10922955, 0.10922955, 0.10922955, 0.09086351, 0.09086351, 0.09086351, 0.09086351, 0.09086351, 0.09086351, 0.09086351, 0.09086351, 0.09086351, 0.11200793, 0.11200793, 0.11200793, 0.09321826, 0.09321826, 0.09321826, 0.09321826, 0.09321826]), 'imxer': 32, 'leniw': 23, 'tsw': array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'message': 'Integration successful.', 'nst': array([ 12, 16, 20, 22, 25, 27, 29, 30, 32, 34, 36, 38, 40, 41, 43, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 79, 80, 81, 82, 83, 85, 86, 88, 89, 91, 92, 94, 94, 96, 97, 98, 100, 101, 103, 104, 106, 107, 108, 109, 111, 112, 113, 114, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 128, 129, 129, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147]), 'mused': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])}) 0.0 1 2 3 0.1 model-builder-0.4.1.orig/model_builder/Examples/HH.ode0000755000175000017500000007252210473670501020675 0ustar godgod(dp0 S'start' p1 S'0' p2 sS'step' p3 S'0.1' p4 sS'results' p5 (cscipy array_constructor p6 ((I101 I4 tp7 S'd' p8 S'\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\x00\x00\x00\x00\x00\x00N\xc0\t\x00\x00\x00\x00\x00N\xc0' p9 I1 tp10 Rp11 (dp12 S'nfe' p13 g6 ((I100 tp14 S'i' p15 S'"\x00\x00\x00#\x00\x00\x00(\x00\x00\x00(\x00\x00\x00(\x00\x00\x00)\x00\x00\x00)\x00\x00\x00)\x00\x00\x00*\x00\x00\x00*\x00\x00\x00*\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x00/\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x000\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x001\x00\x00\x006\x00\x00\x006\x00\x00\x006\x00\x00\x00' p16 I1 tp17 Rp18 sS'nje' p19 g6 ((I100 tp20 g15 S'\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00' p21 I1 tp22 Rp23 sS'tolsf' p24 g6 ((I100 tp25 g8 S'[2]*(1-y[2]*(1-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x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00' p31 I1 tp32 Rp33 sS'lenrw' p34 I84 sS'tcur' p35 g6 ((I100 tp36 g8 S'\xa23$\xc4\x0ed\xbf?Z\xfc=\xe46\x0c\xd1?\x9e\xedS\xa5N\xb9\xe1?\x9e\xedS\xa5N\xb9\xe1?\x9e\xedS\xa5N\xb9\xe1?\x10\xdd\x88\xd8\x81\xec\xea?\x10\xdd\x88\xd8\x81\xec\xea?\x10\xdd\x88\xd8\x81\xec\xea?A\xe6\xde\x85\xda\x0f\xf2?A\xe6\xde\x85\xda\x0f\xf2?A\xe6\xde\x85\xda\x0f\xf2?\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@\xde\xe4y\xa1\xf6\x03\x10@,\x10|\xa1\xf6\x83\x1b@,\x10|\xa1\xf6\x83\x1b@,\x10|\xa1\xf6\x83\x1b@,\x10|\xa1\x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\x1d\xbfP\xfb\x81#@\xbd\x1d\xbfP\xfb\x81#@\xbd\x1d\xbfP\xfb\x81#@\xbd\x1d\xbfP\xfb\x81#@\xbd\x1d\xbfP\xfb\x81#@\xbd\x1d\xbfP\xfb\x81#@\x91}2\xd4~@C@\x91}2\xd4~@C@\x91}2\xd4~@C@' p37 I1 tp38 Rp39 sS'hu' p40 g6 ((I100 tp41 g8 S'\xaf\x91\x16\x07\xa2\xd5\xa2?\xe3\xdeifff\xc2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\xe3\xdeifff\xd2?\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9cV\x04\x00\x00\x00\x07@\x9c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1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?Z\xfc=\xe46\x0c\xd1?' p49 I1 tp50 Rp51 sS'message' p52 S'Integration successful.' p53 sS'nst' p54 g6 ((I100 tp55 g15 S'\x19\x00\x00\x00\x1a\x00\x00\x00\x1b\x00\x00\x00\x1b\x00\x00\x00\x1b\x00\x00\x00\x1c\x00\x00\x00\x1c\x00\x00\x00\x1c\x00\x00\x00\x1d\x00\x00\x00\x1d\x00\x00\x00\x1d\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00\x1f\x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00 \x00\x00\x00!\x00\x00\x00!\x00\x00\x00!\x00\x00\x00' p56 I1 tp57 Rp58 sS'mused' p59 g6 ((I100 tp60 g15 S'\x01\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00' p61 I1 tp62 Rp63 stp64 sS'end' p65 S'10' p66 sS'name' p67 NsS'parameters' p68 S'0.01*(y[0]+10)/(exp(1+0.1*y[0])-1)\n0.125*exp(y[0]/80)\n0.1*(y[0]+25)/(exp(0.1*y[0]+2.5)-1)\n4*exp(y[0]/18)\n0.07*exp(y[0]/20)\n1/(exp(3+0.1*y[0])+1)\n1\n-115\n12\n10.613\n120\n36\n0.3' p69 sS'type' p70 S'ODE' p71 sS'equations' p72 S'-p[11]*(y[2]**4)*(y[0]-p[8])-p[10]*(y[1]**3)*y[3]*(y[0]-p[7])-p[12]*(y[0]-p[9])\np[2]*(1-y[1])-p[3]*y[1]\np[0]*(1-y[2])-p[1]*y[2]\np[4]*(1-y[3])-p[5]*y[3]' p73 sS'init' p74 S'-60 -60 -60 -60' p75 sS'trange' p76 g6 ((I101 tp77 g8 S'\x00\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xb9?\x9a\x99\x99\x99\x99\x99\xc9?433333\xd3?\x9a\x99\x99\x99\x99\x99\xd9?\x00\x00\x00\x00\x00\x00\xe0?333333\xe3?ffffff\xe6?\x99\x99\x99\x99\x99\x99\xe9?\xcc\xcc\xcc\xcc\xcc\xcc\xec?\xff\xff\xff\xff\xff\xff\xef?\x99\x99\x99\x99\x99\x99\xf1?333333\xf3?\xcd\xcc\xcc\xcc\xcc\xcc\xf4?gfffff\xf6?\x01\x00\x00\x00\x00\x00\xf8?\x9b\x99\x99\x99\x99\x99\xf9?533333\xfb?\xcf\xcc\xcc\xcc\xcc\xcc\xfc?ifffff\xfe?\x01\x00\x00\x00\x00\x00\x00@\xce\xcc\xcc\xcc\xcc\xcc\x00@\x9b\x99\x99\x99\x99\x99\x01@hfffff\x02@533333\x03@\x02\x00\x00\x00\x00\x00\x04@\xcf\xcc\xcc\xcc\xcc\xcc\x04@\x9c\x99\x99\x99\x99\x99\x05@ifffff\x06@633333\x07@\x03\x00\x00\x00\x00\x00\x08@\xd0\xcc\xcc\xcc\xcc\xcc\x08@\x9d\x99\x99\x99\x99\x99\t@jfffff\n@733333\x0b@\x04\x00\x00\x00\x00\x00\x0c@\xd1\xcc\xcc\xcc\xcc\xcc\x0c@\x9e\x99\x99\x99\x99\x99\r@kfffff\x0e@833333\x0f@\x02\x00\x00\x00\x00\x00\x10@hfffff\x10@\xce\xcc\xcc\xcc\xcc\xcc\x10@433333\x11@\x9a\x99\x99\x99\x99\x99\x11@\x00\x00\x00\x00\x00\x00\x12@ffffff\x12@\xcc\xcc\xcc\xcc\xcc\xcc\x12@233333\x13@\x98\x99\x99\x99\x99\x99\x13@\xfe\xff\xff\xff\xff\xff\x13@dfffff\x14@\xca\xcc\xcc\xcc\xcc\xcc\x14@033333\x15@\x96\x99\x99\x99\x99\x99\x15@\xfc\xff\xff\xff\xff\xff\x15@bfffff\x16@\xc8\xcc\xcc\xcc\xcc\xcc\x16@.33333\x17@\x94\x99\x99\x99\x99\x99\x17@\xfa\xff\xff\xff\xff\xff\x17@`fffff\x18@\xc6\xcc\xcc\xcc\xcc\xcc\x18@,33333\x19@\x92\x99\x99\x99\x99\x99\x19@\xf8\xff\xff\xff\xff\xff\x19@^fffff\x1a@\xc4\xcc\xcc\xcc\xcc\xcc\x1a@*33333\x1b@\x90\x99\x99\x99\x99\x99\x1b@\xf6\xff\xff\xff\xff\xff\x1b@\\fffff\x1c@\xc2\xcc\xcc\xcc\xcc\xcc\x1c@(33333\x1d@\x8e\x99\x99\x99\x99\x99\x1d@\xf4\xff\xff\xff\xff\xff\x1d@Zfffff\x1e@\xc0\xcc\xcc\xcc\xcc\xcc\x1e@&33333\x1f@\x8c\x99\x99\x99\x99\x99\x1f@\xf2\xff\xff\xff\xff\xff\x1f@,33333 @_fffff @\x92\x99\x99\x99\x99\x99 @\xc5\xcc\xcc\xcc\xcc\xcc @\xf8\xff\xff\xff\xff\xff @+33333!@^fffff!@\x91\x99\x99\x99\x99\x99!@\xc4\xcc\xcc\xcc\xcc\xcc!@\xf7\xff\xff\xff\xff\xff!@*33333"@]fffff"@\x90\x99\x99\x99\x99\x99"@\xc3\xcc\xcc\xcc\xcc\xcc"@\xf6\xff\xff\xff\xff\xff"@)33333#@\\fffff#@\x8f\x99\x99\x99\x99\x99#@\xc2\xcc\xcc\xcc\xcc\xcc#@\xf5\xff\xff\xff\xff\xff#@' p78 I1 tp79 Rp80 s.model-builder-0.4.1.orig/model_builder/Examples/bmeld_example.ode0000644000175000017500000000070410476603432023164 0ustar godgod bmeld_example.ode sin(t)*y[2] cos(p[0]*(t+1))*y[0] exp(-t)*y[1] 2 10.0 0.1 0.0 1 2 3 model-builder-0.4.1.orig/model_builder/Examples/exponencial.ode0000644000175000017500000000055710534766650022710 0ustar godgod exponencial.ode p[0]*y[0]-p[1]*y[0] 0.2 0.1 50 0.1 0 2 model-builder-0.4.1.orig/model_builder/Examples/gastric.ode0000644000175000017500000002773210476603432022034 0ustar godgod bmeld_example.ode sin(t)*y[2] cos(p[0]*(t+1))*y[0] exp(-t)*y[1] 2 10.0 0.1 0.0 1 2 3 gastric.ode -p[0]*y[0]*p[1] -p[0]*y[1]*p[1]+y[0] 1 0.5 10 (array([[ 1. , 1. ], [ 0.95122943, 1.04635234], [ 0.90483742, 1.08580488], [ 0.86070798, 1.11892035], [ 0.81873075, 1.14622307], [ 0.77880079, 1.16820115], [ 0.74081822, 1.18530914], [ 0.70468809, 1.19796973], [ 0.67032005, 1.20657606], [ 0.63762816, 1.21149347], [ 0.60653066, 1.2130613 ], [ 0.57694981, 1.21159458], [ 0.54881164, 1.20738556], [ 0.52204578, 1.20070523], [ 0.49658531, 1.19180469], [ 0.47236656, 1.18091637], [ 0.44932897, 1.16825529], [ 0.42741494, 1.1540203 ], [ 0.40656966, 1.13839504], [ 0.38674103, 1.12154896], [ 0.36787944, 1.10363831], [ 0.34993775, 1.08480701], [ 0.33287109, 1.06518746], [ 0.31663677, 1.04490133], [ 0.30119421, 1.02406032], [ 0.2865048 , 1.00276679], [ 0.27253179, 0.98111445], [ 0.25924026, 0.95918897], [ 0.24659696, 0.93706847], [ 0.23457029, 0.91482413], [ 0.22313016, 0.89252065], [ 0.21224797, 0.8702167 ], [ 0.20189652, 0.84796539], [ 0.19204991, 0.82581462], [ 0.18268352, 0.80380752], [ 0.17377394, 0.78198276], [ 0.16529889, 0.76037491], [ 0.15723716, 0.7390147 ], [ 0.14956862, 0.71792939], [ 0.14227407, 0.69714297], [ 0.13533528, 0.67667644], [ 0.1287349 , 0.65654803], [ 0.12245643, 0.63677345], [ 0.11648416, 0.61736606], [ 0.11080316, 0.59833708], [ 0.10539922, 0.57969575], [ 0.10025884, 0.56144954], [ 0.09536916, 0.54360424], [ 0.09071795, 0.52616414], [ 0.08629359, 0.50913217], [ 0.082085 , 0.49251 ], [ 0.07808167, 0.47629817], [ 0.07427358, 0.46049619], [ 0.07065121, 0.44510265], [ 0.06720551, 0.43011528], [ 0.06392786, 0.4155311 ], [ 0.06081006, 0.40134642], [ 0.05784432, 0.38755695], [ 0.05502322, 0.3741579 ], [ 0.05233971, 0.36114397], [ 0.04978707, 0.34850948], [ 0.04735892, 0.33624836], [ 0.0450492 , 0.32435426], [ 0.04285213, 0.31282053], [ 0.0407622 , 0.30164031], [ 0.03877421, 0.29080656], [ 0.03688317, 0.28031207], [ 0.03508435, 0.27014952], [ 0.03337327, 0.2603115 ], [ 0.03174564, 0.25079053], [ 0.03019738, 0.24157907], [ 0.02872464, 0.23266958], [ 0.02732372, 0.22405452], [ 0.02599113, 0.21572637], [ 0.02472353, 0.20767762], [ 0.02351775, 0.19990084], [ 0.02237077, 0.19238864], [ 0.02127974, 0.1851337 ], [ 0.02024191, 0.17812882], [ 0.0192547 , 0.17136684], [ 0.01831564, 0.16484075], [ 0.01742238, 0.15854361], [ 0.01657268, 0.15246861], [ 0.01576442, 0.14660907], [ 0.01499558, 0.14095842], [ 0.01426423, 0.13551022], [ 0.01356856, 0.13025816], [ 0.01290681, 0.12519608], [ 0.01227734, 0.12031793], [ 0.01167857, 0.11561781], [ 0.011109 , 0.11108996], [ 0.0105672 , 0.10672876], [ 0.01005184, 0.10252872], [ 0.0095616 , 0.0984845 ], [ 0.00909528, 0.09459088], [ 0.0086517 , 0.0908428 ], [ 0.00822975, 0.08723532], [ 0.00782838, 0.08376364], [ 0.00744658, 0.0804231 ], [ 0.00708341, 0.07720916], [ 0.00673795, 0.07411742]]), {'nfe': array([ 23, 27, 33, 33, 35, 39, 41, 43, 45, 49, 51, 51, 53, 53, 57, 57, 59, 61, 61, 63, 63, 65, 67, 67, 69, 71, 71, 71, 73, 73, 75, 75, 77, 77, 79, 79, 81, 81, 83, 83, 83, 85, 85, 87, 87, 87, 89, 89, 91, 91, 91, 93, 93, 93, 95, 95, 97, 97, 97, 99, 99, 101, 101, 101, 103, 103, 103, 103, 105, 105, 105, 107, 107, 107, 109, 109, 109, 111, 111, 111, 113, 113, 113, 115, 115, 115, 117, 117, 117, 119, 119, 119, 121, 121, 121, 121, 123, 123, 123, 125]), 'nje': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'tolsf': array([ 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322, 4.49599738e-322]), 'nqu': array([4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]), 'lenrw': 52, 'tcur': array([ 0.13158409, 0.20743846, 0.40011702, 0.40011702, 0.51694121, 0.61335039, 0.70975956, 0.80616874, 0.90257791, 1.09539626, 1.28821461, 1.28821461, 1.48103296, 1.48103296, 1.63909142, 1.63909142, 1.79714987, 1.95520833, 1.95520833, 2.11326678, 2.11326678, 2.27132524, 2.42938369, 2.42938369, 2.58744215, 2.80421569, 2.80421569, 2.80421569, 3.02098924, 3.02098924, 3.23776278, 3.23776278, 3.45453633, 3.45453633, 3.67130987, 3.67130987, 3.88808342, 3.88808342, 4.10485696, 4.10485696, 4.10485696, 4.36454586, 4.36454586, 4.62423476, 4.62423476, 4.62423476, 4.88392365, 4.88392365, 5.14361255, 5.14361255, 5.14361255, 5.40330145, 5.40330145, 5.40330145, 5.66299034, 5.66299034, 5.92267924, 5.92267924, 5.92267924, 6.18236813, 6.18236813, 6.49202951, 6.49202951, 6.49202951, 6.80169088, 6.80169088, 6.80169088, 6.80169088, 7.11135226, 7.11135226, 7.11135226, 7.42101363, 7.42101363, 7.42101363, 7.73067501, 7.73067501, 7.73067501, 8.04033638, 8.04033638, 8.04033638, 8.34999776, 8.34999776, 8.34999776, 8.65965913, 8.65965913, 8.65965913, 8.97505159, 8.97505159, 8.97505159, 9.29044404, 9.29044404, 9.29044404, 9.6058365 , 9.6058365 , 9.6058365 , 9.6058365 , 9.92122896, 9.92122896, 9.92122896, 10.23662141]), 'hu': array([ 0.03792718, 0.03792718, 0.11682419, 0.11682419, 0.11682419, 0.09640918, 0.09640918, 0.09640918, 0.09640918, 0.09640918, 0.19281835, 0.19281835, 0.19281835, 0.19281835, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.15805845, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.21677355, 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.2596889 , 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.30966137, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246, 0.31539246]), 'imxer': -1246606144, 'leniw': 22, 'tsw': array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'message': 'Integration successful.', 'nst': array([10, 12, 15, 15, 16, 17, 18, 19, 20, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 32, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 40, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 59]), 'mused': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])}) 0 1 1 0.1 model-builder-0.4.1.orig/model_builder/Examples/lotka-volterra.ode0000644000175000017500000003100210476603432023327 0ustar godgod lotka-volterra.ode p[0]*y[0]-p[1]*y[0]*y[1] -p[1]*y[1]+y[0]*y[1] 3 2 10 1 1 (array([[ 1. , 1. ], [ 1.11554315, 0.90983991], [ 1.2646427 , 0.83880785], [ 1.45147254, 0.78639145], [ 1.68032324, 0.7527083 ], [ 1.95458794, 0.73880641], [ 2.27502466, 0.74705612], [ 2.63690217, 0.78167021], [ 3.02565397, 0.8493181 ], [ 3.41112997, 0.95956344], [ 3.74219047, 1.12424934], [ 3.94714768, 1.35386843], [ 3.95011232, 1.64835085], [ 3.70942752, 1.9833288 ], [ 3.25874997, 2.30382476], [ 2.70438436, 2.54226571], [ 2.16623808, 2.65394247], [ 1.71941576, 2.63639596], [ 1.38422155, 2.51855539], [ 1.14875994, 2.33868861], [ 0.99160735, 2.12983513], [ 0.89324788, 1.91528311], [ 0.83934226, 1.70944769], [ 0.82054123, 1.5202879 ], [ 0.83142021, 1.35156707], [ 0.86947443, 1.2045273 ], [ 0.93438405, 1.07901968], [ 1.02751525, 0.97424084], [ 1.15156208, 0.88921641], [ 1.3102197 , 0.82313808], [ 1.50776339, 0.77563404], [ 1.74836843, 0.74703596], [ 2.03493808, 0.73869869], [ 2.36711157, 0.75342389], [ 2.73804474, 0.79601389], [ 3.12964587, 0.87388168], [ 3.50663669, 0.9973322 ], [ 3.81195106, 1.17839182], [ 3.97029112, 1.42592223], [ 3.91032182, 1.73477872], [ 3.60723594, 2.07234579], [ 3.11689286, 2.37740417], [ 2.55628272, 2.58500289], [ 2.03746507, 2.66106201], [ 1.62001267, 2.61341381], [ 1.31306735, 2.47548971], [ 1.10044627, 2.28512176], [ 0.96055066, 2.07289692], [ 0.87512606, 1.85955827], [ 0.8312362 , 1.65756811], [ 0.82067949, 1.47357779], [ 0.83889116, 1.31054544], [ 0.88400486, 1.16925413], [ 0.95618771, 1.04932275], [ 1.05718874, 0.94986331], [ 1.19000004, 0.86991655], [ 1.35851848, 0.80876453], [ 1.56707437, 0.76619437], [ 1.81964746, 0.7427739 ], [ 2.11851401, 0.74019429], [ 2.46197118, 0.76172759], [ 2.84072744, 0.81281011], [ 3.23273843, 0.90162373], [ 3.59723939, 1.03914544], [ 3.87142177, 1.23725903], [ 3.97790038, 1.50242543], [ 3.85303218, 1.82339419], [ 3.49156327, 2.15911783], [ 2.97016441, 2.44397278], [ 2.41143513, 2.61828293], [ 1.91607563, 2.65938274], [ 1.52847473, 2.58409811], [ 1.2485357 , 2.42879955], [ 1.05720009, 2.23008129], [ 0.93327614, 2.01592621], [ 0.85988545, 1.804659 ], [ 0.82544364, 1.60696803], [ 0.82281686, 1.42834609], [ 0.84823413, 1.27105166], [ 0.90042136, 1.13547864], [ 0.98000162, 1.02105904], [ 1.08908362, 0.92685021], [ 1.23093455, 0.85192947], [ 1.40962095, 0.79568738], [ 1.62947466, 0.75808901], [ 1.89418714, 0.73996205], [ 2.20525075, 0.74336589], [ 2.55936963, 0.77208429], [ 2.94444056, 0.83223078], [ 3.33403211, 0.93276681], [ 3.68161567, 1.08522387], [ 3.91909654, 1.3009136 ], [ 3.9689874 , 1.5830087 ], [ 3.77868544, 1.91319894], [ 3.36441872, 2.2422985 ], [ 2.8209755 , 2.50257695], [ 2.27136741, 2.64200724], [ 1.80247684, 2.64945442], [ 1.44456633, 2.54918987], [ 1.19020937, 2.37912271], [ 1.01864525, 2.17401472]]), {'nfe': array([ 27, 35, 41, 47, 53, 59, 63, 67, 75, 81, 85, 95, 101, 111, 119, 129, 137, 143, 151, 157, 163, 169, 175, 179, 185, 189, 193, 197, 199, 203, 207, 209, 213, 219, 225, 231, 237, 245, 251, 259, 267, 275, 283, 291, 297, 305, 311, 317, 321, 327, 331, 337, 341, 345, 349, 351, 355, 359, 361, 367, 373, 377, 383, 387, 397, 403, 411, 419, 427, 435, 443, 449, 457, 463, 467, 473, 479, 483, 487, 491, 495, 499, 503, 505, 509, 513, 517, 525, 529, 535, 541, 547, 555, 563, 571, 579, 587, 595, 601, 609]), 'nje': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'tolsf': array([ 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320, 4.04738577e-320]), 'nqu': array([4, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]), 'lenrw': 52, 'tcur': array([ 0.10436196, 0.2079358 , 0.30701911, 0.41377435, 0.52436557, 0.64117216, 0.72733037, 0.81348859, 0.92729318, 1.0333814 , 1.10410689, 1.21882317, 1.30486038, 1.4090652 , 1.50275857, 1.61987528, 1.71911011, 1.80600451, 1.92186372, 2.00875812, 2.11530662, 2.22185511, 2.33314162, 2.41364998, 2.53441252, 2.61492088, 2.73436901, 2.85381714, 2.9135412 , 3.03298934, 3.15243747, 3.21216153, 3.33160967, 3.42663089, 3.50434906, 3.62092631, 3.73750355, 3.83014909, 3.92279463, 4.00972767, 4.11040503, 4.2110824 , 4.31175977, 4.42155329, 4.50617747, 4.6190097 , 4.72226376, 4.83483275, 4.90987875, 5.02244774, 5.10563537, 5.24262926, 5.33395852, 5.42528777, 5.54838824, 5.60993848, 5.73303895, 5.85613942, 5.91768965, 6.02889674, 6.1191988 , 6.20048923, 6.32242486, 6.40371529, 6.53026331, 6.62517433, 6.70755604, 6.80904546, 6.91053488, 7.0120243 , 7.12552804, 7.21065585, 7.32415959, 7.43617192, 7.5108468 , 7.62285913, 7.73487145, 7.82650383, 7.9181362 , 8.00976858, 8.10140096, 8.22461935, 8.34783775, 8.40944694, 8.53266534, 8.65588373, 8.70531631, 8.83558141, 8.91641392, 9.0376627 , 9.10962104, 9.20424731, 9.33041566, 9.40647419, 9.50788558, 9.60929696, 9.71370136, 9.82708481, 9.91212239, 10.03452489]), 'hu': array([ 0.01875915, 0.03302777, 0.03302777, 0.03686374, 0.03686374, 0.04307911, 0.04307911, 0.04307911, 0.03536274, 0.03536274, 0.03536274, 0.02867907, 0.02867907, 0.02342334, 0.02342334, 0.02342334, 0.0289648 , 0.0289648 , 0.0289648 , 0.0289648 , 0.03551617, 0.03551617, 0.04025418, 0.04025418, 0.04025418, 0.04025418, 0.05972407, 0.05972407, 0.05972407, 0.05972407, 0.05972407, 0.05972407, 0.05972407, 0.04751061, 0.03885908, 0.03885908, 0.03885908, 0.03088185, 0.03088185, 0.02516934, 0.02516934, 0.02516934, 0.02516934, 0.02820806, 0.02820806, 0.02820806, 0.037523 , 0.037523 , 0.037523 , 0.037523 , 0.04566463, 0.04566463, 0.04566463, 0.04566463, 0.06155023, 0.06155023, 0.06155023, 0.06155023, 0.06155023, 0.04965685, 0.04064521, 0.04064521, 0.04064521, 0.04064521, 0.03163701, 0.03163701, 0.02537235, 0.02537235, 0.02537235, 0.02537235, 0.02837594, 0.02837594, 0.02837594, 0.03733744, 0.03733744, 0.03733744, 0.03733744, 0.04581619, 0.04581619, 0.04581619, 0.04581619, 0.0616092 , 0.0616092 , 0.0616092 , 0.0616092 , 0.0616092 , 0.04943258, 0.04041626, 0.04041626, 0.04041626, 0.03154209, 0.03154209, 0.03154209, 0.02535285, 0.02535285, 0.02535285, 0.02834586, 0.02834586, 0.02834586, 0.03736491]), 'imxer': 33, 'leniw': 22, 'tsw': array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'message': 'Integration successful.', 'nst': array([ 12, 16, 19, 22, 25, 28, 30, 32, 35, 38, 40, 44, 47, 51, 55, 60, 64, 67, 71, 74, 77, 80, 83, 85, 88, 90, 92, 94, 95, 97, 99, 100, 102, 104, 106, 109, 112, 115, 118, 121, 125, 129, 133, 137, 140, 144, 147, 150, 152, 155, 157, 160, 162, 164, 166, 167, 169, 171, 172, 174, 176, 178, 181, 183, 187, 190, 193, 197, 201, 205, 209, 212, 216, 219, 221, 224, 227, 229, 231, 233, 235, 237, 239, 240, 242, 244, 245, 248, 250, 253, 255, 258, 262, 265, 269, 273, 277, 281, 284, 288]), 'mused': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])}) 0 0.1 [array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2. , 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3. , 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4. , 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5. , 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6. , 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7. , 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8. , 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9. , 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10. ])] model-builder-0.4.1.orig/model_builder/Examples/lotka-volterra2.ode0000644000175000017500000000067210600767426023425 0ustar godgod lotka-volterra2.ode Presa=r*Presa-h*Presa*Pred Pred=-h*Pred+Presa*Pred r=3 h=2 10 0.1 0 1 1 model-builder-0.4.1.orig/model_builder/Examples/lotka-volterra2_unc.spec0000644000175000017500000000017510745434170024450 0ustar godgod(dp1 Vh (dp2 S'dist' p3 Vuniform p4 sS'pars' p5 V1.8 2.2 p6 ssVr (dp7 g3 Vuniform p8 sg5 V2.8 3.2 p9 ssS'samples' p10 I100 s.model-builder-0.4.1.orig/model_builder/Examples/nagumo.ode0000644000175000017500000000301510476603432021652 0ustar godgod nagumo.ode p[0]-y[1]+p[1] p[2]*y[0]-p[3]*y[1] y[0]*(0.25-y[0])*(y[0]-1) 0.5 0.002 0.002 5000 (array([[ 0.1 , 0.1 ], [ 0.13863773, 0.10000386], [ 0.17742268, 0.10001546], ..., [ 0.07837299, 0.48121172], [ 0.07901386, 0.48113122], [ 0.07965821, 0.48105087]]), {'nfe': array([ 23, 27, 33, ..., 13850, 13854, 13854]), 'nje': array([ 0, 0, 0, ..., 77, 77, 77]), 'tolsf': array([ 0., 0., 0., ..., 0., 0., 0.]), 'nqu': array([4, 4, 4, ..., 4, 4, 4]), 'lenrw': 52, 'tcur': array([ 1.31308733e-01, 2.06192375e-01, 3.45345574e-01, ..., 4.99982351e+03, 5.00052277e+03, 5.00052277e+03]), 'hu': array([ 0.03744182, 0.03744182, 0.06426956, ..., 0.86701256, 0.6992605 , 0.6992605 ]), 'imxer': 0, 'leniw': 22, 'tsw': array([ 0. , 0. , 0. , ..., 4885.16048273, 4885.16048273, 4885.16048273]), 'message': 'Integration successful.', 'nst': array([ 10, 12, 15, ..., 6606, 6607, 6607]), 'mused': array([1, 1, 1, ..., 1, 1, 1])}) 0 0.1 0.1 0.1 model-builder-0.4.1.orig/model_builder/Examples/pk.ode0000755000175000017500000007356210473670502021016 0ustar godgod(dp0 S'end' p1 S'10' p2 sS'name' p3 NsS'parameters' p4 S'15.4\n10\n1.5\n6\n0.55' p5 sS'type' p6 S'ODE' p7 sS'init' p8 S'0 200000 0' p9 sS'results' p10 (cNumeric array_constructor p11 ((I101 I3 tp12 S'd' p13 S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' p14 I01 tp15 Rp16 (dp17 S'nfe' p18 g11 ((I100 tp19 S'i' p20 S'\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00\n\x00\x00\x00' p21 I01 tp22 Rp23 sS'nje' p24 g11 ((I100 tp25 g20 S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' p26 I01 tp27 Rp28 sS'tolsf' p29 g11 ((I100 tp30 g13 S'P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00P\x00\x00\x00y\x00\x00\x00' p31 I01 tp32 Rp33 sS'nqu' p34 g11 ((I100 tp35 g20 S'\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00' p36 I01 tp37 Rp38 sS'lenrw' p39 I68 sS'tcur' p40 g11 ((I100 tp41 g13 S'\x1b\xd0kD\x9cA\xbf?D\x89\x8dw\xcf@\xcf?=\x95rfhp\xd7?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?\xd3.J\xc4\x1bd\xf9?,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@,\xdc{\xb7\x0ev\x06@wPi\xc6\x07\x1d\x10@wPi\xc6\x07\x1d\x10@wPi\xc6\x07\x1d\x10@wPi\xc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xcaF\xfcB<0@\x10\xcaF\xfcB<0@\x10\xcaF\xfcB<0@\x10\xcaF\xfcB<0@\x10\xcaF\xfcB<0@\x10\xcaF\xfcB<0@' p42 I01 tp43 Rp44 sS'hu' p45 g11 ((I100 tp46 g13 S'lB\xaf\xaa\x02@\xbf?lB\xaf\xaa\x02@\xbf?lB\xaf\xaa\x02@\xbf?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\x84\x89\xad\xaa\x01\x88\xf3?\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@\xe5\xebX\x15\x02j(@' p47 I01 tp48 Rp49 sS'imxer' p50 I23 sS'leniw' p51 I23 sS'tsw' p52 g11 ((I100 tp53 g13 S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' p54 I01 tp55 Rp56 sS'message' p57 S'Integration successful.' p58 sS'nst' p59 g11 ((I100 tp60 g20 S'\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00\t\x00\x00\x00' p61 I01 tp62 Rp63 sS'mused' p64 g11 ((I100 tp65 g20 S'\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00' p66 I01 tp67 Rp68 stp69 sS'start' p70 S'0' p71 sS'step' p72 S'0.1' p73 sS'equations' p74 S'-(p[0]+p[3])*y[0]+p[2]*y[1]+p[4]*y[2]\n-p[2]*y[1]\np[3]*y[0]-p[4]*y[2]' p75 sS'trange' p76 g11 ((I101 tp77 g13 S'\x00\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xb9?\x9a\x99\x99\x99\x99\x99\xc9?433333\xd3?\x9a\x99\x99\x99\x99\x99\xd9?\x00\x00\x00\x00\x00\x00\xe0?433333\xe3?gfffff\xe6?\x9a\x99\x99\x99\x99\x99\xe9?\xcd\xcc\xcc\xcc\xcc\xcc\xec?\x00\x00\x00\x00\x00\x00\xf0?\x9a\x99\x99\x99\x99\x99\xf1?433333\xf3?\xcd\xcc\xcc\xcc\xcc\xcc\xf4?gfffff\xf6?\x00\x00\x00\x00\x00\x00\xf8?\x9a\x99\x99\x99\x99\x99\xf9?433333\xfb?\xcd\xcc\xcc\xcc\xcc\xcc\xfc?gfffff\xfe?\x00\x00\x00\x00\x00\x00\x00@\xcd\xcc\xcc\xcc\xcc\xcc\x00@\x9a\x99\x99\x99\x99\x99\x01@gfffff\x02@433333\x03@\x00\x00\x00\x00\x00\x00\x04@\xcd\xcc\xcc\xcc\xcc\xcc\x04@\x9a\x99\x99\x99\x99\x99\x05@gfffff\x06@433333\x07@\x00\x00\x00\x00\x00\x00\x08@\xcd\xcc\xcc\xcc\xcc\xcc\x08@\x9a\x99\x99\x99\x99\x99\t@gfffff\n@433333\x0b@\x00\x00\x00\x00\x00\x00\x0c@\xcd\xcc\xcc\xcc\xcc\xcc\x0c@\x9a\x99\x99\x99\x99\x99\r@gfffff\x0e@433333\x0f@\x00\x00\x00\x00\x00\x00\x10@gfffff\x10@\xcd\xcc\xcc\xcc\xcc\xcc\x10@333333\x11@\x9a\x99\x99\x99\x99\x99\x11@\x00\x00\x00\x00\x00\x00\x12@gfffff\x12@\xcd\xcc\xcc\xcc\xcc\xcc\x12@433333\x13@\x9a\x99\x99\x99\x99\x99\x13@\x00\x00\x00\x00\x00\x00\x14@gfffff\x14@\xcd\xcc\xcc\xcc\xcc\xcc\x14@433333\x15@\x9a\x99\x99\x99\x99\x99\x15@\x00\x00\x00\x00\x00\x00\x16@gfffff\x16@\xcd\xcc\xcc\xcc\xcc\xcc\x16@433333\x17@\x9a\x99\x99\x99\x99\x99\x17@\x00\x00\x00\x00\x00\x00\x18@gfffff\x18@\xcd\xcc\xcc\xcc\xcc\xcc\x18@433333\x19@\x9a\x99\x99\x99\x99\x99\x19@\x00\x00\x00\x00\x00\x00\x1a@gfffff\x1a@\xcd\xcc\xcc\xcc\xcc\xcc\x1a@433333\x1b@\x9a\x99\x99\x99\x99\x99\x1b@\x00\x00\x00\x00\x00\x00\x1c@gfffff\x1c@\xcd\xcc\xcc\xcc\xcc\xcc\x1c@433333\x1d@\x9a\x99\x99\x99\x99\x99\x1d@\x00\x00\x00\x00\x00\x00\x1e@gfffff\x1e@\xcd\xcc\xcc\xcc\xcc\xcc\x1e@433333\x1f@\x9a\x99\x99\x99\x99\x99\x1f@\x00\x00\x00\x00\x00\x00 @333333 @gfffff @\x9a\x99\x99\x99\x99\x99 @\xcd\xcc\xcc\xcc\xcc\xcc @\x00\x00\x00\x00\x00\x00!@333333!@gfffff!@\x9a\x99\x99\x99\x99\x99!@\xcd\xcc\xcc\xcc\xcc\xcc!@\x00\x00\x00\x00\x00\x00"@333333"@gfffff"@\x9a\x99\x99\x99\x99\x99"@\xcd\xcc\xcc\xcc\xcc\xcc"@\x00\x00\x00\x00\x00\x00#@433333#@gfffff#@\x9a\x99\x99\x99\x99\x99#@\xcd\xcc\xcc\xcc\xcc\xcc#@\x00\x00\x00\x00\x00\x00$@' p78 I01 tp79 Rp80 s.model-builder-0.4.1.orig/model_builder/Examples/sir.ode0000644000175000017500000000213210534766650021167 0ustar godgod sir.ode -p[0]*y[0]*y[1] p[0]*y[0]*y[1]-p[1]*y[1] p[1]*y[1] 0.001 0.1 10 0.1 0 1000 1 0 [ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3. 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4. 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5. 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6. 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7. 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8. 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9. 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10. ] model-builder-0.4.1.orig/model_builder/Examples/sir_unc.spec0000644000175000017500000000021310745424766022220 0ustar godgod(dp1 VP[1] p2 (dp3 S'pars' p4 V.1 .01 p5 sS'dist' p6 Vnormal p7 ssVP[0] p8 (dp9 g4 V.001 .0001 p10 sg6 Vnormal p11 ssS'samples' p12 I100 s.model-builder-0.4.1.orig/model_builder/Examples/sirdemog.ode0000644000175000017500000000115210534766650022204 0ustar godgod sirdemog.ode p[2]*(y[0]+y[1]+y[2])-p[0]*y[0]*y[1]-p[2]*y[0] p[0]*y[0]*y[1]-p[1]*y[1]-p[2]*y[1] p[1]*y[1]-p[2]*y[2] 0.001 0.1 0.01 100 0.1 0 1000 1 0 model-builder-0.4.1.orig/model_builder/Examples/sprucebudworm.ode0000644000175000017500000000116410534766650023277 0ustar godgod sprucebudworm.ode p[0]*y[0]*(1-y[0]/p[1])-(p[3]*y[0]**2/(p[4]**2+y[0]**2)) 0.1 1000 2 200 1000 2 0 0.1 [ 0.00000000e+00 1.00000000e-01 2.00000000e-01 ..., 9.99800000e+02 9.99900000e+02 1.00000000e+03] model-builder-0.4.1.orig/model_builder/Examples/verhulst.ode0000644000175000017500000000175710534766650022262 0ustar godgod verhulst.ode p[0]*y[0](1-y[0]/p[1]) 0.2 1000 10 2 0 0.1 [ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3. 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4. 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5. 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6. 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7. 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8. 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9. 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10. ] model-builder-0.4.1.orig/model_builder/Introduction.html0000644000175000017500000000400410536337617021471 0ustar godgod Introduction Home

Introduction

Model Builder is a graphical ODE simulator.  It allows the user to define, simulate and analyze arbitrary systems of Ordinary Diferential Equations.
Purpose

ModelBuilder was created to be a generic interface to people that need to simulated Ordinary Differential Equations (ODE) models and analyze their output.

For that purpose I wrote a (hopefully) nice frontend to the LSODA ODE solving library, so that the model equations can be written directly in the main window and the parameters for the numerical integration can also be set easily.

Features

  • Equation-based model definition. No need to learn to program to define and run your models. Just type-in you differential equations
  • Graphic output of simulation. You can save the graphics in the most common formats: png, svg, pdf, etc.
  • Spreadsheet view of the results. From the spreadsheet you can make customized plots from your variables. You can also export your data to a .csv text file
  • Latex rendering of your system of equations. Check you equation in clear mathematical notation.
  • Intuitive graphical interface.
  • Free software. Licensed under the GPL
  • Portable. Run wherever Python runs.
  • Uncertainty analysis module. Implements a straightforward interface for the Bayesian Melding method. 
  • Sensitivity analysis. Find out how sensitive your model is to variations in parameter values.

model-builder-0.4.1.orig/model_builder/MB.hhc0000644000175000017500000000000010536337617017074 0ustar godgodmodel-builder-0.4.1.orig/model_builder/MB.hhk0000644000175000017500000000000010536337617017104 0ustar godgodmodel-builder-0.4.1.orig/model_builder/MB.hhp0000644000175000017500000000050510536337617017123 0ustar godgod[OPTIONS] Default topic=index.html Title=Model Builder helpbook Compiled file=MB.chm Index file=MB.hhk Contents file=MB.hhc Default Window=wxHelp Full-text search=Yes Compatibility=1.1 [WINDOWS] wxHelp=,"MB.hhc","MB.hhk","index.html",,,,,,0x2420,,0x380e,,,,,0,,, [FILES] index.html Introduction.html The_main_Interface.htmlmodel-builder-0.4.1.orig/model_builder/MB.htb0000644000175000017500000000503710536337617017126 0ustar godgodPKsrP5’L€kE& index.htmlu‘okÂ0Æßû)ny_3q·¥YÅ :…VÆ^IÖž6ÐK.cýöK­ qìUàùÝsÏ]NÜÌ6Qò¾CNeÛÝtµŒ€œ¿#ÎgÉ ^’õ #HŒª¬&]Wªà|þÊä@t¶îA•É€(‘¤uEXQÈ¿‰w%OæÊX¤po‚Éäþ!1ŸIM€ŸN…ìì ¨mZ‘¦¥³hŽNg(x/ ïÓÄGµ]öH®ë ˜:]dh`ç-°è=úбŒúööÑKc/ÕÅ)£ÐR(È B¶¬ÈÔ™K»‡ÝÐL^J‚+)¸7\û’÷¥ÒÕÞW£9¨Ïn`íü‚ëqcü*6G$¨5Ž.é¨&×)lþO‡øÒÔ³¿Fkµ½ä»*EC>ú“" lãG‚L«£Qeï>Fðó×òþ¼?PKÜqP5Vs¨çà›Introduction.html¥UKo7¾óWLu(ÀÚ­ÑHmY@mÙ© 9bEŽÔîHK„Knø¼ùõýÈ•d9zéAÒ‚Î|™ÙÉO³‡›§ÏË[jB«iùéz1¿¡Ñ¸,ÿùõ¦,gO3úëé~A¿¿œÓ““Æ« ¬‘º,o?Œ¦b’®¥–õTMZ’*k›p5 üÊrIU#çp5|¿{÷ûãój†nÌ_£Ú^öwÆ¡ïx”S4Oç&8[Ç*•”Ù˜”CÁÉÊÖ}*þ]Ľ­YÓuTºfGÊ“¤“]£*©éavK^µQË`]A?›•ï.ç¤Övç)4LÑãZ°¢æµ2|vg’¦ÆGêþžÝJ']O¾÷[OvM®V&ÍÔšX)©Åí×(8_LV˜}' ùÐkt×\Y—C.(`Ö({Ik3Þ±Ú4á‚VV×—£é2ºÎzå¯2¥›fÊ{Æb'=Uޏ Zq€ ;U‘‚Øn-+Nÿtl;§F2#GòÃËmn‘ÃLz¨º7+Û¶Ò·2ø êÌæLøí挺z}Fªâ´äc‡>¯}Ã0`«x'0„)”‹:€Æ³m>ñ'‘ýJ+¿0U j[õ 2uÚŸz¯I ÚJ§äJ³AŸççκœÆQ-±÷ ¥¤¢òÛl*­•æS” ÌÓ30%Ñ» d¾;lŽ´8ŽztÓpõ%C<&ªäƒ ¾r3iOKaF˜¿eñ²òŽ3ÿ*òÎ1T±ë°“Ž ±ÀØtÑÐ…Y²÷ËÅé…%8'5 úØ5h†-"—}h€ ä_åÿd*ÆïEÞ ›ÝS†y‹ÅÓ¢™ÒröØ£i0`:°Ô';ê0ײg¯ ÿ=ë:M?&´±u1lïW ÁùMµU¡§CUtf<µ%5˜t¿áÁ„aj€ &fÇÕÍ«ç:òÞ¤LøÿGü8ÐåþeVïÔPKhdP5[sÿ}œ-The_main_Interface.htmlmU]oÛF|ç¯Øò¡H‹¬ó¤¶$ ±Ô@܈‚"OÅ‘\š×ïØ»£dýûÎ)Y*ü"‰Çý˜›-ºýz³ùñð‰ºØzøþñËÝ å‹²üóíMYÞnné÷ÍýzWürI¯lÐQ;«LY~ú#_gKI“/VÍ:#ZöÕÎF¶q•G~Š¥„\SÝ)8®î¾}]|øðþ×ÅeŽžqXð¿£Þ®ò9g÷ç©TÔÑðzÓ1õJ[ºÃ{ߪš—åô&[–SÛeåš½€¸|1ÇÙñ¼õªgr-Ý»†ÍÇQ›†=é@[ö{ º tÓ ’;ÏÈe;†‹LQtÎTÊÓNÇŽÞR5Æèl¸ e Œ"ÊLMÜ€)ûH•{â@­ó¨ÄY¸Ö­®•°HNÊ£¸@)–•—Qä£{3 "MÿÍ„¿Õ>Ät¼YL'fŠ:ERÍHù†ÜÀö‚‚ÚòôI hkã 挟tDŒÀ ¡œ{¦ÁsŒ{êǺÃ\¦]ðÓ`”UÑù}AÏX72£us@–Ú#Òìft2èüD?ÜúŒ|dEwhEßmÍ^f@çß:Lƒq±H4Œ'A‡6?Û* ×S4ñ„â$4;"Ú¡«Û¹“ÀIÑ[Š5g¦ \ÞÙ´2h•`£póÀ›aOÞ€Ó¿Çp~#·×G) -¥Ht"¬rcœÆ@™Ô#Óã2 Êâ>÷†§…Z4àÛ']‘Ñ–Ш»ë|}"¢RòžÅ´™„û,§ƒ’O@ŠÒgE'-Ì’s–cúÑδ봈#*gÍé~4 Wñ¢@¦D è'¬6Ž ›Ò½µ©J£Û–=ØÒX%˜C*HÛì¸+ô*زŠ#´êÅB{× x ªEl¸Æ¬ÊkU!À¥EÁ‹AA!l&U§½?é–!¤„í«Úõ½:†7(eF¯“³¼àH÷∟ÅB:ÊNlwÒpЕfÇ#V¾zn{2kºÈ ºÀNŠQÎÚ—wóϰ‘{9yY"Q-˜>™JV1Û-ŠdÏëÔz—øK2cØ>àIh‚øjò9,US`…æ?–rú—ûPKsrP5’L€kE& ¤index.htmlPKÜqP5Vs¨çà›¤mIntroduction.htmlPKhdP5[sÿ}œ-¤|The_main_Interface.htmlPK¼M model-builder-0.4.1.orig/model_builder/MB.ico0000644000175000017500000000137610536337617017125 0ustar godgod è( @ €€wwwpwpppwww`wP@wpwpwpwpwppp w0ww wwwwwwpppwppwpwwÿÿÿÿÿÿÿÿÃÿÿÿ‰ÿÿÿ‰ÿÿÿÙÿÿÿøÿÿÿüÿÿÿüü8üù‘?üxßüxãßü}çßüãÿüóÿþóÿþñÿþ>ùïþ>ñÇþ>pÇþ?"gþ?‡ÿ?ÿÿÿ?ÿÿÿ?ÿÿÿÿÿÿ›ÿÿÿ‘ÿÿÿ‘ÿÿÿÃÿÿÿÿÿÿÿÿÿÿmodel-builder-0.4.1.orig/model_builder/Model.py0000644000175000017500000001011010600775425017522 0ustar godgod#----------------------------------------------------------------------------- # Name: Model.py # Purpose: concentrate model related functions in a single module # # Author: Flavio Codeco Coelho # # Created: 2006/08/20 # RCS-ID: $Id: Model.py $ # Copyright: (c) 2004-2006 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- from scipy import integrate from numpy import * from string import * class Model: def __init__(self,equations,pars,inits, trange,): """ Equations: a function with the equations inits: sequence of initial conditions trange: time range for the simulation """ self.eqs = equations self.pars = pars self.Inits = inits self.Trange = arange(0,trange,0.1) self.compileParEqs() def compileParEqs(self): """ compile equation and parameter expressions """ #Equations eql = self.eqs.strip().split('\n') pl = self.pars.strip().split('\n') self.vnames = [v.split('=')[0] for v in eql if '=' in v] self.pnames = [p.split('=')[0] for p in pl if '=' in p] try: self.ceqs = [compile(i.split('=')[-1],'','eval') for i in eql] except SyntaxError: dlg = wx.MessageDialog(self, 'There is a syntax error in the equation Box.\nPlease fix it and try again.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() #Parameters if self.pars.strip() =="": self.cpars=[] return if self.pnames: #in this case returns the compete expression, including the '=' try: self.cpars = [compile(i,'','exec') for i in pl] except SyntaxError: dlg = wx.MessageDialog(self, 'There is a syntax error in the parameter Box.\nPlease fix it and try again.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() else: try: self.cpars = [compile(i,'','eval') for i in pl] except SyntaxError: dlg = wx.MessageDialog(self, 'There is a syntax error in the parameter Box.\nPlease fix it and try again.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() def Run(self): """ Do numeric integration """ t_courseList = [] t_courseList.append(integrate.odeint(self.Equations,self.Inits,self.Trange, full_output=0, printmessg=0)) return (t_courseList,self.Trange) def Equations(self,y,t): """ This function defines the system of differential equations, evaluating each line of the equation text box as ydot[i] returns ydot """ par = self.pars #---Create Parameter Array---------------------------------------------------------------------------- pars = self.cpars#par.strip().split('\n') Npar = len(pars) if self.vnames: exec('%s=%s'%(','.join(self.vnames),list(y))) p = zeros((Npar),'d') #initialize p if pars: #only if there is at least one parameter for j in xrange(len(pars)): if self.pnames: exec(pars[j]) else: p[j] = eval(pars[j]) #initialize parameter values #---Create equation array---------------------------------------------------------------------------- eqs = self.ceqs#strip(self.eqs).split('\n') Neq=len(eqs) ydot = zeros((Neq),'d') #initialize ydot for k in xrange(Neq): ydot[k] = eval(eqs[k]) #dy(k)/dt return ydotmodel-builder-0.4.1.orig/model_builder/ModelBuilder_About.html0000644000175000017500000000246310536337617022520 0ustar godgod ModelBuilder About
ModelBuilder 0.3.0
June, 2006


ModelBuilder was originally developed and is maintained by Flávio Codeço Coelho <fccoelho@fiocruz.br>.

Current Development team is composed by:
  • Flávio Codeço Coelho (Main code and Bayesian Melding module) 
  • Antonio Pacheco (sensitivity analysis module)
  • Claudia Torres Codeço (tester)
A tutorial to ModelBuilder can be accessed by pressing the Tutorial button below.

For more information go to Model Buider's website model-builder-0.4.1.orig/model_builder/PlotFigure.py0000644000175000017500000002373410602021523020543 0ustar godgod# -*- coding:latin-1 -*- #----------------------------------------------------------------------------- # Name: PlotFigure.py # Purpose: Plotting frame that contains the plots generated by Model Buider # # Author: Flavio C. Coelho # # Created: 2004/09/01 # RCS-ID: $Id: PlotFigure.py,v 1.1 2004/01/13 10:51:43 fccoelho Exp $ # Copyright: (c) 2003 # Licence: GPL # Obs: This code was based on Jeremy Donoghue's embedding_in_wx.py included with # matplotlib. #----------------------------------------------------------------------------- #Boa:Frame:PlotFigure import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wx import NavigationToolbar2Wx, FigureManager from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.axes import Subplot import matplotlib.numerix as numpy #from RandomArray import * #from numpy.random.old import * from pylab import * from numpy.random import * from numpy import * import wxversion wxversion.select('2.6') import wx def create(parent): return PlotFigure(parent) [wxID_PLOTFIGURE] = [wx.NewId() for _init_ctrls in range(1)] class PlotFigure(wx.Frame): def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_PLOTFIGURE, name='Output', parent=prnt, pos=wx.Point(311, 209), size=wx.Size(1280, 893), style=wx.DEFAULT_FRAME_STYLE, title='Results') self.SetClientSize(wx.Size(1280, 893)) def __init__(self, parent): self._init_ctrls(parent) self.fig = Figure((10,8), 75) self.canvas = FigureCanvas(self,-1, self.fig) self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() # On Windows, default frame size behaviour is incorrect # you don't need this under Linux tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() self.toolbar.SetSize(wx.Size(fw, th)) # Create a figure manager to manage things self.figmgr = FigureManager(self.canvas, 1, self) # Now put all into a sizer sizer = wx.BoxSizer(wx.VERTICAL) # This way of adding to sizer prevents resizing #sizer.Add(self.fig, 0, wxLEFT|wxTOP) # This way of adding to sizer allows resizing sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) # Best to allow the toolbar to resize! sizer.Add(self.toolbar, 0, wx.GROW) self.SetSizer(sizer) self.Fit() def plot(self,x,y,leg=[]): """ This function will plot one or more lines. y is a list of sequances or a single vector. x is a vector. """ # Use this line if using a toolbar a = self.fig.add_subplot(111) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) if str(type(y)) == "": nlin = len(y) for i in range(nlin): a.plot (x,y[i]) else: a.plot(x,y) a.set_xlabel('Time', fontsize=9) #---generating tuple of legends------------------------------------------------- if str(type(y)) == "": if leg ==[]: b = range(nlin) leg = tuple(['$y_{'+str(i)+'}$' for i in b]) else: pass #------------------------------------------------------------------------------- a.legend(leg) self.toolbar.update() def vectorField(self,x,y,u,v,c=0.2,xlabel='',ylabel='',trajectory=[]): """ Plot a vector field for State space visualizations """ # Use this line if using a toolbar a = self.fig.add_subplot(111) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) q = a.quiver2(x,y,u,v,c,units='x') a.set_xlabel(xlabel) a.set_ylabel(ylabel) a.set_title('State Space Diagram') if trajectory: for i in range(len(trajectory))[::2]: lt = '-' if i != 0: lt = ':' a.plot(trajectory[i],trajectory[i+1],lt,linewidth=2) # Do contours for isoclines print x.shape sq = int(sqrt(len(x))) x.shape = (sq,sq) y.shape = (sq,sq) u.shape = (sq,sq) v.shape = (sq,sq) z1 = sqrt(u**2+v**2) #basic arrow lengths z2 = u #dx/dt z3 = v #dy/dt lev = (0,) cs1 = a.contour(x,y,z1,20,origin='lower')#general isoclines # im = a.imshow(z1, interpolation='bilinear',alpha=0.9, origin='lower',cmap=cm.gray) cs1l = a.contour(x,y,z1,lev,linewidths=2,colors='k',origin='lower') cs2l = a.contour(x,y,z2,lev,linewidths=2,colors='k',origin='lower') cs3l = a.contour(x,y,z3,lev,linewidths=2,colors='k',origin='lower') #doing contour labels a.clabel(cs1l,fmt = 'Nullcline %2.1f',inline=0, colors = 'r', fontsize=14) a.clabel(cs2l,fmt = 'dx/dt=%2.1f',inline=0, colors = 'r', fontsize=14) a.clabel(cs3l,fmt = 'dy/dt=%2.1f',inline=0, colors = 'r', fontsize=14) def plotSpecg(self,x, name): """ Makes a Spectrogram plot of x """ # Use this line if using a toolbar a = self.fig.add_subplot(111) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) a.specgram(x) a.set_xlabel('time') a.set_ylabel('frequency') a.set_title('Spectrogram of %s'%name) def plotSpec(self,x, name): """ Makes a power spectrum plot of x """ # Use this line if using a toolbar a = self.fig.add_subplot(111) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) a.psd(x) a.set_xlabel('frequency') a.set_ylabel('Power(dB)') a.set_title('Power Spectrum of %s'%name) def plot_data(self, x,y,leg=None): """ This function will plot the time series as output by odeint. """ # Use this line if using a toolbar a = self.fig.add_subplot(111) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) nvar = min(y[0].shape) for i in range(nvar): a.plot (x,y[0][:,i]) a.set_xlabel('Time', fontsize=9) a.set_ylabel('$State variables$', fontsize=9) a.set_title('Time series') #---generating tuple of legends------------------------------------------------- if not leg: b = range(nvar) leg = tuple(['$y_{'+str(i)+'}$' for i in b]) #------------------------------------------------------------------------------- a.legend(leg) self.toolbar.update() def plotStats(self,x, ts,vnames=[]): """ This function will plot multiple time series ts is a list of lists: [list of median time-series, list of lower credible intervals, list of upper credible intervals] """ # Use this line if using a toolbar #a = self.figmgr.add_subplot(111) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) nvar = len(ts[0]) print len(x), len(ts[0]) c=['r','g','b','c','m','y','k'] for i in range(nvar): a = self.fig.add_subplot(nvar*100+10+i+1) a.plot(x,ts[0][i], '%s-o'%c[i%len(c)],x,ts[1][i],'%s-.'%c[i%len(c)], x,ts[2][i],'%s-.'%c[i%len(c)]) a.set_xlabel('Time', fontsize=9) if vnames: a.set_ylabel(vnames[i], fontsize=9) else: a.set_ylabel('$y_{'+str(i)+'}$', fontsize=9) a.legend(('$median$',)) #---generating tuple of legends------------------------------------------------- ## b = range(nvar) ## leg = tuple(['$y_{'+str(i)+'}$' for i in b]) #------------------------------------------------------------------------------- self.toolbar.update() def plotDist(self,data,vname): """ Plots histograms of each line of 'data' the name of the variables are the elements of the list 'vname' """ nvar = len(data) for i in range(nvar): # Use this line if using a toolbar a = self.fig.add_subplot(nvar*100+10+i+1) nb, bins, patches = a.hist(data[i],bins=50, normed=1) a.set_ylabel(vname[i], fontsize=9) self.toolbar.update() def plotMeldout(self,meldout,vnames=[]): """ Plots histograms of the posterior distributions of the model components meldOut is the output of the Melding.SIR function: (w,qtiltheta,qtilphi,q1est) """ nvar = len(meldout[1]) data = meldout[1] for i in range(nvar): # Use this line if using a toolbar a = self.fig.add_subplot(nvar*100+10+i+1) # Or this one if there is no toolbar #a = Subplot(self.fig, 111) nb, bins, patches = a.hist(data[i],bins=50, normed=1) a.set_title('Posterior Distribution of %s$'%vnames[i], fontsize=9) self.toolbar.update() def plotEquation(self, eqlist): """ Plot list of equations typeset with mathtext on an equation box """ a = self.fig.add_subplot(111) a.plot([0,10],'w.') a.set_xlim((0,10)) a.set_ylim((0,10)) a.set_title('Model Equations') a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) for i in range(len(eqlist)): print eqlist[i] a.text(1,9-i,eqlist[i], fontsize=15) self.toolbar.update() def GetToolBar(self): # You will need to override GetToolBar if you are using an # unmanaged toolbar in your frame return self.toolbar if __name__ == '__main__': app = wx.PySimpleApp() frame = create(None) x = normal(0,1,50) y = normal(0,1,(50,5)) frame.plot_data(x,[y]) frame.Show() app.MainLoop() model-builder-0.4.1.orig/model_builder/PyMB.py0000755000175000017500000000446210745414350017306 0ustar godgod#!/usr/bin/env python #Boa:App:BoaApp # -*- coding:iso8859-1 -*- #----------------------------------------------------------------------------- # Name: PyMB.py # Purpose: Mathematical ODE Model simulator # # Author: Flavio Codeco Coelho # # Created: 2003/02/04 # RCS-ID: $Id: PyMB.py,v 1.6 2004/01/13 10:51:43 fccoelho Exp $ # Copyright: (c) 2003-2008 Flavio Codeco Coelho # Licence: This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #----------------------------------------------------------------------------- import wxversion wxversion.select('2.6') import wx import wxFrame1 ##import psyco ##psyco.full modules ={u'MB': [0, '', u'MB.hhp'], 'Model': [0, '', 'Model.py'], 'PlotFigure': [0, 'Plotting Frame', 'PlotFigure.py'], '__version__': [0, '', '__version__.py'], 'about': [0, '', 'about.py'], u'cwt': [0, '', u'cwt.py'], 'icones': [0, '', 'icones.py'], 'lhsframe': [0, '', 'lhsframe.py'], 'odexml': [0, '', 'odexml.py'], 'quivVarFrame': [0, '', 'quivVarFrame.py'], 'uncertaintyMiniFrame': [0, 'Mini frame with parameters for uncertainty analysis.', 'uncertaintyMiniFrame.py'], 'wxFrame1': [1, 'Main frame of Application', 'wxFrame1.py'], 'wxFrame2': [0, '', 'wxFrame2.py']} class BoaApp(wx.App): def OnInit(self): wx.InitAllImageHandlers() self.main = wxFrame1.create(None) # needed when running from Boa under Windows 9X self.SetTopWindow(self.main) self.main.Show();self.main.Hide();self.main.Show() return True def main(): application = BoaApp(0) application.MainLoop() if __name__ == '__main__': main() model-builder-0.4.1.orig/model_builder/The_main_Interface.html0000644000175000017500000000362210536337617022521 0ustar godgod The main Interface Home

The main Interface

The main frame of ModelBuilder is very simple. It contain three menus, a toolbar with 3 buttons, and several text editing boxes for the specification on the model.

The menus

The first menu is the file menu. It contains the standard open, save, save as, close and exit options. These are pretty much self-explanatory.

The second menu is the analysis menu. In this menu You will find to options: Uncertainty Analysis Phase plot. The uncertainty analysis option opens the uncertainty analysis windows, for sensitivity and Uncertainty analyses

The third and last is the help menu and it jus contains the entries for this help and the about  message. 

The Toolbar

The toolbar contains three buttons. The first one is the run button, which starts the simulation.

The second button shows a typeset version of the differential equations in the model (this feature requires the latest version of matplotlib).

The third button shows the results of a simulation on a spreadsheet. From there you can select variables to plot separately and save the results to a csv(comma separated values) file.

The Main Frame

The main frame is designed for the easy specification of a model consisting  of a  system of differential equations. This interface will be covered in a later section where the definition of models is explained. model-builder-0.4.1.orig/model_builder/__init__.py0000644000175000017500000000000110536340662020216 0ustar godgod model-builder-0.4.1.orig/model_builder/__version__.py0000644000175000017500000000002010745436327020747 0ustar godgodversion='0.4.1' model-builder-0.4.1.orig/model_builder/about.py0000644000175000017500000000640210745436261017607 0ustar godgod#Boa:Dialog:wxDialog1 import wxversion wxversion.select('2.6') import wx import wx.html import webbrowser import __version__ def create(parent): return wxDialog1(parent) [wxID_WXDIALOG1, wxID_WXDIALOG1CLOSE, wxID_WXDIALOG1HTMLWINDOW1, wxID_WXDIALOG1TUTORIAL, ] = [wx.NewId() for _init_ctrls in range(4)] class wxDialog1(wx.Dialog): def _init_ctrls(self, prnt): # generated method, don't edit wx.Dialog.__init__(self, id=wxID_WXDIALOG1, name='', parent=prnt, pos=wx.Point(554, 80), size=wx.Size(357, 508), style=wx.DEFAULT_DIALOG_STYLE, title='About') self.SetClientSize(wx.Size(357, 508)) self.htmlWindow1 = wx.html.HtmlWindow(id=wxID_WXDIALOG1HTMLWINDOW1, name='htmlWindow1', parent=self, pos=wx.Point(8, 8), size=wx.Size(344, 464), style=wx.html.HW_SCROLLBAR_AUTO | wx.html.HW_DEFAULT_STYLE) self.htmlWindow1.SetThemeEnabled(True) self.htmlWindow1.SetToolTipString('About ModelBuilder') self.htmlWindow1.SetBackgroundColour(wx.Colour(255, 0, 0)) self.close = wx.Button(id=wxID_WXDIALOG1CLOSE, label='Close', name='close', parent=self, pos=wx.Point(272, 482), size=wx.Size(80, 22), style=0) self.close.Bind(wx.EVT_BUTTON, self.OnCloseButton, id=wxID_WXDIALOG1CLOSE) self.tutorial = wx.Button(id=wxID_WXDIALOG1TUTORIAL, label='Tutorial', name='tutorial', parent=self, pos=wx.Point(8, 480), size=wx.Size(80, 22), style=0) self.tutorial.Bind(wx.EVT_BUTTON, self.OnTutorialButton, id=wxID_WXDIALOG1TUTORIAL) def __init__(self, parent): self._init_ctrls(parent) page = """ About Model Builder
Model Builder 0.4.1
January, 2008


ModelBuilder was originally developed and is maintained by Flávio Codeço Coelho <fccoelho@fiocruz.br>.

Current Development team is composed by:
  • Flávio Codeço Coelho (Main code and Bayesian Melding module) 
  • Antonio Pacheco (sensitivity analysis module)
  • Claudia Torres Codeço (tester)

Acknowledgements

  • Thanks to Varun Hiremath for packaging Model Builder for Debian.


A tutorial to ModelBuilder can be accessed by pressing the Tutorial button below.

For more information go to Model Buider's website """ self.htmlWindow1.SetPage(page) def OnCloseButton(self, event): self.Close() def OnTutorialButton(self, event): webbrowser.open_new('http://model-builder.sourceforge.net') model-builder-0.4.1.orig/model_builder/backup_section.png0000644000175000017500000000317310536337617021627 0ustar godgod‰PNG  IHDR$$ᘘgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe< IDATxÚbIKKc˜5k–&øÏ@;ÀˆÆ¿tÇ “Sr0 ÂxtªLÐ 3MÕCaCR'ªÔ> >p¬âîwkíûd À2)¤”æ«aØ¥¡ÊšcÈSNî„xn¾vý³ª²9§õÞO½„z`zÜna8J~ضè.¡"ç‚D$Ky)¾ˆá ‰ã2МiˆñæükIµ“ ƒµs„áWÏ!ŒÑôÙ‰ˆVe/=KtàÀA†¿ 0þþ±ÿ5üäêþüE–ÿvüß?Áü…ŠƒæCØ0þ(„_½~Í ""b tÆy þ@,ÄòŸÁÑÑìóp‹ÿ‚} óL †Á‚:ü/,Dþ@óáˆ? za!’…,ˆ »vïf`ee2y˜ €X ‰æ?ÿ?áŽùóÍ?(j‘|þŠ BöJˆüC„ Ä#àlp¢E#@ABä P8Aãû4Ø!¡óÉP$ÇÀƒÿÜ‘Èj°ax(Aõÿÿ‡™®ˆƸ}ëÃû÷onܸÁ ¢¢‚‘ÿAšÿ}„H¤ >Ìÿ¢§9HtÁÉ¡ÁôÍ›·´´´^½z‰î ÿ¡Mû1»µ!ϯ‡áöíÛ ||¼,ú ’« Yø˜ýãLjÿFÊQà–Cøÿ±e Ç››™3<|øáÌÓM 2,æ(ò!iv 0[B\œAOW—á;Ðbå?¾‡°A4ýöá;ƒø 2ì(PÙ‚”õAbØÊÖ§OŸ‚ÌÎÎÆ %-ÍÀðU @ÁCè˹‡ ¿Žžeø_ÌðâåK†/_¾À 6HÈ@Cä0`È€Bè7¬l‚FÏŸ¿ÒÉ_¬E4(êAþòå+÷¡' ß´¤Päî 7Âÿ®kÿg°ú X.€%?~úÄðâÅ 0…L-ŒFvÿQøŒŒŒ ÌLÌ@6(=!ÄAÑ%$$v;;;ÃKG)¦—¨ `=fÍ Ï&Á ȬÌpñâ%&&&11Q°CîÞ½Ëpïþ}pôñÊ?xð€ÁÍÍ åO_?¦!iy€bY¹rå9}}†§Ïž3¼|ù‚áÍ›7 ¯¥çÝ{÷ÞÙoß¾'^P”ýà 0ð h !±°°€Cˆ•Aþ$Ã_qÔ4@,ÏŸ?§ ~~~pºùøñûwïÞ¢AQ,IÁ ¬æÑ «ïØÞ>cø&.‹"@,Ïž=;ÄÛÛ è˜àÚ* ÜðáÃŒ‚ y’¶éV±ÂË- -ÌÁ°4ôIPÃ|€by ¡/_¿ÓÊ=pÙ ǀG¬c¶Ž.^ù[·n‹ P¨ÿf"Ö7¨vËs`}ûúœfóøñc`‰ýìr€‚¼<¤H€¶yÀe¨ø€òAòŸ?fEîóO/d™åPôËK`™Ò ™Ç£ë¸P#€ræ?”úê” ‰¶ßÐБÄ£îܹƒ¢ €X@采‡‡áÐA¯^½Bi¬‘ÔÕÕÁ…)¼ÂœÐöÈaHU ¨)‚ž,ˆ& ©ŸÐÂpõêUx!·0*n'@ÁóòW`¦F«ÔÐÕw° ø÷ï_X›¹°ô ‹/ÂK€‚;ˆœ… ¬Zµê,‹#Óèb°¦ ˆ/ 𦠀X¨ ¸¸¸n)¤$Ƈ@ ª›þÕï@ý,P†#QÏS þ@´rÐ) ¾†¥Cˆ üÕ<  €há _PG½$G3@11 2@ƒÎA4è@,þüOxó\@Iý‡ ì ÐÞÅ`Ĭy“&O`ƒI…TÍÔ*Ý‘@±899ÒB ‘*™ùZê’e¯ø t|†Zãkr5ÈA¡Ža¦ÒÝ_ë1`wKZ¬:ŽIEND®B`‚model-builder-0.4.1.orig/model_builder/cwt.png0000644000175000017500000001023610536337617017431 0ustar godgod‰PNG  IHDR szzôbKGDÿÿÿ ½§“ pHYs  šœtIMEÖ 8 dwº+IDATX  ßïÿÿÿÿûûûÿÿÿüüüíííßßßøøøêêêûûû...ÿÿÿÿààભÿýÿÿýþÿýþøecð ñ ÕÕÕÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ+++ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèèèÿþÿÿÿÿýþýýýþÿüþÿþýþþþþþÿÿÿÿþÿÿÿÿÿþÿÿÿÿÿþÿÿÿÿýÿÿüþýþþÿÿÿÿÿÿÿÿÿÿÿÿÕÕÕÿþÿþÿ+++ÿÿÿÿÿþÿÿÿÿþÿÿÿÿÿðððþÿÿÿÿÿÿÿÿþÿýþûýþýÿÿÿÿþ÷÷÷úúÿúÿÿÿÿþÿÿþþû ÿ÷ýÿòô øøüøöÿ ÿýÿÿúþ Ûüùÿÿø ú ýû øþùøýõ ÿ õøõîûßþüúý õúýûÿÿòþÓþøÿû ù úþãüß $Ýÿ÷æî üøù óÿûýûù×××ü ýø8ü>0ûþáü´³ö­õäË Òôçôæõ'þÚÓ-ãü  ûîù ÷ö ÿ ó÷)))èéü þÿ <ï BñøRõ& ûûÙ ªøü’ú˜ µäÒº29ÚÊÐâ3%öÜòûôý àäû ÷ðÿ+ý׸Ië÷ ÿ óùÜ $1Ü!öÛâãááøÜÿ×ÿãùøý÷ûúä AÄt’O'µðæð,÷÷÷ê; ÆÇ7+Öõ ýýýã! Ýî**ùîñùáë÷óÒþúàöòóüõÎìùìøM  äêó,íííŒr’ mß Ü$!ßûûÿúòä,Ó¼BS-ªªR.=ÓùõÍð74úÍÓ×è7KÛ·"ê àÿú³L>ÂÅ;âêøûýþÿüüþò -Ò´K- Ñ.Λ!aFä ññ+ 8Å (Ö×* ÷$Ûäîú õûþþÿÿÿÿþùñùÔ-ä? ¿ õÍ 2ùïïïï,÷ ø* íÿýôþ ÿûûþýýþÿÿûýý õþ  &û÷öú ÿÿÿÿÿÿÿÿÿÿÿÿóóóÿòòòÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿäääÿÚÚÚÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿãããÿÌÌÌÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåååÿËËËÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿãããÿÎÎÎÿøøøÿÿÿÿÿÿÿÿÿÿÿÿÿÄʸ)uºIEND®B`‚model-builder-0.4.1.orig/model_builder/cwt.py0000644000175000017500000001016610566330323017265 0ustar godgod# Continuous Wavelet Transform # Copyright 2006 by Flavio Codeco Coelho import math, pylab import numpy #import numarray as numpy def cwt(x, nvoice, wavelet, oct=2, scale=4): """ Continuous Wavelet Transform Usage >>> cwt(x,nvoice,wavelet,oct,scale) Inputs: x signal, dyadic length n=2^J, real-valued nvoice number of voices/octave wavelet string 'Gauss', 'DerGauss','Sombrero', 'Morlet' octave Default=2 scale Default=4 Outputs cwt matrix n by nscale where nscale = nvoice .* noctave """ #preparation x = numpy.asarray(x) n = len(x) xhat = numpy.fft.fft(x) xi = numpy.concatenate((numpy.arange(n/2+1), numpy.arange(-n/2+1,0))) * (2*numpy.pi/n) #root omega0 = 5 # or(?) #omega0 = numpy.pi * 2 #noctave = floor(log(n,2))-1 noctave = int(math.floor(math.log(n,2))-oct) nscale = nvoice * noctave #cwt = numpy.zeros((n,nscale),numpy.Float) cwt = [] exp = numpy.exp sqrt = numpy.sqrt ifft = numpy.fft.ifft for jo in xrange(noctave): for jv in xrange(1,nvoice+1): qscale = scale*(2**(jv/float(nvoice))) omega = xi * (n/qscale) # fft of wavelet if wavelet == 'Gauss': #window = exp((-omega**2)/2.) # simple optimization - inplace operations omega *= omega omega *= -0.5 exp(omega, omega) window = omega elif wavelet == 'DerGauss': window = 1j*omega*exp(-omega**2/2.) elif wavelet == 'Sombrero': window = (omega**2)*exp(-omega**2/2.) elif wavelet =='Morlet': window = exp(-(omega-omega0)**2/2.)-exp(-(omega**2+omega0**2)/2.) #Renormalization window *= 1./sqrt(qscale) what = window*xhat # convolution w = ifft(what) cwt.append(w.real) scale *= 2 cwt = numpy.vstack(cwt) return cwt def calcCWTScale(sz): """ CalcCWTScale -- Calculate Scales and TickMarks for CWT Display Usage: xtick,ytick = CalcCWTScale(sz); Inputs: sz size of CWT array Outputs: xtick vector of positions ytick vector of log2(scales) """ n = sz[1]; nscale = sz[0] #because the plot will be transposed noctave = math.floor(numpy.log2(n))-2 nvoice = nscale / noctave xtick = pylab.linspace(0,n,n) ytick = pylab.linspace(int(n/2),0,nscale) return (xtick,ytick) def imageCWT(c,cmap=None, title='Scalogram',interpolation='bilinear',origin='image'): """ plot the cwt with the apropriate scaling """ xtick,ytick = calcCWTScale(c.shape) #print len(xtick),len(ytick) A=pylab.imshow(c,origin=origin, interpolation=interpolation) xidx = pylab.linspace(0,len(xtick)-1,len(A.axes.get_xticks())).astype(numpy.int) yidx = pylab.linspace(0,len(ytick)-1,len(A.axes.get_yticks())).astype(numpy.int) A.axes.set_xticks(xidx) A.axes.set_yticks(yidx) A.axes.set_xticklabels([str(int(x)) for x in xtick[xidx]]) A.axes.set_yticklabels([str(int(y)) for y in ytick[yidx]]) A.axes.set_aspect('auto') pylab.xlabel('time(samples)') pylab.ylabel('scale') pylab.title(title) #pylab.show() if __name__=='__main__': #data = numpy.sin(numpy.linspace(0, 8*6.14, 512)) x = numpy.linspace(0, 1024, 2*1024) data = 2*numpy.sin(2*numpy.pi/4 * x) * numpy.exp(-(x-400)**2/(2*300**2)) + \ numpy.sin(2*numpy.pi/32*x) * numpy.exp(-(x-700)**2/(2*100**2)) + \ numpy.sin(2*numpy.pi/32 * (x/(1+x/1000)) ) pylab.figure() pylab.plot(data) #interpolation = 'nearest' interpolation = 'bilinear' origin = 'image' #import time for wname in ['Gauss', 'DerGauss', 'Sombrero', 'Morlet']: pylab.figure() #t = time.clock() c = cwt(data, nvoice=8, wavelet=wname, oct=2, scale=4) #print time.clock() - t #c = abs(c) imageCWT(c,title='%s wavelet' % wname,origin=origin,interpolation=interpolation) pylab.show() model-builder-0.4.1.orig/model_builder/filesave.png0000644000175000017500000000250410536337617020431 0ustar godgod‰PNG  IHDR szzôgAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<ÖIDATxÚbüÿÿ?Ã@€bb`@î€bAX·þÈÿß¿ÿ0üþõ—‘‘áÏŸ¿@ äÿFШì?`5U Äõæ#ÃûwŸ.œŸÉˆn@¡8`ýú£ÿmíõšÿ1üý÷AFB,~ùæMºê2$ùrûÁË ~ýfpr.ù¿ooŠ#Å¿¾úñó7Ã×o?þüE8ÀÔ¿‘ART€ƒƒ•ƒ•áü–F’pçá+†¿ÿ28¹š0HJ†þþ|5Ü„ê`pýZüû„†n.v#yA>.~.’ãùÔ¼_¿~1°° &;€bAWò9Ù0ÀÆÊ )&À ry™ùáÃ'†ÿþ¡ÈZüÇ=8$JˆòÀu7É…è§Ÿ¾ûtj¹@!ð÷(P£ Ð͘A_SŽ<Ü$;äóoŸ¿2ü&Dô‚ €0!ÈrXÁ@]žYyܯ^}`øòé Øìß@ G@¡†8þ*þÛ^‚ƒìÐÕÿ¡4È' âÿÀ>ú—ûçÿþý›áÍë _¿þ&¾?àrã– Ì\ð’Aôõ;ÏQø¡ ™†°!Ñ tôùÓW†¯_¾" 0PrÀïßi €0£üá….‹þ¢9¿_¿|cøöõ´$„”¦3¡üߘ!@˜QÊà(ø‹ÕÇóóç/0¥îŸÀ n1ˆþ°æ±ßÀ¨@w@± gX²DXçÿý‡Ó¿€ýø´ôûVFVvfF.Vfˆ%¿ÿ"Õ PKôƒ'¯ÀÑð Kf9õ( \¬µàr ñoÀ"äcHQqì_$±¿ò=³ÖC†™ ˆ[‘‰^‚÷0˜‘ …á¿ÿB‹ð¿Xå‘kJP( ‡@aä‚?Hñ R ÉF¿±ŒêÜò`ü…D º{@5~ùòáôéÇñ÷/Œ ¼¼ì@þoxË Ý„ `úòå¼9õáÃw”`Ejä¨AG°98˜¡µ,vF"*À†(Ø@e¸¬,Ö¬…žp%JHÂþÃðäP, Tü2?…Íxarñâs°ÿþ!í?´PA„¸ÀB“–æ'@PaTŠ@åùo°ÏC* ––æÅÈãÈ>FNpÈÁ(#þ€Ó¬€C€ÂȆà"œï!i€ Èþl¢Ã0#3A}c``cŒýÿ?C¢2`QÀŒâ€BqÀ¯ï¿¾¼}Ïðéù+pb¼{÷Fÿóç–Äöky‹†¯¯^€«á??€Ú¦ Fô 10Hýÿñãpà‚7Í@ê ˜Œ¨|]ìåË7Põ âþJ¿ €ºs @Þ7 w@€€pï ·„RIEND®B`‚model-builder-0.4.1.orig/model_builder/folder_open.png0000644000175000017500000000424610536337617021134 0ustar godgod‰PNG  IHDR szzô pHYs  šœgAMA±Ž|ûQ“ cHRMz%€ƒùÿ€éu0ê`:˜o’_ÅFIDATxÚb` 2ŠØg(¶ï`pÃ…ÿ"žk»€B<@ÌŒK=@±PËbùøƒŠÿÿ16è+ Åéè*3(Ër0ì?q?(µˆñWlúˆb(gœø÷ûw‘¬(Gž§½ÿ[&n†—Ÿ6Þb`0Ò–QÙLUåï§Û¯@öÙ)ð÷×ÏF ‘¼»÷ž×|?< €(r€Zö™D^¦þ;%~N!†g~|GÈ ˆˆ0°I»›ÿtû‚Xàöd>NÖÞì@M®ýg¿~¾}vë_ 1€"Ëš…çÿÿg˜å(#/§"ÂðìÃûï˜ê¤Ø%-´½Ü"•MôÔen7,yõøõÃO†ÿ¾>d*a FtM³Þüýý«ˆ—•)ïݧ¼yÒy¡Ãf-Pê§nÅeýÿþOp7µ³5‘`xû®¿ ø'Ã÷ŸøñÈÿÂÀðæÉ3ößo|Í¥ßm:õõꋟ¿2þádøtGïÛAWPú¸ @(!à4÷M£$s~¼‰8¿ÃóŸ ü‡oJ-žÃ}.èÃW¦ŸÆª‚^ <‚Ì €–0üÁB¯_}exõèCœƒ$ÃÓwZ ųî?ûÏðí'# ã_Nn`è1@uÿ °œæ¼2äçb[¢Ë#¥Ã N®ÀPeàd†ˆ+ƒª´aào ï¸x>þ€øøôõµ«üu9„ô´fîc`ø r(#›ÃÿïÏÿs±3ücaCÒò €ÀàãdÛ?ÉŸŸ_†‹á7ƒEùÁû·Å¿šnÜþÈ Ìø…¡ÔGŽaÕ ÿÄôéÛÏ+<ì¤[þhðÖc¯mDn¿Áôý`êÿ ×@ŽfÂ_L |<œÖ¿•åĵ¡Õ#@1ýüôfÅÖkH²üøÍ_ ço¼e¨ôc¸ñ‘ácÅÀñhñ¯¯H!ÄÜìÿbí>1”ûàbÿÏ4†ä€b:Z¤5oË埉±øÐ×s~fP``Ès&<`ü~ƒÿ_`pÿZú˜þüBŽ’ÿ º2ß&F?dð1øÀÀÄ/|Aå#@\òóá³·+öÜÅŸ®b¸ëÌ&P•. ¯L¸É%}}÷OAW~, ò-ÐwJÌ Xü€øú/ýñ=²åœ@óý>3˜ÊcøôèŸ?L ï?}ch^ôáäåÇ7?ZµäÏË=A1 *ñVýùùîéäY%]ËÜø1pë%ƒž;Ã׿ˆlªùþ@-…acÙ É–ŸØ™þ-†øzlj— K|ûüâÔ¦Ÿ7º×šÆð Tgñw€‚9àÿÅ—]¬ü·ž&ÚòKóq¢…À—¿ *rÌð8ÿ ¼Ÿ ¾:H˜žc ~3èJü[ òõ; ¯+gÜd8röþÍ_wfÌøûþÜ-¨Å üÿ¹:þýóÃó®mç%&FZñ¢…ÀO†x#.†»? eû÷ß_Û(008*þe`eü÷õ¶cϪgÝøöéÉ ˜¯AÁýêëoÐz Ùÿ.÷ÚÏY$x½Ü]_CŠ›! r.o¿BS:/0™00Èò2@ãš×?Ч]gØsôæÍï×§ÌøûÅ× •ídÏz“ìÇ«ç»fïšP(äbþvò?â×\ ˜&Že¯­'ž1”ϼöíõ­ƒ›¾^lÇëkd@Ø—fþ‰S—_þÿÿX†>úûÿÑÖÏÿïÙ'>ýÿÿý?*xûñ÷ÿØŽ‹À>Àò¬"&@ý^@ljp |–6Ĥ³" aÚ½ÿo (ÜüñÿÇÿ˜`ǹ÷ÿµÓå7¯_Ô Ķ@¬ļø:#È €p!å”=ëv^ýöÿÈ«ÿÿ§@õ÷÷?ÿÿgμû_&|à 6q3Š| @8CAÈ$EѰàôçÝ÷þþ_töÜò¥Ç>ü7.9ûUÔ±•*¾ |ˆE&dy±Kóõÿ Ï|ÿÿæÛÿÿÉsÿWŠßxŽMH1(ï Äú”ú €!nÕŒ#§c¾øoÛrý«¸Cñd X[ºƒ„:žÄ€"¤ùﯯ_ö½ýÎÃ}kyÚäW7Ûº  ø (g¢çkR@lÀ*ˆAÔz‡æçwP‹ÿQ#ˆ j[á´ÄƒIEND®B`‚model-builder-0.4.1.orig/model_builder/gnuplot.png0000644000175000017500000000141510536337617020323 0ustar godgod‰PNG  IHDR D¤ŠÆ PLTE<<:K65S##VBCUUUj`_bba|jjzzz_^ŠllµSRµWX¢hgªml«sr²st²z{¼us»wx½Å{{ÈzzÛqqÚ~·€º€†††œœ§—˜¤™™ª–—µ‚‚¹ƒƒ½‘¹Ž»“”­«¬¸¸¸Á‡†ÄÉÅ“’Ì––ΜœÔ††Ö‹ŠÕ›šËŸ Õ Í§¦Ë¨¦Ò¤¦Ú¢¡Û­­Ú±¯Õ½¾Û³³Ü¼¼òЉüœç¦¤â¨§ê££è¨¨ã°¯à¶·æº»ë´´ì½½ð¢ õ±°òººÿ¾¾ÄÄÄËÁÁåÁÁêÊËðÈÈýÃÃÿËÊóÓÑýÒÓýÜÛüßáÿàßÿããÿèæÿííÿïñÿðïÿõôÿ÷ùÿø÷þýýxZË.¨IDATxÚuÒ OÂ0ðzb¼ñÀa8Ô,25j¢ˆ"QŒj&+c³ï½}ÿoaÛm2kÒ¤]{iÿ- Òˆ¯ïì:MÙ4€§®çÖˆ²Š*|Ýfhr’Íe5}’éØ4·TqêœÃL€¢pò_âÛÀ/‚:ù›=-Ø7LÇ ?€³å©+Š —?Q¢ÈCàSÀ~<'ÓUegn²¾ˆWÓàÕN¸ÄS ºv”©^÷÷`\¬Éèä[K}Ù–e?É=o´ŽWäÈ(÷?[GÖgŸÕ¹¹CÃ0˜ì ›ùJyQŽV– £²:ß84˜Šv¼GûR'bÁ°9>(¼¿$5¸`é_UH¤BÜ 4àÿoéz0Ü:H€ÎŬA2VtM y›¿“@ïÔK—ṑ9q/²bOÈ Øî…a’›NÞS÷| °*Òï¯ô AAü¾À{ ^ÞÕ3…^›(UÁYcáî‘j"µ~‰Å4ªM­0Ð@FìÔÝ`FcÑ%½yö-däç¥G1ü£SVüß›‰ÙIEND®B`‚model-builder-0.4.1.orig/model_builder/graphics_section.png0000644000175000017500000000527410536337617022166 0ustar godgod‰PNG  IHDR$$ᘘgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe< NIDATxÚbùµoÃÿÏ2ü}ýŒáÿ»W ÿ>¾gøÿõ+Ãÿïß~þa`øóŸá?bøÏ@KàX.£Ä –¿Oï1ü{rÌk†Ÿ>0üÿtÌ ¿èæ†kœ|2@Jˆ?Ó¿Oþ¿…†Ì—/@Ç@Bæÿoú8n³óZ) f –Àhúÿé#$š~ü†Ì_ C€®øKÇ€ÄÁˤ„€˜ €˜þø ™ïPÇC††!ó„ëºØkö/ [ÿÓÿ¯_!ó24ï˜Ù¾bþ ÄßA4@±üÿñ âCþÒ>z˜þÿÃ"üê ?ÄI3”9æ $ȉ‹2VÎ×X„A äÐÿÄvÌ?Ê|ý“‰é7±jï±ó€ôœ•ã6¥ŽÆÿÄe§lœXþý:ä!#0>1³ÂÒÜÄD©c>3³þÀ•'ÑCà ÇgÍïŸø?2³>øÆÄòæ- ÛK¨Ô/˜€¢ØAŸ˜Yp:è'#ÓïÏÌ,ßaü \‚xþýùÿŽ…íÎw&æÙ¸¯A¥~ÀÔÅúÉÈü‹KÎùÅÈô-ÿŸ²rÓÌ_FÆ·8xŸ°üÿÿã1×–ÿÿ~Üàà;Uw4@Qä ¥+…d/2aÉ£¯YÁÑõÿ%+Ç ÿ ÇGP€CæáIná+×9øCïTù7˜>€Âé ¿ÿ24=ûȰ!ª€a*¯V5—¸ž`f{ÇôÿÿoôÄ ¹ßÀxy…“ÿ:4jAúÈùï/ˆ~sœGä$¨FëSä l]þôa.¯$ƒUVƒ€  ƒÈÃÀš†#Áîæ¿d>þÍȪ­åJ•ÿÀz Œžïظn„¾1z¿HXaÈa Øâ¯ÀœvʧC€ÂpÐþÏ?öi[2psp2¨éè0,­)cèFrÌ#`ÂSÞÿüýäî[ÁÏŸ?+ÜcøÅ¥ÇÎÂàªËÂðî9°,æú/.Âùý+3󃎹÷…™õÔ!ŸAr È縅æi.X VÐdÐÔÓgø ¬ý?¼|Îàÿþ1ƒ„àòK²ª {žžfˆ3}Å0—ÍIÿÛÁÏ>¼ÿö—aø]Ø Í›4øTc…ήYt›CMó8(0?°°ûÀÌúê£ÞAë¯?ûxÅ@9MêP€BICGÞ}dÔ5b¸qû6CfaÃö½{¬§Ìg¸”×Ä ¾h3£šúô ¿_)1ð³22üûù›á0mÿöŠ!9ú?ü}â ¾y+,~êkË™÷ Ëß²r¹ÊÉ ä8hþ­¿@Tû?‚Ò Ä‚œnvëÛ1¨ss1ÈJI1¬Y²˜Á΂AÏŒAñ30´Þd~¿”áÀÅ_ ^R²À&Ë7 þÉðñç_q«÷ >þgàÐ,f`xõâ+ûwïx7îØUûçëçg—,,þ=¼xô‘¯ƒC+r™ƒTý‚•Ö¡ÕâJ fæ 7nÝfpusg8yú ƒ·¯?(þÿýËpãê9†0Ó žJ2ð£óß›O ÿ¿ýc8òúC 3ÃÞ« Fvþ Þ¾a8qpÃþ# ØbùÏÁe¶./Î"II,ìãÇL8*Vxs €À 6¼ûÊ æàÌð Ø°·±²dxpÿƒ­µß߿€¼døóëßw縃kì ÿ^ÛPŸÿ‚ý$¬ø lÖ{&=†×Ož0¼{õ’áðá# ÿþþ†CU\ƒ¤Š C‹‡9Çë«€Šð•mvÐ `Bæââb¸u냚ºîÝ{ÌÍÌ®\¾Äðúõk†?þ00~¾Âpàòk~^p©óÕÙ¤€Ñú–áã{`ô[¡b"B ß¿ÿ`Ðgæè³€¤H’3ôÎ;F ¶3.(í(š0|ûöÁÚÚ:æf¦ ·€ û°÷ñØšüòå/3(}2âªï~CñË—ÀÜù™………áÍ» ìl¬ ëŽk‡K€5ëK7é÷/S€Dp@L—ÙxÀŒC'N0¨ik3lؼ…AXËp¨±²±1|ÿö…áå'v]6†#/?¡6IŸ0ƒé¿ÀtöóçO°ÃTdú~|9øþLJøý—¿¼~ý‘áïÏ ÿ•+1;68—‰ˆŠsÔòE ´5ÔÁÒ14‚F 3ÃÝ›7^ÿƧ~è½f8ñ ÞZ`ø"ü“áÁË ÿ>\dø÷ßÂb zzz´µuNAË›¿KNìuÏ–aVdc†—Pì–Ç@ÌÓT$ÖŸ=Ï ¬­Ë )) N{Oo`€C” ˜Ä˜Yø„Dþübxzi C+3ƒŠÉc66ÿà ÀËÈÀ ,×N½ÔdàufNìÙù”OXTyÞâ[Ç>|ùÅÁ &ÏÆÊºìÒ59!‘mìììoÑ@Œï½ÌÁáPó…‘Á(>ìÃ{À æf{õ”áòù À‘›ßÒ–áÀ¿? º?'1س"RP÷32nÙqvùh†;~uâd¹uGPlï­ý»ÅcùØÕ~ÿÿ+-!$Á–5/ß3¬yñn²˜wP²ƒî Pí¾ëÇ?p,¹s0KbfŒø½óŸåËÔŸ¬Ïm~~\/ }ëÿHV³øòܰú³BHîŽî÷ü78xoï;rôûîxY°¦;ÌA¬ ºhgäͧõr¾°V#@ÁKj¦P,Ž@œl¬¿uE%_Ú|ü/xJ\ú.´øeõþ?ÐïO3±€ì|q™“ÿ*¨RUdü+/ 4ó/´|a„bf(ÊIrsy™K¡ÕÇo€b!¥AöˆûÝMÞk&_9@Ó&ÃCPÛKøÏO‘Kœ² f¿„þöŸàâçï2ã$…Àºl%lzûå×Y~±GŸ8y¾H~ýÈ÷JAí±,ƒ¨iÊ´D’ƒÿƒ;M­@¥×  ö¡ðŸ_¡ êZ<9ÔÆ122â]þàAÆwï299øÏÿãø¢naö؉ÿ!mÉBhNh,2i‚XøfŸøhœƒ|õ Ø=Þ mV€rÍ3hV…âW…sÀbg 0nÕÕ!1j=âûÐæÈ¨'À]"€b9Ï%˜|›ƒ×ó;#³ özÞ³°?†6@͈/PÌp‘Kà´ û mýÁûÐòcÐPµ…žÂBI¸L `®8 ù@D ½…ø ªܸ?Ê#j ò"·‘|Rw ê0f¨äö  P”º)¡i€øõÝgäÎ’¿q4/¾cq,V`w™3êƒc2ªIEND®B`‚model-builder-0.4.1.orig/model_builder/icones.py0000644000175000017500000012261210536340672017755 0ustar godgod#Boa:PyImgResource: #---------------------------------------------------------------------- # This file was generated by /usr/bin/img2py-2.6 # import wxversion wxversion.select('2.6') from wx import ImageFromStream, BitmapFromImage import cStringIO, zlib def getequationsData(): return zlib.decompress( 'x\xda\x01(\x06\xd7\xf9\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\ \x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\ \x08d\x88\x00\x00\x05\xdfIDATX\x85\xed\x97[l\x1cg\x15\xc7\x7f\xe7\xfbf\xefko\ \x1c\xaf\xdd\x8b\xed\x98\xc8v\x9cz#\xaa4\xc6u\x95\xa7\x00\xcd\x05\xcbE\xaa\ \xaaZE\x85\x08A\x88\nE\x8d\xc4]\xc0\x03R\x85h\x84\x80\xf6\x05\t!7\xa2\xa5\ \xc2\x81*\xb4N\x137)\xd8I\x9b\x80\x92\xb4$\xd0\xb8\x90[k7\x89\xe3\xb5\x1b\ \xdb\xbb\xeb\xbd\xcc\xee\xcc\xf00\xe3\xb5\x139\x92\xfd\x94\x97\x8c4\xda\xefz\ \xce\xff\xfc\xe7|\xff\xf3\xad8\x8e\xc3\xed|\xd4m\xf5~\x07\xc0\x1d\x00\x80,w\ \x83\x0e\xd7\xef\tE\xab\xb7\x87"qD\x14\x88\x02\xdc_Y\xd0^\xac\x8f(\xf2\xb9Y\ \xf2\xb9\xf4\x9f\xf2c\x87w\x00\xb9e\x01\xd0\xe1\xfa=\x95U\xf5\xdbw\xef~\x9e\ \xce\x07V\x03\xb0\xf8)\x9e\x1f\xbcy~\xf4\xeau\xbe\xf9\xdd\xdd$\x93W^+\x8c\ \x1d\xfa\xda\x92\x01\xe8p\xfd\xa6P\xb4\xfa\xef\xcf\xed\xfe-\xed\x9fn\xbc\xf5\ Bg\xa1\xfb\xc5A\xa53Yv\xfd\xe4\x05.^\xfa\xf0uc\xa9\x00\x10\xa5B\x918\x895u\ \x8cO\xce\xf2\xad]\xdf\xa1`\xda\x8b|\x06\xed\xf5e\x9ez\xdc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80\x11\xe0\x93\xe5\\J\xc53\x10\xc6\x13\x11\xcf\ \xf1,\xae\x96\xf8\x81\x9077g\xd7\xf2\xe6\x1co|\xee\x08\xcc\x95dS\xee\xfc9\ \xbd\xdd\x00\xfe\x0f\'\x87C\xb49\x01hV\x00\x00\x00\x00IEND\xaeB`\x82\xd5|\ \x13\'' ) def getequationsBitmap(): return BitmapFromImage(getequationsImage()) def getequationsImage(): stream = cStringIO.StringIO(getequationsData()) return ImageFromStream(stream) #---------------------------------------------------------------------- def getrunData(): return zlib.decompress( 'x\xda\x01;\t\xc4\xf6\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00$\x00\ \x00\x00$\x08\x06\x00\x00\x00\xe1\x00\x98\x98\x00\x00\x00\x04sBIT\x08\x08\ \x08\x08|\x08d\x88\x00\x00\x08\xf2IDATX\x85\xc5\x98{pT\xd5\x19\xc0\x7f\xf7\ \xeen\xb2\xd9w\x12\xf2\x94,Y\x1e\x81\x10\xc0@x4\x11\x84\x90\xc8;\x10\xa1\xe2\ Xu\xec\xb43\xa9\xce\xb43\xfd\xc3:\x1d\xfd\xa3\xb5\xb6Uj\x1fZ\xda\xce\xb0\xad\ \xe3t\xa8\xa3\xa3"iq\x00\x81@\x14\x1aEE\x1a\x1eQ\x83@\x80\xddl\x08\xec#\xc9\ \xbe\xee\xbb\x7f\xdc\x80\xd8q*\tv\xfa\xcd\xdc\xb9\xe7\x9e{\xce\xb9\xbf\xf3\ \x9d\xef|\xdfw\xae\xd0\xd6\xd6\xc6WI0\x18\x9c\xe3\xf7\xfb\xf7\xf9|\xbe\x92X,\ 6\x18\n\x85\xe6\xb5\xb5\xb5\x85\xbf\xb2\xe3\xa8l\xdb\xb6\xedf\x9b"\xdeT#Q,\ \xac\xaf\xaf/yz\xcb3\xac^\xbd\xa6\xb8\xa2\xa2\xe2N\xc0\r\x087\xfd\xa5\xaf\ \x13(\'\'G\xb0\xd9l\xb8\x9c\x1e\xacV\x1b~\xbf\x7f\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s\xa9\x0b\x96\x99\x0e\xb2\xd0\x94\ \xe0\xb6\xed\x7f\xf4\xf4\xc0\xb2\xf3\x15\xfd\xfa}\xc7\xb6\xa3G\xca\x92\x0f\ \x08M\x11\xbaW\x0e>\xef\xd7\xbd\xecBWV]\xa4\x94\xe6\xcc\x96\x9c\xd4\xe3\xe1\ \xa1\xd5k\xd6\xb8^W\x00Y\xdd\xbas\xe7|\xfcI\x16A\xeb\xd6\xd6\xc4\xc0@\xc6:u\ \xc0i\xea\xe9S\xa9\xae\x0e\x84\x94J\xc3|p\xca\x1b}\xdd\xfd\xfdY\x04\x8d\x1b_\ \x1d\x0e\x87`Y\x92\x93Z07\xdc\xdf\x17\xdc\xf8\x1a\n\xbd\xdaJ@\xe8^y\xb9\xbf\ \xfe\x85\x17\x17\x11H\x1c5\xb5\x9a\xaf\xd1\x88E\xc1i\xda\x9c\xfb\x96\xd2\xf5\ \x8a\xac\xa7\xa1{\xd6\xbf\xfb\x0e2E\xca2\x85i\x8b\xa4q\xf1\xc4\t13#\x92\x86H\ \x1a\xbf\x7f\xf9\x95\x88\x8e\x97\xaen\xa5[\xc6\x03\xa1jBS\x00l\xdf\xb2e\xfez\ 7\x12s|\xf0v`\xe5\n\x94\x99_E\x90\xfb\xba\x96\x9c\x14\x9f\xb8\x1f>wn\xf6\xe9\ _\x81uk\x03{\xf6@U\x8b^ae\xe0o\xc6\x9c\x8e\x86\xf5\xc2\x80\xf9\x00\x00\x00\ \x00IEND\xaeB`\x82\x9c\xf8S*' ) def getplotBitmap(): return BitmapFromImage(getplotImage()) def getplotImage(): stream = cStringIO.StringIO(getplotData()) return ImageFromStream(stream) #---------------------------------------------------------------------- def getspreadsheetData(): return zlib.decompress( 'x\xda\x01\xee\x06\x11\xf9\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00$\ \x00\x00\x00$\x08\x06\x00\x00\x00\xe1\x00\x98\x98\x00\x00\x00\x04sBIT\x08\ \x08\x08\x08|\x08d\x88\x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xd4\xd4T\xbb\xc5\x81\x93JVWWYY]\xcd\xab\x91\ \xdf\xbcy\xc3\xc6\xc6\x86\xf3\x1e\xa7\xa08\xd5CQQ\x11\xc5\xc5\xc5\xde\xe0\ \x81\x80\xff-\xac\x08\xa0\xad\xad\x8d\xee\xeen.]\xbaD\x7f\x7f?\xe1p\x98\x9a\ \x9a\x1a\xfep\xe6L^\xe7\x92\x92\x12\x9f\x8f\x94\x95\x95\xf9\xb0\xca\xcaJ\x1f\ VSS\x03\xf8}(\x1a\x8d\xfa\t\xe5Z__\xdf;\x9d\xfa\xd7T\x8c\xf1x\xdc\xe7m\xeft\ \xeat:M$\x12\xe1\xca\x95+\x1f\xd4\xa9\xbdE\x0c\x04\x02\xc4b1\xae^\xbd\n|\x10\ \xa7\xb6\xc0U(\x16\x8b\xcd,--U\xd8\xb6]\xb2\xb0\xb0\xa0\x00\x1b\x1b\x1b\\\ \xbf~=\xef\x8e\xb9\xb99\xe6\xe7\xe7\x7f\x11\x96\xfb>\xe0\x1e-\xcb\xb2\xac@ `\ \x15\x17\x17\xe7\x15E\x96\xfb}(\x04\xfc\t\x08\xe1\x14\x90~\xc7z?\xcd\x02\x9e\ \x02C\xc0?\xa2\xd1\xe8\x9b\\\x0c\xfd\x1b\x98v\x8f\xca\xfb\'em\xfb\xbd\x04^\ \x016l\x05\xf5K \x06\xec\xdfA\xe4}\x91\xb2\xb6\x1d\xdf\x02) \x0b\xee\x92\xfd\ ?\xb5\xff\x00\xf0\xb7\x88\x97\x1a\x9f\x1b\x83\x00\x00\x00\x00IEND\xaeB`\x82)\ ,]\xf9' ) def getspreadsheetBitmap(): return BitmapFromImage(getspreadsheetImage()) def getspreadsheetImage(): stream = cStringIO.StringIO(getspreadsheetData()) return ImageFromStream(stream) #---------------------------------------------------------------------- def getsaveData(): return zlib.decompress( 'x\xda\x01\xc3\x05<\xfa\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00$\x00\ \x00\x00$\x08\x06\x00\x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\xa7\x92\xd5/\ ..\x12\xc7qq\x00\x8b\xe8\x89in\xee_\xde{VVV\xf2\xe1\x95\x02\xe8$;j\x92\x1e\xaa\xe3$M\x9d\ .\xcb\xab\xeb\xff@G)\x00PJ\x15\xe9\xc3I\xf5*\xe7\xdf\x18P\x92}]\xfc/(\xa8V\ \xab\xbf\xaa\xd7\xeb?\xad\xd5j\x0bGw/\xeb\xb4\xa2{\t\xe8\xf6\xed\xdb\x7f\x06\ .\x00{\xa7\xf4\xcc&i\xd4=\x19\x10\xd0\x01>$\xfd\x7f\xe64\xb4\x93=\xf3\xc4@\ \xfd\x0cf\xfa\x15 F#\xb2\xe5x\xe7XI\xff\x05\xdfDwH\xc5\xdc\xec\x9a\x00\x00\ \x00\x00IEND\xaeB`\x82\xee\x06\xda\x92' ) def getsaveBitmap(): return BitmapFromImage(getsaveImage()) def getsaveImage(): stream = cStringIO.StringIO(getsaveData()) return ImageFromStream(stream) #---------------------------------------------------------------------- def getOpenData(): return zlib.decompress( 'x\xda\x01k\x07\x94\xf8\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\ \x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\ \x08d\x88\x00\x00\x07"IDATX\x85\xb5\x97{l\x14\xe7\x15\xc5\x7f3\xeb\xf5z\xd7\ \x8f]\x9b\x05\x8cm^6\xa4\x100\xe0\xe0\x94\x94\xf2\x0c!\xc8\x88\x16L\xd2\x86\ \xa4%\x14AK\xaa(\x90@[\x12\xb5R\x89\xd2\xaa\x846j\x08\r\x02JJC\xa9@\x91\x92\ \xb6PR\x92P\x88\x15B\\^\xc62\xe0\x17/\x1b\xf0\x8b\xf5\xda\xfb\x98\x9d\x9d\ \xdd\x99\xf9\xfa\xc7\xee\xda\xc6\x98G\x089\xd2\xd5H3s\xe7\xdcs\xbe\xb9\xdf\ \x9d\x81\xfb\x8c\x9cE\x87\x8a\x06}\xffP\xd9\x13\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\xc1\x0f>:\x1b\x12G\xda\x84\xd8\\~\xa3nU\ \x17\xe2\xa7[/\x88\xbc\xa7\xfeY\x93<\xf0\x9b\xf7Euo\xc8Y\xc5\xcb\x87\x17\xbd\ x<\xf0\xc9EC\xec<\x19\xee"\xff\xfb\xd1N1\xf1g\'\x95\xfe3\x7f{\xdfU\xf7FR\xde\ \x93\xbb\xd7<\xf6Z\xb5x\xf7\x84*\xf7>\xf4\xe0\x02\x85q\xe4\x82\xc5\xc9\x00\xdc\xd0\xa1\xff\ \xd7\x0b\xf4\x8e:\x10\x12O\x9f\x1e\x9e\xcbq\xd2\xc6\x04[\xe9\xf2\x1a\x13\xa4\ \x83\xce\x1f0\xf3`\x9a\xc2\xfb\xea7eT\xff7\xbcu\xf33\x7fz\xda\x87sD\xbb\xdd\ \xca?\xcd\xbc\xf7YGNcu]\xcc\xeb\xb2\xe3\xe3\x93\xec<`\xfe\xc7h*\x80\xff\xba]\ \xfa\xbf\xe1\xa5\x03\xf8\x070\xcd\xe7\xd0\xc7\xda\xb4\x13\x00\x00\x00\x00IEN\ D\xaeB`\x82>\xa1\xf3\x92' ) def getSaveBitmap(): return BitmapFromImage(getSaveImage()) def getSaveImage(): stream = cStringIO.StringIO(getSaveData()) return ImageFromStream(stream) #---------------------------------------------------------------------- def getSpectrumData(): return zlib.decompress( 'x\xda\x01\xfd\x01\x02\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00(\ \x00\x00\x00"\x08\x06\x00\x00\x00-e\x9b\x0b\x00\x00\x00\x04sBIT\x08\x08\x08\ \x08|\x08d\x88\x00\x00\x01\xb4IDATX\x85\xcdWK\x92\x84 \x0cMt\x0e\xd2\x07\xa1\ W\x1e\xac\xe3\xc1X\xc5\x83\xf4E4\xb3\x98\tE\xa3-$:=\xbe*\xaa\xf8\x08<\xf2\ \x12\x0c\x88]\x0fWF\xf7\xdf\x04j\xf8:k!Yf\xd9\xea\xc7\xae\xc7#\xeb\x1e\xb6\ \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xbf\x01\xefY\x0e\x1a\xba\x7f\xef\x1f\x00\x00\ \x00\x00IEND\xaeB`\x82\x9c\x8a\xe6\x0f' ) def getSpectrumBitmap(): return BitmapFromImage(getSpectrumImage()) def getSpectrumImage(): stream = cStringIO.StringIO(getSpectrumData()) return ImageFromStream(stream) #---------------------------------------------------------------------- def getCWTData(): return zlib.decompress( 'x\xda\x01\xf1\x04\x0e\xfb\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \ \x00\x00\x00 \x08\x02\x00\x00\x00\xfc\x18\xed\xa3\x00\x00\x00\x03sBIT\x08\ \x08\x08\xdb\xe1O\xe0\x00\x00\x04\xa9IDATH\x89\xb5V\xdfO\x1cU\x14\xfe\xce\ \xb93\xb3\xbb\xb3,\x0bK\x7f@\xd9\x96\xc5`k\xa1\x10\xad&\xad\xa9\xd6\xd8\x07\ \x13S\x8dI\xfd\x0b\x8c\xf1\xd1\x17\xe3\x9f\xe1S\x9fL\xfc\x0fH\xfa\xd46\x1acb\ b\xac&\xd2\x12\x05["\xd0\x00\xddmE*\xb0\xec\xb2\xcc\xcf{\x8f\x0f\x0b\xbb\x0b\ lm\x9b\xd0/\xf3p\xe7\xcc9\xf7;\xf7;\xe7\xcc\x0c\x89\x08^$\xacg\xf4\x8b\xa2\ \x08\x80\x888\x8e\x03 \x8ecff\xe6\x03#X]]]XX\xf0}\xbf\xbf\xbf\x7fee%\x8a\xa2\ \xb1\xb1\xb1\x9e\x9e\x9e\xa7\x06RC\xa2\xc5\xc5\xc5\xf1C\xd7H\xedJJ\xb4\x90\ \xa2\xdd\x16\xb3\xcfg\xaf\xa5\xcb\xef\xfc\xac\xfb\xd3\xbd\'\xc8f\xb3\xe5\x8e\ \x8dg<\xd0\xffC\xb5H\xd7\\\xb9\xae{ \xbb\xef\xc1\xd3\xabt`\x04w\xef\xde\x15c\ \x08\xf2\\\x17\xb6\xaf]\x10#m\x08FFF\x98\t\xcf\x07!\x80\x80\xbd\xc4-\xba\xec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c4\x11\xac\ $\xe1G\xb05\x98\x00\x03&H\x0c\xcbBl@\x15dF\xed\xa9\x1b\xf6\xe5\xd1\x8e?\xc60\ \xf9\xcd\xe0\'\xf9\xf7J\xe9\xe4\xc6\xc6\x88{\x9en\xb5!\x00\xf0J\xf2\xde\x0c\ \x86]xC\x98+\xe1\xf8\x1ar\x0e\xc24j\x0e"\x036\xe0\x96/\x1a\x1bp\x00\xceb#\ \x81\xe0O\x8c\x96(\xffN\xea\xc74jwRgs\xc1z\x9b"\xaf\xaf\xaf\x9f\xc9z\x80\xeb\ c\xd8\xc5\xea\x00\xa4\x07z\xd3d\x84\xbblD6"\x86\xd1`mX\x98\x19b!\xb2\xa05\ \xd25\x93\xb2\xd9=\x89(\x07\xcfA\xff\x16\x9cl\xd8\xd1\x9c\x04\xd9A\xb5Z\xadT\ *\xd2\x82R\xa94;;\xdbj)\x16\x8b\xb7o\xdfn\xb5<|\xf8pbb\xc2\x18\xd3\xea399\ \xe9\xfb~\xfd\xb6\xf9\xeb\xf8\x82\xf0\xc2\x7f\xbc\xfe\x03-\t\x95L\x84\xe5\ \x02g\x00\x00\x00\x00IEND\xaeB`\x82\xb8\xf3a\xd7' ) def getCWTBitmap(): return BitmapFromImage(getCWTImage()) def getCWTImage(): stream = cStringIO.StringIO(getCWTData()) return ImageFromStream(stream) model-builder-0.4.1.orig/model_builder/index.html0000644000175000017500000000104610536337617020122 0ustar godgod userguide

Model Builder User Guide

Contents:

  1. Introduction
  2. The Main Interface
  3. Spreadsheet output
  4. Graphic Output
  5. Sensitivity Analysis
  6. Uncertainty Analysis
  7. State-space diagram
model-builder-0.4.1.orig/model_builder/lhsframe.py0000644000175000017500000002527710745434105020304 0ustar godgod #----------------------------------------------------------------------------- # Name: lhsframe.py # Purpose: Implementation of the uncertainty panel # # Author: Flavio Codeco Coelho # # Created: 2006/08/31 # RCS-ID: $Id: lhsframe.py $ # Copyright: (c) 2004 # Licence: gpl # New field: Whatever #----------------------------------------------------------------------------- import wxversion wxversion.select('2.6') import wx import os,cPickle from Bayes import lhs, Melding as meld from lhsframe_glade import wxFrame from numpy import * from pylab import load class LHS(wxFrame): def __init__(self,*args,**kwargs): wxFrame.__init__(self,None) self.parsAppended = (0,0) self.phi = ['a','b','c'] #to be overridden at runtime self.theta = [] #to be overridden at runtime self.fileName = ''#to be overridden at runtime self.specs = {} self.priors = [[],[]]#list of distribution names and their parameters self.priords = [] self.lhoods = [] self.Done = False self.distCB.AppendItems(lhs.valid_dists) #binding events self.button_2.Bind(wx.EVT_BUTTON,self.onOkButton) self.setBtn.Bind(wx.EVT_BUTTON,self.onSetButton) self.button_3.Bind(wx.EVT_BUTTON,self.onCancelButton) self.anaChoice.Bind(wx.EVT_CHOICE,self.onAnaChoice) self.alpha = 0.5 #event handlers def onOkButton(self,event): """ Handles the Ok button """ self.specs['samples'] = int(self.sampleSpin.GetValue()) self.parnames = [k for k,v in self.specs.items() if k not in ['samples','alpha']] if self.anaChoice.GetStringSelection() == 'Uncertainty': self.alpha = int(self.alphaSlider.GetValue())/100. self.specs['alpha'] = self.alpha #check if all variables are present in the dictionary. if len(self.parnames) != len(self.phi)+len(self.theta): dlg = wx.MessageDialog(self, 'You have not defined distribution for All the parameters and variables!', 'Incomplete Settings', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return elif self.anaChoice.GetStringSelection() == 'Sensitivity': #check if all variables are present in the dictionary. if len(self.parnames) != len(self.theta): dlg = wx.MessageDialog(self, 'You have not defined distribution for All the parameters!', 'Incomplete Settings', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return if self.likTC.GetValue() != '': if self.readData(): #if read data fails return self.genPriorList(self.anaChoice.GetStringSelection()) self.priords = [] #check mode of sampling to run if self.radio_box_1.GetLabel() == "Random":#Random sampling self.priords = lhs.lhs(self.parnames,self.priors[0],self.priors[1],int(self.specs['samples'])) else:#LHS sampling if self.radio_box_2.GetStringSelection() == "User-specified": #print"doing 1" self.priords = lhs.lhs(self.parnames,self.priors[0],self.priors[1],int(self.specs['samples']),noCorrRestr=False,matCorr=self.getCorrMatrix()) elif self.radio_box_2.GetStringSelection() == "Random": #print"doing 2" self.priords = lhs.lhs(self.parnames,self.priors[0],self.priors[1],int(self.specs['samples']),noCorrRestr=False) else: #print"doing 3" self.priords = lhs.lhs(self.parnames,self.priors[0],self.priors[1],int(self.specs['samples'])) self.saveSpecs() self.Done = True dlg = wx.MessageDialog(self, 'Now press the "Start" button on the main window!', 'Start your Simulation', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() self.Lower() def onSetButton(self,event): """ Handles the set parameter button """ if not self.distParsTC.GetValue(): dlg = wx.MessageDialog(self, 'You have to enter parameters for the distribution selected', 'No Distribution Parameters', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return self.specs[self.parsCB.GetStringSelection()] = {'dist':self.distCB.GetStringSelection(),'pars':self.distParsTC.GetValue()} line = '%s: %s(%s)\n'%(self.parsCB.GetStringSelection(),self.distCB.GetStringSelection(),self.distParsTC.GetValue()) self.logTC.AppendText(line) self.frame_1_statusbar.SetStatusText('%s set'%self.parsCB.GetStringSelection(),0) def genPriorList(self, anatype='Uncertainty'): """ Generates the list of priors in the order expected by the melding """ self.priors = [[],[]] npar = len(self.theta) neq = len(self.phi) for i in xrange(npar): self.priors[0].append(self.specs[self.theta[i]]['dist']) self.priors[1].append(tuple([float(n) for n in self.specs[self.theta[i]]['pars'].strip().split(' ')])) if anatype == 'Uncertainty': for i in xrange(neq): self.priors[0].append(self.specs[self.phi[i]]['dist']) self.priors[1].append(tuple([float(n) for n in self.specs[self.phi[i]]['pars'].strip().split(' ')])) def onCancelButton(self,event): """ Cancel Uncertainty analysis """ self.Done = False self.Close() def onAnaChoice(self,event): """ Handles change in analysis type """ pars = self.phi if self.anaChoice.GetStringSelection() == 'Uncertainty': self.likTC.Enable(True) self.label_8.Enable(True) self.alphalabel.Enable(True) self.alphaSlider.Enable(True) if not self.parsAppended[0]: self.parsCB.AppendItems(pars) self.parsAppended = (1,len(pars)) #print self.parsCB.GetCount() else: self.likTC.Enable(False) self.label_8.Enable(False) self.alphalabel.Enable(False) self.alphaSlider.Enable(False) if self.parsAppended[0]: for i in pars: self.parsCB.Delete(self.parsCB.GetCount()-1) self.parsCB.SetValue('') self.parsAppended = (0,0) #print self.anaChoice.GetSelection(),self.anaChoice.GetStringSelection() def readData(self): """ Read from data file and build data vectors for likelihoods Data file must be a csv with as many columns as data vectors. Header should be distribution types. """ os.chdir(os.path.split(self.fileName)[0]) valid_dists = ['normal','exponential','bernoulli','lognormal','poisson'] self.lhoods = [] try: fname = self.likTC.GetValue().strip() data = load(fname,skiprows=1,delimiter=',') f = open(fname) likdists = [i.strip() for i in f.readline().split(',')] f.close() except: dlg = wx.MessageDialog(self, 'Could not open File.\nPlease check file name, and press Ok to try again', 'Invalid File', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return 1 # Check distribution types for i in likdists: if i not in valid_dists: dlg = wx.MessageDialog(self, '"%s" is not a valid model for the data.\nPlease fix your data file, and press Ok to try again'%i, 'Invalid Model', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return 1 #Calculate likelihoods n = 0 for d in transpose(data): m = min(d) M = max(d) dlg = wx.TextEntryDialog(self, 'Enter the limits of the Likelihood function for vector #%s\nseparated by spaces.\nData limits:[%s,%s] '%(n+1,m,M), 'Enter Limits','') try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() if answer == '': dlg = wx.MessageDialog(self, 'You have not entered limits\nAssuming data range.', 'No Limits Entered', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() else: limits = [float(j) for j in answer.strip().split(' ')] finally: dlg.Destroy() self.lhoods.append(meld.Likeli(d,likdists[n],limits)) n+=1 return 0 def saveSpecs(self): """ Saves the current uncertainty specs. """ os.chdir(os.path.split(self.fileName)[0]) fname = os.path.split(self.fileName)[1] fname = fname[:-4]+'_unc.spec' f = open(fname,'w') cPickle.dump(self.specs,f) f.close() def loadSpecs(self, fname): """ Load specs from last uncertainty analysis ran from file fname. """ os.chdir(os.path.split(self.fileName)[0]) f = open(fname,'r') self.specs = cPickle.load(f) for k,v in self.specs.items(): if k == 'samples': self.sampleSpin.SetValue(int(v)) continue elif k == 'alpha': self.alpha = float(v) continue line = '%s: %s(%s)\n'%(k,v['dist'],v['pars']) self.logTC.AppendText(line) f.close() self.frame_1_statusbar.SetStatusText('Parameter specifications loaded, press OK to continue.') def getCorrMatrix(self): """ create a Numeric array with the contents of the spreadsheet """ if self.anaChoice.GetStringSelection() == 'Uncertainty': dim = len(self.theta)+len(self.phi) else: dim = len(self.theta) data = zeros((dim,dim),float) for i in xrange(dim): for j in xrange(dim): data[i,j] = float(self.grid_1.GetCellValue(i,j)) #print data, data.shape, data[0,0] return data if __name__ == '__main__': app = wx.PySimpleApp() LHS(None).Show() app.MainLoop() model-builder-0.4.1.orig/model_builder/lhsframe_glade.py0000755000175000017500000001576210536340634021442 0ustar godgod#!/usr/bin/env python # -*- coding: ISO-8859-1 -*- # generated by wxGlade 0.3.5.1 on Thu Aug 31 11:12:37 2006 import wxversion wxversion.select('2.6') import wx import wx.grid class wxFrame(wx.Frame): def __init__(self, *args, **kwds): # begin wxGlade: wxFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) # Menu Bar self.frame_1_menubar = wx.MenuBar() self.SetMenuBar(self.frame_1_menubar) wxglade_tmp_menu = wx.Menu() self.frame_1_menubar.Append(wxglade_tmp_menu, "File") # Menu Bar end self.frame_1_statusbar = self.CreateStatusBar(1, wx.ST_SIZEGRIP) self.radio_box_1 = wx.RadioBox(self, -1, "Sampling Type", choices=["LHS", "Random"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.label_1 = wx.StaticText(self, -1, "Analisys type:") self.anaChoice = wx.Choice(self, -1, choices=["Sensitivity", "Uncertainty"]) self.label_8 = wx.StaticText(self, -1, "Data FIle:") self.likTC = wx.TextCtrl(self, -1, "") self.alphalabel = wx.StaticText(self, -1, "Alpha:") self.alphaSlider = wx.Slider(self, -1, 50, 0, 100, style=wx.SL_HORIZONTAL|wx.SL_AUTOTICKS|wx.SL_LABELS|wx.SL_RIGHT) self.static_line_1 = wx.StaticLine(self, -1) self.sampleLB = wx.StaticText(self, -1, "Samples:") self.label_2 = wx.StaticText(self, -1, "Model Parameters") self.label_3 = wx.StaticText(self, -1, "Distributions") self.label_4 = wx.StaticText(self, -1, "Distributions Parameters") self.lixo = wx.StaticText(self, -1, "lixo") self.sampleSpin = wx.SpinCtrl(self, -1, "100", min=0, max=10000) self.parsCB = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.distCB = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.distParsTC = wx.TextCtrl(self, -1, "") self.setBtn = wx.Button(self, -1, "Set") self.label_6 = wx.StaticText(self, -1, "Log:", style=wx.ALIGN_RIGHT) self.logTC = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.HSCROLL) self.radio_box_2 = wx.RadioBox(self, -1, "Correlation Control", choices=["Random", "No Correlation", "User-specified"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.grid_1 = wx.grid.Grid(self, -1, size=(1, 1)) self.button_2 = wx.Button(self, -1, "OK", style=wx.BU_BOTTOM) self.label_7 = wx.StaticText(self, -1, "' '") self.button_3 = wx.Button(self, -1, "Cancel", style=wx.BU_BOTTOM) self.__set_properties() self.__do_layout() # end wxGlade def __set_properties(self): # begin wxGlade: wxFrame.__set_properties self.SetTitle("Sensitivity and Uncertainty Analysis") self.SetBackgroundColour(wx.Colour(192, 192, 192)) self.SetForegroundColour(wx.Colour(50, 50, 204)) self.frame_1_statusbar.SetStatusWidths([-1]) # statusbar fields frame_1_statusbar_fields = ["frame_1_statusbar"] for i in range(len(frame_1_statusbar_fields)): self.frame_1_statusbar.SetStatusText(frame_1_statusbar_fields[i], i) self.radio_box_1.SetSelection(0) self.anaChoice.SetToolTipString("Select the type of analysis") self.anaChoice.SetSelection(0) self.label_8.Enable(False) self.likTC.SetToolTipString("Enter the path for your data file") self.likTC.Enable(False) self.alphalabel.Enable(False) self.alphaSlider.SetMinSize((100, 40)) self.alphaSlider.SetToolTipString("Adjust the value of alpha for the Bayesian Melding analysis.") self.alphaSlider.Enable(False) self.lixo.Hide() self.sampleSpin.SetToolTipString("Enter the number of samples for this analysis") self.parsCB.SetToolTipString("Select a parameter to specify.") self.parsCB.SetSelection(-1) self.distCB.SetToolTipString("Select a distribution for the parameter selected on the left.") self.distCB.SetSelection(-1) self.distParsTC.SetToolTipString("Select the parameters for the distribution selected on the left.") self.setBtn.SetToolTipString("Press to record the specifications selected on the left.") self.logTC.SetToolTipString("parameters specifications recorded are listed here") self.radio_box_2.SetSelection(0) # end wxGlade def __do_layout(self): # begin wxGlade: wxFrame.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) grid_sizer_1 = wx.FlexGridSizer(3, 5, 3, 5) sizer_4 = wx.GridSizer(1, 7, 0, 0) sizer_4.Add(self.radio_box_1, 0, wx.ADJUST_MINSIZE, 0) sizer_4.Add(self.label_1, 0, wx.ALIGN_RIGHT|wx.FIXED_MINSIZE, 0) sizer_4.Add(self.anaChoice, 0, wx.FIXED_MINSIZE, 0) sizer_4.Add(self.label_8, 0, wx.ALIGN_RIGHT|wx.FIXED_MINSIZE, 0) sizer_4.Add(self.likTC, 0, wx.FIXED_MINSIZE, 0) sizer_4.Add(self.alphalabel, 0, wx.ALIGN_RIGHT|wx.FIXED_MINSIZE, 0) sizer_4.Add(self.alphaSlider, 0, wx.FIXED_MINSIZE, 0) sizer_1.Add(sizer_4, 0, 0, 0) sizer_1.Add(self.static_line_1, 0, wx.EXPAND, 2) grid_sizer_1.Add(self.sampleLB, 0, wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_2, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_3, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_4, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.lixo, 0, wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.sampleSpin, 0, wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.parsCB, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.distCB, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.distParsTC, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.setBtn, 0, wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.label_6, 0, wx.ADJUST_MINSIZE, 0) grid_sizer_1.Add(self.logTC, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) grid_sizer_1.AddGrowableRow(2) grid_sizer_1.AddGrowableCol(1) grid_sizer_1.AddGrowableCol(2) grid_sizer_1.AddGrowableCol(3) sizer_1.Add(grid_sizer_1, 0, wx.EXPAND, 0) sizer_2.Add(self.radio_box_2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer_2.Add(self.grid_1, 1, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.FIXED_MINSIZE, 0) sizer_1.Add(sizer_2, 1, wx.EXPAND, 1) sizer_3.Add(self.button_2, 0, wx.ADJUST_MINSIZE, 0) sizer_3.Add(self.label_7, 0, wx.ADJUST_MINSIZE, 0) sizer_3.Add(self.button_3, 0, wx.ADJUST_MINSIZE, 0) sizer_1.Add(sizer_3, 0, wx.ALIGN_BOTTOM|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) self.SetAutoLayout(True) self.SetSizer(sizer_1) sizer_1.Fit(self) sizer_1.SetSizeHints(self) self.Layout() # end wxGlade # end of class wxFrame if __name__ == '__main__': app = wx.PySimpleApp() wxFrame(None).Show() app.MainLoop() model-builder-0.4.1.orig/model_builder/mathematics_section.png0000644000175000017500000000340410536337617022656 0ustar godgod‰PNG  IHDR szzôgAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<–IDATxÚbüÿÿ?Ã@€bb`@î€pЀ; €ÜÄHªf.™œ<ÂñœÜ" ŒŒ@÷ƒ0„fDbcãƒðï_øóŠÏw§%¿#©–ó ÊÄwuMd°0R‹aÏÅAtùGÏÞ1d•t1¼zõtãÏç»’ˆ‘Ë>ß×Ù5ÁDO·ÂÿÈÖcwÔç/ß j&1ܽw@±YLL `×V“fxùæ+CvA1ÃÏ_ÿ°D3”ψzHt°³³1”åD1ðóó3°±ó302³› ñ‰…‰dÈ÷ï¿^½ùÆðüÉí‡ÿ½Ÿ´àÿƒ8€n1#ÜŒ 09&6AåÚŽOi<Ü< /_>=ýëõ±>€"%Àøû?@Ÿÿøõï—Ç€2/€ø+±¹î3ÓõÏo~óþz{ê8ÿ €Hp3Ø'߀!ðó×_ [ØDA©ˆ_ñbMùõúè| Í->i€…ÀÏ¿@6‹(Ô ‡á ™é7ƒ²ÿ 0^Þ @$ Æ+ÿÿ|óþ÷ëÃs¨bˆýÀ8„¥P02B„…ŒÂìƒ@±Kh¤f¶Á3ÉžíótÎ=´›éÿ¿¿?Þ‡ûè8n.v†oð`†•¤à¬ÌÄÆ,˜ ˜˜ rò@ÏÈÔ02²e;–iËÿ¿ßüýúø54ÔÀ €X@f°±0Ãçí›Êð÷“Ú¥‹G7½éûï×{ˆ#€†11,€–!R+"//ÿ¼ôô\u M3S3h!ôŸáÙ³çÖOŸ¿`ؼu—õÖ»ãÿsüòý÷ãå#˜Çˆùç¯ß®‡¬:tp=0ƒ°°4ƒŠŠ>çO…ß¼ÿè ­íÿÿ~ÿÌÂ%-ÏÇ/§®fN„gÎaøûõá"`^þ _;gÞ*Kq†‡ž0lÚ²áÂÅ« ÊÊê ’Ò – /_½¹÷è9翯@¹çÈÄò÷û / CŽ‘MÀbû¶€þáÖÖ±`ððŒ2™U¯^= ‰ÿàø†D÷ß!é3œÞ\Üüü›7ofPPTç÷I{¾}þüá3+çé³ËK+ÀjÝ\Üvî=`d ñPb hŠ*^ýcæxµ}Çâ¥@ y´µÍ<Ü#A6¨^»vfÙ¿¿?:!¥Ð¿ài€áÿ¿?'^¾|Ö¸dñ,yF&VY`ˆX{•™‰‰M‹™•‹áã§Ÿà4&((.QL fé @úä¢ß_ì&šð;—­;BË„ÁÃ-Œáׯ?Fwî]k…Ø÷L üùò‘…k?#{>#‹¹”Œ2·´´¢™ŠŠƒªªƒÇO?àU#Zâ ´ÚâÇßoOö30±kÕÊŸþaÌàæÄðiýgUÍ¿ÿþc`ce†Vµ@“8Dµ8yDÖzzÆðki›0ppr1|xÿŠáÂùà î`øñ‡‰!?§ZIýg€ä ,UÖ¿_ì…ÄWþc`âQW×g Iaøþõ3X+ <™8Óœ#ùÕ4,€Žc`¸væÃú5ý¯Y£äŽ ”qå—/È媈 G½ùãÏç;ûÿý|~øÐ–/wï\'.n^>°ïAáf9`.`ø÷è? ¾}ëЗœ§€EõfwP‚²# =†b@±à®ÕŽøt·Ìáûn[É£¥©ƒV7€éÏŸ>¾g`…pÍ<~ýçðþõÙ[VF…AYµíÀÈ­ °ç_1 vÄï×öÿûþ:|Ïþ_nݾXøÿï×üý60<~rÌ“að÷eðó–w?–¬šÇðúÍ+¸¡\ ÌÜ`W<Ï@ŒD¶9X ™¹e¹ƒ…b9ã·ïVû·Xx•­YùZ88ùTÄÄd>~þÄðùóÇoÿÿþ:õŸáï+fvÑ0 >Hý ¹ßï/gþùtc3Pïs€b$¡ñÊò K1Tö  Åª(Tž²ÿ¡•Ùw(¤‡ ªï¨ìâ·DJ£”j¬ZüZ–€ä8¡r0sÿBåþCřѪä_Ä8ÐS€ðŽ @ ¸ '‡C´XüEþIEND®B`‚model-builder-0.4.1.orig/model_builder/model-builder.desktop0000644000175000017500000000037010536337617022243 0ustar godgod[Desktop Entry] Encoding=UTF-8 Name=Model Builder Comment=Graphical ODE simulator GenericName=Graphical ODE simulator Exec=PyMB Icon=/usr/share/pixmaps/MB.ico Type=Application StartupNotify=false Terminal=false Categories=Science;Math;Engineering; model-builder-0.4.1.orig/model_builder/odexml.py0000644000175000017500000001214710637773716020001 0ustar godgod#----------------------------------------------------------------------------- # Name: odexml.py # Purpose: Read and write model files in xml format # # Author: Flavio Codeco Coelho # # Created: 2006/06/30 # RCS-ID: $Id: odexml.py $ # Copyright: (c) 2006 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- from xml.dom import minidom, Node import __version__ as V import wxversion wxversion.select('2.6') import wx, sys, os from numpy import array class Model: def __init__(self): self.model = minidom.Document() self.model.appendChild(self.model.createComment("Model Builder %s - model definition file"%V.version)) self.body = self.model.createElement('body') self.model.appendChild(self.body) #output = self.model.createElement('output') #self.model.appendChild(output) self.modict = {} self.path = None def Create(self,**kwargs): """ Creates all the elements and append to the 'body' section. Takes a dictionary or keyword elements as input. """ eqlist = kwargs.pop('equations').split('\n') parlist = kwargs.pop('parameters').split('\n') #creating model name modelname = self.model.createElement('modelname') modelname.appendChild(self.model.createTextNode(kwargs.pop('modelname').strip())) self.body.appendChild(modelname) #creating equations for n,e in enumerate(eqlist): equation = self.model.createElement('equation') self.body.appendChild(equation) equation.setAttribute('number',str(n)) equation.appendChild(self.model.createTextNode(e.strip())) #creating parameters for n,p in enumerate(parlist): parameter = self.model.createElement('parameter') self.body.appendChild(parameter) parameter.setAttribute('number',str(n)) parameter.appendChild(self.model.createTextNode(p.strip())) # Creating others for k,v in kwargs.items(): Key = self.model.createElement(k) self.body.appendChild(Key) Key.appendChild(self.model.createTextNode(str(v).strip())) def addResults(self,results): """ appends results matrix to the xml file. """ pass def saveFile(self,filename): """ Saves the generated XML to disk. """ os.chdir(self.path) #if os.path.exists(filename): # os.unlink(filename) f = open(filename,'w') f.write(self.model.toprettyxml()) f.close() print "saved file", filename, "at",self.path def readFile(self,filename): """ read a model from an xml document. """ ## try: doc = minidom.parse(filename) print 'Done parsing' if self.Verify(doc): self.model = doc self.readFromDom() return 0 else: print 'This is not a model file' return 1 ## except: ## print 'There was a problem parsing the model file.', ## print sys.exc_info() ## return 2 def readFromDom(self): """ Prepares self.modict from the data contained in the dom object. """ equations = '' parameters = '' for child in self.model.getElementsByTagName('body')[0].childNodes: if child.nodeType == Node.ELEMENT_NODE: #print child.tagName if child.tagName == 'equation': for node in child.childNodes: equations += node.data.strip() +'\n' elif child.tagName == 'parameter': for node in child.childNodes: parameters += node.data.strip() +'\n' else: for node in child.childNodes: self.modict[child.tagName.encode('ascii','ignore')] = node.data.strip().encode('ascii','ignore') else: pass self.modict['equations'] = equations[:-1] self.modict['parameters'] = parameters[:-1] def Verify(self,doc): """ Check if the xml file was generated by modelbuilder """ for child in doc.childNodes: if child.nodeType == Node.COMMENT_NODE: if child.data.startswith('Model Builder'): if V.version not in child.data: print 'this model was generated in a different version of Model Builder.' return 2 else: print 'verify ok!' return 1 else: print 'not a Model Builder file!!' return 0 if __name__ == '__main__': m = Model() # add a call to run your script here m.Create(**{'modelname':'teste','equations':'x+y\nz+x','parameters':'1\n2\n3'}) m.saveFile('modelo.xml') m.readFile('modelo.xml') print m.model.toprettyxml() print m.modict model-builder-0.4.1.orig/model_builder/quivVarFrame.py0000644000175000017500000002406010536340531021075 0ustar godgod#----------------------------------------------------------------------------- # Name: quivVarFrame.py # Purpose: Miniframe to do the vector field plot # # Author: Flavio Codeco Coelho # # Created: 2006/08/20 # RCS-ID: $Id: quivVarFrame.py $ # Copyright: (c) 2004-2006 # Licence: GPL # New field: Whatever #----------------------------------------------------------------------------- #Boa:MiniFrame:quivVarFrame import wxversion wxversion.select('2.6') import wx import wx.lib.buttons import PlotFigure as PF from Model import Model from numpy import * from numpy.random import normal ch=['a','b','c'] def create(parent): return quivVarFrame(parent) [wxID_QUIVVARFRAME, wxID_QUIVVARFRAMEDRAWTRAJCHECK, wxID_QUIVVARFRAMEINITSCTRL, wxID_QUIVVARFRAMEINITSTEXT, wxID_QUIVVARFRAMELENGTHTEXT, wxID_QUIVVARFRAMELIMITSCTRL, wxID_QUIVVARFRAMELIMITSTEXT, wxID_QUIVVARFRAMEPLOTBUTTON, wxID_QUIVVARFRAMETRAJBOX, wxID_QUIVVARFRAMETRAJLENSPIN, wxID_QUIVVARFRAMEVARLIST1, wxID_QUIVVARFRAMEVARLIST2, wxID_QUIVVARFRAMEXVARTEXT, wxID_QUIVVARFRAMEYVARTEXT, ] = [wx.NewId() for _init_ctrls in range(14)] class quivVarFrame(wx.MiniFrame): def _init_ctrls(self, prnt): # generated method, don't edit wx.MiniFrame.__init__(self, id=wxID_QUIVVARFRAME, name='quivVarFrame', parent=prnt, pos=wx.Point(449, 282), size=wx.Size(334, 244), style=wx.DEFAULT_FRAME_STYLE, title='Select Variables') self.SetClientSize(wx.Size(334, 244)) self.Center(wx.BOTH) self.SetAutoLayout(True) self.SetMinSize(wx.Size(334, 244)) self.SetMaxSize(wx.Size(334, 244)) self.xvarText = wx.StaticText(id=wxID_QUIVVARFRAMEXVARTEXT, label='X - axis', name='xvarText', parent=self, pos=wx.Point(16, 16), size=wx.Size(48, 16), style=0) self.yvarText = wx.StaticText(id=wxID_QUIVVARFRAMEYVARTEXT, label='Y - axis', name='yvarText', parent=self, pos=wx.Point(200, 16), size=wx.Size(64, 16), style=0) self.varList1 = wx.ComboBox(choices=ch, id=wxID_QUIVVARFRAMEVARLIST1, name='varList1', parent=self, pos=wx.Point(16, 40), size=wx.Size(128, 24), style=0, value='Select Variable') self.varList1.SetLabel('') self.varList1.SetToolTipString('Select variable for the X axis.') self.varList1.Bind(wx.EVT_COMBOBOX, self.OnVarList1Combobox, id=wxID_QUIVVARFRAMEVARLIST1) self.varList2 = wx.ComboBox(choices=ch, id=wxID_QUIVVARFRAMEVARLIST2, name='varList2', parent=self, pos=wx.Point(192, 40), size=wx.Size(128, 25), style=0, value='Select Variable') self.varList2.SetLabel('') self.varList2.SetToolTipString('Select Variable for the Y axis.') self.varList2.Bind(wx.EVT_COMBOBOX, self.OnVarList2Combobox, id=wxID_QUIVVARFRAMEVARLIST2) self.trajBox = wx.StaticBox(id=wxID_QUIVVARFRAMETRAJBOX, label='Trajectory Plot', name='trajBox', parent=self, pos=wx.Point(16, 120), size=wx.Size(304, 112), style=0) self.trajBox.SetMinSize(wx.Size(304, 130)) self.trajBox.SetBestFittingSize(wx.Size(304, 112)) self.drawTrajCheck = wx.CheckBox(id=wxID_QUIVVARFRAMEDRAWTRAJCHECK, label='Draw trajectory', name='drawTrajCheck', parent=self, pos=wx.Point(32, 136), size=wx.Size(136, 24), style=0) self.drawTrajCheck.SetValue(False) self.drawTrajCheck.SetToolTipString('Check to superimpose a trajectory on the state diagram.') self.drawTrajCheck.SetThemeEnabled(True) self.drawTrajCheck.Bind(wx.EVT_CHECKBOX, self.OnDrawTrajCheckCheckbox, id=wxID_QUIVVARFRAMEDRAWTRAJCHECK) self.initsText = wx.StaticText(id=wxID_QUIVVARFRAMEINITSTEXT, label='Initial Conditions:', name='initsText', parent=self, pos=wx.Point(32, 176), size=wx.Size(112, 16), style=0) self.initsText.Enable(False) self.initsCtrl = wx.TextCtrl(id=wxID_QUIVVARFRAMEINITSCTRL, name='initsCtrl', parent=self, pos=wx.Point(144, 168), size=wx.Size(160, 24), style=0, value='') self.initsCtrl.SetToolTipString('Enter the initial conditions for the trajectory.') self.initsCtrl.SetThemeEnabled(True) self.initsCtrl.Enable(False) self.trajlenSpin = wx.SpinCtrl(id=wxID_QUIVVARFRAMETRAJLENSPIN, initial=10, max=5000, min=2, name='trajlenSpin', parent=self, pos=wx.Point(88, 200), size=wx.Size(72, 24), style=wx.SP_ARROW_KEYS) self.trajlenSpin.SetValue(10) self.trajlenSpin.SetThemeEnabled(True) self.trajlenSpin.Enable(False) self.lengthText = wx.StaticText(id=wxID_QUIVVARFRAMELENGTHTEXT, label='Length:', name='lengthText', parent=self, pos=wx.Point(32, 208), size=wx.Size(56, 16), style=0) self.lengthText.Enable(False) self.plotButton = wx.lib.buttons.GenButton(ID=wxID_QUIVVARFRAMEPLOTBUTTON, label='Plot', name='plotButton', parent=self, pos=wx.Point(232, 80), size=wx.Size(89, 31), style=0) self.plotButton.Bind(wx.EVT_BUTTON, self.OnPlotButtonButton, id=wxID_QUIVVARFRAMEPLOTBUTTON) self.limitsText = wx.StaticText(id=wxID_QUIVVARFRAMELIMITSTEXT, label='Limits:', name='limitsText', parent=self, pos=wx.Point(16, 88), size=wx.Size(48, 16), style=0) self.limitsCtrl = wx.TextCtrl(id=wxID_QUIVVARFRAMELIMITSCTRL, name='limitsCtrl', parent=self, pos=wx.Point(64, 80), size=wx.Size(160, 24), style=0, value='Xmin Xmax Ymin Ymax') self.limitsCtrl.SetThemeEnabled(True) self.limitsCtrl.SetToolTipString('Enter the axes limits separated by spaces: Xmin Xmax Ymin Ymax') def __init__(self, parent): self._init_ctrls(parent) self.Xselected = self.Yselected = 0 def OnDrawTrajCheckCheckbox(self, event): """ enable the superimposition of a trajectory on the quiver plot """ if self.drawTrajCheck.IsChecked(): self.lengthText.Enable(True) self.trajlenSpin.Enable(True) self.initsCtrl.Enable(True) self.initsText.Enable(True) else: self.lengthText.Enable(False) self.trajlenSpin.Enable(False) self.initsCtrl.Enable(False) self.initsText.Enable(False) event.Skip() def OnPlotButtonButton(self, event): if not self.Xselected and self.Yselected: dlg = wx.MessageDialog(self, 'Please select X and Y variables.', 'Variables not Selected', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return try: self.limits = [float(i) for i in self.limitsCtrl.GetValue().strip().split(' ')] except ValueError: dlg = wx.MessageDialog(self, 'Please enter only number for the axes limits.', 'Non numerical limits', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return inits = array([float(i) for i in self.initsCtrl.GetValue().strip().split(' ')]) lengt = int(self.trajlenSpin.GetValue()) if self.drawTrajCheck.IsChecked(): self.calcPlot(inits,lengt,traj=1) else: self.calcPlot(inits,lengt,traj=0) self.Destroy() def calcPlot(self,inits=None,lengt=None,traj=0): """ Generate the data to be plotted """ xstep = (self.limits[1]-self.limits[0])/15. ystep = (self.limits[3]-self.limits[2])/15. if not inits.any(): inits = array([float(i) for i in self.modict['init'].strip().split(' ')]) Plot = PF.create(None) trajetoria = [] if traj: M = Model(self.modict['equations'],self.modict['parameters'],inits,lengt) results = M.Run() #print results[0][0].shape trajetoria.append(results[0][0][:,self.var1]) trajetoria.append(results[0][0][:,self.var2]) xbump = normal(inits[self.var1],xstep,6) ybump = normal(inits[self.var2],ystep,6) for i in xrange(6): #calculate inits[self.var1] = xbump[i] inits[self.var2] = ybump[i] M = Model(self.modict['equations'],self.modict['parameters'],inits,lengt) results = M.Run() #print results[0][0].shape trajetoria.append(results[0][0][:,self.var1]) trajetoria.append(results[0][0][:,self.var2]) x=[];y=[];u=[];v=[] for i in arange(self.limits[0],self.limits[1],xstep): for j in arange(self.limits[2],self.limits[3],ystep): #print inits, type(inits) inits[self.var1] = i inits[self.var2] = j M = Model(self.modict['equations'],self.modict['parameters'],inits,1) results = M.Run() #print results[0][0].shape x.append(i) y.append(j) u.append(results[0][0][1,self.var1]) v.append(results[0][0][1,self.var2]) x=array(x) y=array(y) u=array(u) v=array(v) c = sqrt((u-x)**2+(v-y)**2) #map color to the size of the vector Plot.vectorField(x,y,u-x,v-y,c=c,xlabel=self.X,ylabel=self.Y,trajectory=trajetoria) Plot.Show() def OnVarList1Combobox(self, event): self.X = self.varList1.GetValue() self.var1 = ch.index(self.X) self.Xselected = 1 def OnVarList2Combobox(self, event): self.Y = self.varList2.GetValue() self.var2 = ch.index(self.Y) self.Yselected = 1 if __name__ == '__main__': app = wx.PySimpleApp() wx.InitAllImageHandlers() frame = create(None) frame.Show() app.MainLoop() model-builder-0.4.1.orig/model_builder/spreadsheet_section.png0000644000175000017500000000366610536337617022700 0ustar godgod‰PNG  IHDR$$ᘘgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<HIDATxÚLŒ±€ E¿CpÈ&N΂TŒã"Èá6DiÞ¿Ÿ¼,DçÜ+„Xñ›¼?85Pç3Œ1ÍJ)Ðzã›YÍN)Ź7ÌZ¦”rúãg#œ1îÖÚk¸)%|ˆ$yàÀÿÈîa033c8uêþýûøùùŒŒöìÙÃàââÂpêôi†‹.€Åùøø\Ý\N?ÎððáC^>>°… ó@ž’‘•aàåá…;âÊ•« š NÎN LÌ, ¦&&±nnn[V~:è@ºÈØ`†º¬A›)Ò°A`X uVÈ1¦|QHÚøÎ¥dé½àg†¾OŽGÄW’‘R "$q=ý1zGÎ{Xk¡ÔªÔZáv‡”Ò ¤$’s†2Xk:cÌFË•;?t œGÐÇÞ`¸Œ*°ÿûûl¸®®ÐÂ@ð(ü ”Y³DƒÄ ÑŠ¢ ¼¼< ÖÖ6`qYìììr@B@Ì ² €Xp¹‡‘‘‘áÍ›· MM wnßfxûîØ¸,0}\ºx‰ÁÆÚ †}ûöAqˆ––ÃÆ‚ƒƒÁi2êê d°µ±›…ì GGG¬Ž251f 5prrBá8Êö.ÈgçÏŸ‡&¾ÿ ÆÆÆp6 ÃÔ‘+†M< }þü™aÆ p‰ÐDMo@ð4ÄËË‹âˆW¯^ŠÅgÏžÅ0›Ø¹sç0Ä@¹ÃrÌ$ @("Èf@/›@€1|â0@,È®z°Pyýú5F9sÃlbØB [±²²bˆØA:ºº VVV(‰L@@€ÁÄÌXvü—5ÿ€r_¾|–?ºà„”5ÿÞ¾}Ë ªª) ÿB ÄgOŸ2HJJ‚Ëž¿P1Pù* ¸89Á|8 33†ƒˆ V‚ðÁC‡À>•7Œ ú ÉróÿÿCqÄ1ÿÀ%tZý…¶&Q@Aª`³Òšá°¤>|ø0CEE9¸rµ°°€vˆ¬jbb )úa%.PÌÀ@옿Ð, *AU ÌRXÓThhj€Ù ¹îäÉ“( X-ÿ*|Ð2äû÷ïßAçЪ¡–"Êœ+W.3üùý©Jø ° õHŠ ³ÿù, 4€‚W 9PtA4þæ:As`Wè/4*þBCÃØØ*õ9Ð1úÐúƒÚÚ:à*V8þª•ÖjjjŽ´¤>–#ž¨Ýp ì0‚ƒ’Nþ"*L´êf¤¤þ÷5<¤@õL,Í€£âp@`©Ëì ;wî0pqqÁ{ž îÍçÏ_nÞ¼®B`ÍP‚6 U ¨ùñˆ‘ÛÈ_¿~eøñã¤÷Ü çZP¹ÃÁÁ¨·˜0{av‰‰ ¸|ÈÊÊbvkÁ£¨¨(ƒ‡§'Šb£ÑËPºCU/èb ó°•C î32 ”‚Ø¥Å[RSÒb•Ôèe¶’ €à"  *¡ëëë´¤ &äø…Hccã@•Ô` B@‡\ôè‘0pûñà” J”sçÎEÑJü &9b°ñ(ÍÀ@`&r”F@1BLJtìh Ö…6 ÿÓ1Tî1¨‡z˜À¿, }â+Pú?ň„_z] *H €` ‚²'šCþÓ2½@éŸ@üÔ¨ #¶ÿ@€ð·ˆ—@à"IEND®B`‚model-builder-0.4.1.orig/model_builder/timemanagement_section.png0000644000175000017500000000526510536337617023361 0ustar godgod‰PNG  IHDR$$ᘘgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe< GIDATxÚbLKKc fÍš¥'''·K@@@üÝ»w¯žõ™ü`gà•dPPT`(˜lLÆâ zŠ ‚ ¦ÚÒ »¯ü`¨w}È ÌÏÎ`h` ºcÇ  qW€ø 9 &hbpvvI`zs€A[–•APŸÁÄ^šKDh±0Ç_ü  ‡hi1†¯Ùä$d”¥n]üðãòw†³Û bbb ¯¹wï^G ±Éq@1㜙™ùË/ž™Ñ_.c^@€S€ŸáÁ+ ýÜü K¶Ýa`bãexðâ×ßf¯¹È ­*ÁðàéWc#>VFvÖ ïÞ½a’·d8{ö¬ Ðq+€ÅÃ{PN¦I¢@ ’6 //½øßS VŠ:¶ñ1Wt2üýûáïŸß ¿ÿþÒü? þ€0ˆýHå~ÿ²ÿ0\=º”ÁWçÃî7n .\dxÿþÝ4› ù¯I©:ˆÅÊÊ*‡‡—A“õÃKßvì½Êð(ñó7ÃïŸ?~ñï_¿þüþtÈ¿ÀøõëÃ/ "AÓÖ5aธÁðçþ#qq1ƒ\€ÆÌ…æ´ßÄ: €X€¹Âìñ㇠A| ü`X½z-ÞýûílvíÞÇÐ ¬¿vlß̰wß[K†0TWU18°—áȱ“ ²R €¡äÆðŸ‘™ARˆ‘GT‰áðáê@ó€ø>¿'ÖAÄŒg `b`åcW•ÿýaðõfø÷Ÿ7ÃûwþÿÿÏàç㤼<Ý€åÕc°˜‹£=ƒ¸„ƒŠŠ àzPÈ 0½V-< ê†Zßñ“’¨ˆ‰ƒƒƒ‘QiÿFǾÀÑràð°ÃþÿÿÇpèè10}ìÄ)¨Ø†ÓçÎ1€ê8ñAðÕwdóÄ€˜› °~z,ƒDöŸ=Æ Oÿp7ß †~18»{1üûû›ALRŠÁÞÑìH[{'pÚe°´´§¯ß@ û0€ÿ1üüËÊð÷çw˜ù줶ˆ˜PrppŠœzÀÉP$ÄiË_ .F@! œô÷/Œ ÌiÀDüçï_¨8»¿!H™á§ÃÛ—/xxx~‘Ó^ –gÏžíùûï¿ñ«_ÊÀzÈnð—áëäF Q –3·Ÿ&ÃÛ»xn|µÔ€jþ1p{+2¼½õœãÖ;`)ó›áɯ¯ %]’ Wýg”’a¶@z­íÿ“â €bzÿþýÅo_?3ȨZ0ÌÜ÷áÿߟ`Kþþ‚пùýX3}c`Z ¦Ò öO°ºÿ@|ñÊ;†ÛíÁ!÷öí[vvöÐ&È/R@,{¡ÄÀÇÇÏðŠÕƒAƒ³ °™l¡²€00MzH‹RÓüÖ G»ðôhÝg†oo?0ToaPÐPbøúí8‘‚jû×@ü(Á}†Òƒ_¿)ˆŠŠ2l{êÀðqß^†p{`h³=Ç f`Údd&‰û󈿫 íÛø4Mݾ}ûÊðôÉ#PŽû'!!ñê /¤8 €@¶üö$Žb  òØ€g¸ñ-Œ¡lñ6† —/ JRÀ`†°Ð»T˪OŸ¾3,?ô‘á£3ƒ–™Ã÷ïßÁ­I`£ X |‚F°6døFŠƒä ¯^½ºüh¨üÙ ,,¢æ^ÉðóðecÙ/ L¿Ÿ3ˆñþe¸÷^áón†_•Ô´LÄ};æÇ` J?@ý  rˆþAŠƒVFœþðþ=£  ˜ËêBB ŸYº·ìd8ò89H)¨3ø¸é2hjê0|f†_Àú ÔÌ9B?~õJ^@ÛCŸIÍev³³ó¹§À„ÍËÇö-¬ÿúí5CßdpÝ(ÈË .ËÇpâÚM`ëò&Cpp0ƒŽ®.°`ü©h9æ0Q ÚG@M/IM? @°úþãû÷Ë@Z÷/0t@ѪÁ×mÜ ŒÂß ëZô¼u€‰œ›á÷«W ºñ»Ö®] ,­…8Ñ Qxñâ77÷7¨C^ã €‚5a~øðá#„ ª—þKä‡÷n3ôf*0ø›{aÀF d«Š5Õ…. LÀÄvïþ}¸c@)þ0„€â[hT½%5˃@ÁBè†ÿËW­Xá¬lEý-&¨5¹ÞÀI„GØyöÿýb`½Áàk%Ä Å~òÏæ-w¿0A `õpéç´¹ñ‰œ~@Á+>“ë@ª”¤ µ4#°'âÃÂ4ó'°dþrX 3Ì÷'à’ûýçßÀŠ”û‹›‹ËhiüZPBæ 9Ñ„\ƒ‚ù*s±(ÔpŸ#Çß3ØØÞ‚† Rûо/OÑ*ÀÎ@ Äû"LÐйå“ ÙA òâ.Ô‡ G1ð $5¯y£fyXà2;¢Œ@ûþýW°Ï>üaxú÷ƒ“Ø1»ø1Ô¿¡ÍÖïä8 €ôZº~… D†……©X``®ú‘€£'˜‚~ l~£D¨ñ²ð:l‹üg¨C¾0P !ê¢}@|ÇÐÍohšùH-#¨ÌL ÀQ&+Õ1í˜IEND®B`‚model-builder-0.4.1.orig/model_builder/uncertaintyMiniFrame.py0000644000175000017500000003670410536340506022634 0ustar godgod# -*- coding:iso8859-1 -*- #----------------------------------------------------------------------------- # Name: uncertaintyMiniFrame.py # Purpose: Panel to specify parameters for the uncertainty analysis # # Author: # # Created: 2003/02/04 # RCS-ID: $Id: uncertaintyMiniFrame.py,v 1.3 2004/01/13 10:51:43 fccoelho Exp $ # Copyright: (c) 2003 Flávio Codeço Coelho # Licence: This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #----------------------------------------------------------------------------- #Boa:MiniFrame:uncertaintyMiniFrame import wxversion wxversion.select('2.6') import wx import wx.gizmos from Numeric import * from string import * from Bayes import Melding as meld import os def create(parent): return uncertaintyMiniFrame(parent) [wxID_UNCERTAINTYMINIFRAME, wxID_UNCERTAINTYMINIFRAMEDONEBUTTON, wxID_UNCERTAINTYMINIFRAMELIKLIST, wxID_UNCERTAINTYMINIFRAMEPRIORLIST, wxID_UNCERTAINTYMINIFRAMESELALL, wxID_UNCERTAINTYMINIFRAMESPINCTRL1, wxID_UNCERTAINTYMINIFRAMESTATICTEXT1, wxID_UNCERTAINTYMINIFRAMESTATICTEXT2, wxID_UNCERTAINTYMINIFRAMESTATICTEXT3, wxID_UNCERTAINTYMINIFRAMESTATICTEXT4, wxID_UNCERTAINTYMINIFRAMESTATICTEXT5, wxID_UNCERTAINTYMINIFRAMESTATUSPANEL, wxID_UNCERTAINTYMINIFRAMEVARLIST, ] = [wx.NewId() for _init_ctrls in range(13)] class uncertaintyMiniFrame(wx.MiniFrame): def _init_ctrls(self, prnt): # generated method, don't edit wx.MiniFrame.__init__(self, id=wxID_UNCERTAINTYMINIFRAME, name='uncertaintyMiniFrame', parent=prnt, pos=wx.Point(181, 159), size=wx.Size(683, 445), style=wx.DEFAULT_FRAME_STYLE, title='Bayesian Melding Uncertainty Analysis') self.SetClientSize(wx.Size(683, 445)) self.SetAutoLayout(True) self.SetToolTipString('Melding parameters') self.Bind(wx.EVT_CLOSE, self.OnUncertaintyMiniFrameClose) self.staticText1 = wx.StaticText(id=wxID_UNCERTAINTYMINIFRAMESTATICTEXT1, label='Choose state variable(s) to be analyzed:', name='staticText1', parent=self, pos=wx.Point(24, 16), size=wx.Size(226, 16), style=0) self.staticText2 = wx.StaticText(id=wxID_UNCERTAINTYMINIFRAMESTATICTEXT2, label='Variables:', name='staticText2', parent=self, pos=wx.Point(24, 40), size=wx.Size(56, 16), style=0) self.varList = wx.CheckListBox(choices=['Y[0]', 'Y[1]'], id=wxID_UNCERTAINTYMINIFRAMEVARLIST, name='varList', parent=self, pos=wx.Point(24, 56), size=wx.Size(104, 40), style=wx.VSCROLL, validator=wx.DefaultValidator) self.varList.SetToolTipString('The checked variables will be retained in memory for analysis.') self.varList.SetThemeEnabled(True) self.varList.Bind(wx.EVT_CHECKLISTBOX, self.OnVarListChecklistbox, id=wxID_UNCERTAINTYMINIFRAMEVARLIST) self.varList.Bind(wx.EVT_LISTBOX, self.OnVarListListbox, id=wxID_UNCERTAINTYMINIFRAMEVARLIST) self.staticText4 = wx.StaticText(id=wxID_UNCERTAINTYMINIFRAMESTATICTEXT4, label='Number of runs (k):', name='staticText4', parent=self, pos=wx.Point(300, 16), size=wx.Size(106, 16), style=0) self.spinCtrl1 = wx.SpinCtrl(id=wxID_UNCERTAINTYMINIFRAMESPINCTRL1, initial=5, max=100000, min=2, name='spinCtrl1', parent=self, pos=wx.Point(416, 16), size=wx.Size(95, 22), style=wx.SP_ARROW_KEYS) self.spinCtrl1.SetToolTipString('Number of times model should be run.') self.spinCtrl1.SetRange(2, 100000) self.spinCtrl1.SetThemeEnabled(True) self.Donebutton = wx.Button(id=wxID_UNCERTAINTYMINIFRAMEDONEBUTTON, label='Done', name='Donebutton', parent=self, pos=wx.Point(576, 400), size=wx.Size(80, 32), style=0) self.Donebutton.SetToolTipString('Hit here when done') self.Donebutton.SetThemeEnabled(True) self.Donebutton.Bind(wx.EVT_BUTTON, self.OnDonebuttonButton, id=wxID_UNCERTAINTYMINIFRAMEDONEBUTTON) self.priorList = wx.TextCtrl(id=wxID_UNCERTAINTYMINIFRAMEPRIORLIST, name='priorList', parent=self, pos=wx.Point(176, 56), size=wx.Size(224, 144), style=wx.VSCROLL | wx.TE_MULTILINE, value='uniform (0,2)') self.likList = wx.TextCtrl(id=wxID_UNCERTAINTYMINIFRAMELIKLIST, name='likList', parent=self, pos=wx.Point(176, 242), size=wx.Size(224, 144), style=wx.VSCROLL | wx.TE_MULTILINE, value='normal (1,1)') self.likList.SetToolTipString('List of likelihood functions for each state variable') self.staticText3 = wx.StaticText(id=wxID_UNCERTAINTYMINIFRAMESTATICTEXT3, label='Prior distributions:', name='staticText3', parent=self, pos=wx.Point(184, 40), size=wx.Size(99, 16), style=0) self.staticText5 = wx.StaticText(id=wxID_UNCERTAINTYMINIFRAMESTATICTEXT5, label='Likelihood functions:', name='staticText5', parent=self, pos=wx.Point(184, 224), size=wx.Size(114, 16), style=0) self.statusPanel = wx.TextCtrl(id=wxID_UNCERTAINTYMINIFRAMESTATUSPANEL, name='Statuspanel', parent=self, pos=wx.Point(424, 56), size=wx.Size(216, 328), style=wx.HSCROLL | wx.VSCROLL | wx.TE_MULTILINE, value='Status Report:') self.selAll = wx.Button(id=wxID_UNCERTAINTYMINIFRAMESELALL, label='Select All', name='selAll', parent=self, pos=wx.Point(24, 112), size=wx.Size(88, 32), style=0) self.selAll.SetThemeEnabled(True) self.selAll.SetToolTipString('Press this button to select all variables in the above list.') self.selAll.Bind(wx.EVT_BUTTON, self.OnSelAllButton, id=wxID_UNCERTAINTYMINIFRAMESELALL) def __init__(self, parent): self._init_ctrls(parent) self.uncertainPars = None self.dataloaded = 0 def createVarList(self, items): """ Re-creates varList checkListBox from items received from the main frame """ self.varList = wx.CheckListBox(choices=items, id=wxID_UNCERTAINTYMINIFRAMEVARLIST, name='varList', parent=self, pos= wx.Point(24, 56), size= wx.Size(142, 54), style=0, validator=wx.DefaultValidator) self.varList.SetToolTipString('the checked variables will have to be assigned prior distribution on the right, and likelihoods if available.\n'+'Total items: '+str(self.varList.GetCount())) def updatePriorList(self, n): """ Updates the box of prior distributions with a list of uniform priors based on the number of state variables elected. """ value = 'uniform(0,10)\n'*(n-1) value = value+'uniform(0,10)' self.priorList.SetValue(value) def saveSpecs(self): """ Saves the specs of the last analysis ran. """ fname = os.path.split(self.fileName)[1] fname = fname[:-4]+'_unc.spec' checkedvars = [self.varList.IsChecked(i) for i in range(self.varList.GetCount())] pr = self.priorList.GetValue() lk = self.likList.GetValue() nr = self.spinCtrl1.GetValue() uncSpecs = {'vars':checkedvars, 'priors':pr, 'liks':lk,'nruns':nr} f = open(fname,'w') pickle.dump(uncSpecs,f) f.close() def loadSpecs(self, fname): """ Load specs from last uncertainty analysis ran from file fname. """ f = open(fname,'r') uncSpecs = pickle.load(f) f.close() for i in range(len(uncSpecs['vars'])): if uncSpecs['vars'][i] == 1: self.varList.Check(i) self.priorList.SetValue(uncSpecs['priors']) self.likList.SetValue(uncSpecs['liks']) self.spinCtrl1.SetValue(uncSpecs['nruns']) def OnDonebuttonButton(self, event): """ When clicked this button checks the information about the Bayesian melding analysis, saves it and open a dialog box for specification of a data file (containing the data to calculate the likelihoods). returns a dictionary (uncertainPars) with the data entered. """ self.saveSpecs() # TODO: Introduce more checks to avoid stupid errors!!! #---check if the number of checked variables is the same as the number of priors available--------------------------------------------------------------- self.statusPanel.AppendText('\nChecking selected variables...\n') nvars = self.varList.GetCount() # Get the totalnumber of variables in varlist sel = [self.varList.IsChecked(i) for i in range(nvars)] # returns a list with ones for selected variables and zeros for not selected. if 1 not in sel: # if no variable has been selected, warn the user dlg = wx.MessageDialog(self, 'Select at least one variable from the list.', 'Caption', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() self.statusPanel.AppendText('Done!\n\n') #---Check if the number of priors entered corresponds to the number of variable selected---------------------------------------------------------------------------- self.statusPanel.AppendText('Checking number of prior distributions...\n') npriors = int(self.priorList.GetNumberOfLines()) # Number of priors available while strip(self.priorList.GetLineText(npriors-1)) == '': # avoid getting empty lines at the end of the eq. box npriors = npriors-1 if npriors == 1: break s = sum(array(sel)) if s != npriors: dlg = wx.MessageDialog(self, 'The number of priors specified must be the same as the number of variables selected.', 'Mismatched number of variables and priors', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() self.statusPanel.AppendText('Done!\n\n') self.statusPanel.AppendText('Checking Number of likelihoods...\n') nlhoods = int(self.likList.GetNumberOfLines()) # Number of Likelihoods available while strip(self.likList.GetLineText(nlhoods-1)) == '': # avoid getting empty lines at the end of the eq. box nlhoods = nlhoods-1 if nlhoods <= 1: break self.statusPanel.AppendText('Done!\n\n') if not self.likList.GetLineText(0) =='': #read datafile self.statusPanel.AppendText('Reading data from file...\n') dlg = wx.FileDialog(self, "Open data file", ".", "", "*.txt", wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() f = open(filename) data = f.readlines() f.close() self.dataloaded = 1 self.statusPanel.AppendText('Done!\n\n') finally: dlg.Destroy() if len(data) != nlhoods: #check data size dlg = wx.MessageDialog(self, 'Number of datasets (lines) on the chosen file do not correspond to the number of likelihoods specified. Please open the correct file.', 'Wrong data file size!', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() else: datafloat=[None] for i in range(len(data)): try: data[i] = data[i][0:data[i].find("\\")] #remove newline characters finally: data[i] = data[i].split(' ') # Split strings into lists datafloat[i] = [float(j) for j in data[i]] #Turns the list elements into floats data = datafloat #---initializing lists and dictionaries to receive form data---------------------------------------------------------------------------- priors = [] lhoods = [] dist = [] params = [] distl = [] paramsl = [] k = self.spinCtrl1.GetValue() #number of runs for i in range(npriors): st = strip(self.priorList.GetLineText(i)) #get prior defining strings dist.append(strip(st[:find(st,'(')])) #parse distribution name params.append(eval(st[find(st,'('):])) # parse parameters string and eval it to a tuple priors = (dist,params) #name of the dist and parameters print dist[i] #---generating priors---------------------------------------------------------------------------- self.statusPanel.AppendText('generating priors...\n') priords = [meld.genprior(dist[i],params[i],k) for i in range(npriors)] #list of arrays self.statusPanel.AppendText('done!\n\n') #------------------------------------------------------------------------------- #---check if there are likelihoods available---------------------------------------------------------------------------- if not self.likList.GetLineText(0) == '': for j in range(nlhoods): stl = strip(self.likList.GetLineText(j))#get likelihood defining strings distl.append(strip(stl[:find(stl,'(')]))#parse distribution name paramsl.append(eval(stl[find(stl,'('):]))# parse parameters string and eval it to a tuple lhoods = (distl,paramsl) #name of the dist and parameters #---calculating likelihoods---------------------------------------------------------------------------- self.statuspanel.AppendText('calculating likelihoods...\n') lik = [] for l in range (nlhoods): dat = data[l] lik.append(meld.Likeli(dat, distl[l],paramsl[l])) #calculates likelihoods f else: lik=[] self.statusPanel.AppendText('done!\n\n') self.uncertainPars = (priors, priords, lhoods, lik) self.statusPanel.AppendText('press the start button on the main panel.\n') self.Donebutton.Disable() def OnSelAllButton(self, event): """ When this button is clicked, it checks all items on the list. """ n = self.varList.GetCount() for i in range(n): self.varList.Check(i) sel = sum(array([self.varList.IsChecked(i) for i in range(n)])) self.updatePriorList(sel) def OnVarListChecklistbox(self, event): """ Every time an item is checked in the variable list box, it calls for an update of prior list box. """ n = self.varList.GetCount() sel = sum(array([self.varList.IsChecked(i) for i in range(n)])) self.updatePriorList(sel) def OnUncertaintyMiniFrameClose(self, event): event.Skip() def OnVarListListbox(self, event): event.Skip() model-builder-0.4.1.orig/model_builder/wxFrame1.py0000644000175000017500000017162410745433032020171 0ustar godgod# -*- coding:latin-1 -*- #----------------------------------------------------------------------------- # Name: wxFrame1.py # Purpose: # # Author: # # Created: 2003/02/04 # RCS-ID: $Id: wxFrame1.py,v 1.11 2004/01/13 10:51:43 fccoelho Exp $ # Copyright: (c) 2003 Flavio Codeco Coelho # Licence: This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #----------------------------------------------------------------------------- #Boa:Frame:wxFrame1 from __future__ import division import wxversion wxversion.select('2.6') import wx import wx.stc #from Numeric import * from threading import * from scipy import integrate #from RandomArray import * from numpy.random import * import pickle #from MLab import * import matplotlib matplotlib.use('WXAgg') from pylab import * from matplotlib.cbook import * from wxPython.tools import helpviewer #from xml.dom import Node import os,sys import wxFrame2, about from odexml import Model import PlotFigure as PF from Bayes import Melding as meld from time import * import icones import quivVarFrame as QF from lhsframe import LHS os.chdir(os.getcwd()) def create(parent): return wxFrame1(parent) [wxID_WXFRAME1, wxID_WXFRAME1CONVCHECKBOX, wxID_WXFRAME1CRITTIMETEXT, wxID_WXFRAME1ENDTEXT, wxID_WXFRAME1EQNEDIT, wxID_WXFRAME1EQTEXT, wxID_WXFRAME1FIRSTSTEPTEXT, wxID_WXFRAME1FOCHECKBOX, wxID_WXFRAME1GAUGE1, wxID_WXFRAME1INITVALINPUT, wxID_WXFRAME1INITVALTEXT, wxID_WXFRAME1MAXSTEPTEXT, wxID_WXFRAME1MINSTEPTEXT, wxID_WXFRAME1PANEL1, wxID_WXFRAME1PARAMTEXT, wxID_WXFRAME1PAREDIT, wxID_WXFRAME1PROGRESSTEXT, wxID_WXFRAME1SEPARALINE, wxID_WXFRAME1STARTTEXT, wxID_WXFRAME1STATUSBAR1, wxID_WXFRAME1TEXTCTRL2, wxID_WXFRAME1TEXTCTRL3, wxID_WXFRAME1TEXTCTRL4, wxID_WXFRAME1TEXTCTRL5, wxID_WXFRAME1TEXTCTRL6, wxID_WXFRAME1TEXTCTRL7, wxID_WXFRAME1TEXTCTRL8, wxID_WXFRAME1TIMESTEPTEXT, wxID_WXFRAME1TOOLBAR1, ] = [wx.NewId() for _init_ctrls in xrange(29)] [wxID_WXFRAME1MENU1ITEMS0, wxID_WXFRAME1MENU1ITEMS1, wxID_WXFRAME1MENU1ITEMS2, wxID_WXFRAME1MENU1ITEMS3, wxID_WXFRAME1MENU1ITEMS4, ] = [wx.NewId() for _init_coll_menu1_Items in xrange(5)] [wxID_WXFRAME1TOOLBAR1TOOLS0, wxID_WXFRAME1TOOLBAR1TOOLS1, wxID_WXFRAME1TOOLBAR1TOOLS2, ] = [wx.NewId() for _init_coll_toolBar1_Tools in xrange(3)] [wxID_WXFRAME1MENU2ITEMS0, wxID_WXFRAME1MENU2QUIVERPL, ] = [wx.NewId() for _init_coll_menu2_Items in xrange(2)] [wxID_WXFRAME1MENU3ITEMS0] = [wx.NewId() for _init_coll_menu3_Items in xrange(1)] [wxID_WXFRAME1TOOLBAR1OPENTOOL, wxID_WXFRAME1TOOLBAR1SAVETOOL, wxID_WXFRAME1TOOLBAR1TOOLS0, wxID_WXFRAME1TOOLBAR1TOOLS1, wxID_WXFRAME1TOOLBAR1TOOLS2, ] = [wx.NewId() for _init_coll_toolBar1_Tools in range(5)] [wxID_WXFRAME1, wxID_WXFRAME1CONVCHECKBOX, wxID_WXFRAME1CRITTIMETEXT, wxID_WXFRAME1ENDTEXT, wxID_WXFRAME1EQNEDIT, wxID_WXFRAME1EQTEXT, wxID_WXFRAME1FIRSTSTEPTEXT, wxID_WXFRAME1FOCHECKBOX, wxID_WXFRAME1GAUGE1, wxID_WXFRAME1INITVALINPUT, wxID_WXFRAME1INITVALTEXT, wxID_WXFRAME1MAXSTEPTEXT, wxID_WXFRAME1MINSTEPTEXT, wxID_WXFRAME1PANEL1, wxID_WXFRAME1PARAMTEXT, wxID_WXFRAME1PAREDIT, wxID_WXFRAME1PROGRESSTEXT, wxID_WXFRAME1SEPARALINE, wxID_WXFRAME1STARTTEXT, wxID_WXFRAME1STATUSBAR1, wxID_WXFRAME1TEXTCTRL2, wxID_WXFRAME1TEXTCTRL3, wxID_WXFRAME1TEXTCTRL4, wxID_WXFRAME1TEXTCTRL5, wxID_WXFRAME1TEXTCTRL6, wxID_WXFRAME1TEXTCTRL7, wxID_WXFRAME1TEXTCTRL8, wxID_WXFRAME1TIMESTEPTEXT, wxID_WXFRAME1TOOLBAR1, ] = [wx.NewId() for _init_ctrls in range(29)] [wxID_WXFRAME1MENU2ITEMS0, wxID_WXFRAME1MENU2QUIVERPL, ] = [wx.NewId() for _init_coll_menu2_Items in range(2)] [wxID_WXFRAME1MENU1ITEMS0, wxID_WXFRAME1MENU1ITEMS1, wxID_WXFRAME1MENU1ITEMS2, wxID_WXFRAME1MENU1ITEMS3, wxID_WXFRAME1MENU1ITEMS4, ] = [wx.NewId() for _init_coll_menu1_Items in range(5)] [wxID_WXFRAME1MENU3ITEMS0, wxID_WXFRAME1MENU3MBHELP, ] = [wx.NewId() for _init_coll_menu3_Items in range(2)] class wxFrame1(wx.Frame): def _init_coll_boxSizerH_Items(self, parent): # generated method, don't edit parent.AddSizer(self.gridBagSizer1, 0, border=0, flag=wx.EXPAND) parent.AddWindow(self.separaLine, 0, border=0, flag=0) parent.AddSizer(self.boxSizerV2, 0, border=0, flag=wx.EXPAND) def _init_coll_bsPanel_Items(self, parent): # generated method, don't edit parent.AddWindow(self.panel1, 1, border=0, flag=wx.EXPAND) def _init_coll_gridBagSizer1_Items(self, parent): # generated method, don't edit parent.AddWindow(self.eqText, (0, 0), border=0, flag=0, span=(1,3)) parent.AddWindow(self.eqnEdit, (1, 0), border=0, flag=wx.EXPAND, span=(1, 3)) parent.AddWindow(self.initValText, (2, 0), border=0, flag=0, span=(1,3)) parent.AddWindow(self.initValInput, (3, 0), border=0, flag=0, span=(1, 3)) parent.AddWindow(self.startText, (4, 0), border=0, flag=0, span=(1,1)) parent.AddWindow(self.endText, (4, 1), border=0, flag=0, span=(1,1)) parent.AddWindow(self.timeStepText, (4, 2), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.textCtrl2, (5, 0), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.textCtrl3, (5, 1), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.textCtrl4, (5, 2), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.critTimeText, (6, 0), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.firstStepText, (6, 2), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.textCtrl5, (7, 0), border=0, flag=0, span=(1, 2)) parent.AddWindow(self.textCtrl6, (7, 2), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.minStepText, (8, 0), border=0, flag=0, span=(1,1)) parent.AddWindow(self.maxStepText, (8, 1), border=0, flag=0, span=(1,1)) parent.AddWindow(self.progressText, (8, 2), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.textCtrl7, (9, 0), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.textCtrl8, (9, 1), border=0, flag=0, span=(1, 1)) parent.AddWindow(self.gauge1, (9, 2), border=0, flag=0, span=(1, 1)) def _init_coll_boxSizerV2_Items(self, parent): # generated method, don't edit parent.AddWindow(self.paramText, 1, border=0, flag=wx.EXPAND) parent.AddWindow(self.parEdit, 7, border=0, flag=wx.EXPAND) parent.AddWindow(self.focheckBox, 1, border=0, flag=wx.EXPAND) parent.AddWindow(self.convcheckBox, 1, border=0, flag=wx.EXPAND) def _init_coll_menuBar1_Menus(self, parent): # generated method, don't edit parent.Append(menu=self.menu1, title='File') parent.Append(menu=self.menu2, title='Analysis') parent.Append(menu=self.menu3, title='Help') def _init_coll_menu3_Items(self, parent): # generated method, don't edit parent.Append(help='Open the main help file', id=wxID_WXFRAME1MENU3MBHELP, kind=wx.ITEM_NORMAL, text='Model Builder Help') parent.AppendSeparator() parent.Append(help='General Information about PyMM', id=wxID_WXFRAME1MENU3ITEMS0, kind=wx.ITEM_NORMAL, text='About') self.Bind(wx.EVT_MENU, self.OnMenu3items0Menu, id=wxID_WXFRAME1MENU3ITEMS0) self.Bind(wx.EVT_MENU, self.OnMenu3MbhelpMenu, id=wxID_WXFRAME1MENU3MBHELP) def _init_coll_menu1_Items(self, parent): # generated method, don't edit parent.Append(help='Open a saved model.', id=wxID_WXFRAME1MENU1ITEMS0, kind=wx.ITEM_NORMAL, text='Open') parent.Append(help='Save your model.', id=wxID_WXFRAME1MENU1ITEMS1, kind=wx.ITEM_NORMAL, text='Save') parent.Append(help='Save your model on another file.', id=wxID_WXFRAME1MENU1ITEMS2, kind=wx.ITEM_NORMAL, text='Save As') parent.Append(help='Close your model.', id=wxID_WXFRAME1MENU1ITEMS3, kind=wx.ITEM_NORMAL, text='Close') parent.Append(help='Exit PyMM.', id=wxID_WXFRAME1MENU1ITEMS4, kind=wx.ITEM_NORMAL, text='Exit') self.Bind(wx.EVT_MENU, self.OnMenu1items0Menu, id=wxID_WXFRAME1MENU1ITEMS0) self.Bind(wx.EVT_MENU, self.OnMenu1items1Menu, id=wxID_WXFRAME1MENU1ITEMS1) self.Bind(wx.EVT_MENU, self.OnMenu1items2Menu, id=wxID_WXFRAME1MENU1ITEMS2) self.Bind(wx.EVT_MENU, self.OnMenu1items3Menu, id=wxID_WXFRAME1MENU1ITEMS3) self.Bind(wx.EVT_MENU, self.OnMenu1items4Menu, id=wxID_WXFRAME1MENU1ITEMS4) def _init_coll_menu2_Items(self, parent): # generated method, don't edit parent.Append(help='Enter uncertainty analysis mode', id=wxID_WXFRAME1MENU2ITEMS0, kind=wx.ITEM_CHECK, text='Uncertainty analysis') parent.Append(help='Generates a State Space quiver plot.', id=wxID_WXFRAME1MENU2QUIVERPL, kind=wx.ITEM_NORMAL, text='State Diagram...') self.Bind(wx.EVT_MENU, self.OnMenu2items0Menu, id=wxID_WXFRAME1MENU2ITEMS0) self.Bind(wx.EVT_MENU, self.OnMenu2Items1Menu, id=wxID_WXFRAME1MENU2QUIVERPL) def _init_coll_toolBar1_Tools(self, parent): # generated method, don't edit parent.DoAddTool(bitmap=icones.getOpenBitmap(), bmpDisabled=wx.NullBitmap, id=wxID_WXFRAME1TOOLBAR1OPENTOOL, kind=wx.ITEM_NORMAL, label='Open', longHelp='Click Here to open a new model.', shortHelp='Open Model') parent.DoAddTool(bitmap=icones.getSaveBitmap(), bmpDisabled=wx.NullBitmap, id=wxID_WXFRAME1TOOLBAR1SAVETOOL, kind=wx.ITEM_NORMAL, label='Save', longHelp='Click here to save.', shortHelp='Save Model') parent.AddSeparator() parent.AddTool(bitmap=icones.getrunBitmap(), id=wxID_WXFRAME1TOOLBAR1TOOLS0, isToggle=False, longHelpString='Start your simulation.', pushedBitmap=wx.NullBitmap, shortHelpString='Start') parent.AddTool(bitmap=icones.getequationsBitmap(), id=wxID_WXFRAME1TOOLBAR1TOOLS1, isToggle=False, longHelpString='Show typeset Equations', pushedBitmap=wx.NullBitmap, shortHelpString='Show equations') parent.AddTool(bitmap=icones.getspreadsheetBitmap(), id=wxID_WXFRAME1TOOLBAR1TOOLS2, isToggle=False, longHelpString='Show table with results', pushedBitmap=wx.NullBitmap, shortHelpString='Results') self.Bind(wx.EVT_TOOL, self.OnToolbar1tools0Tool, id=wxID_WXFRAME1TOOLBAR1TOOLS0) self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolbar1tools0ToolRclicked, id=wxID_WXFRAME1TOOLBAR1TOOLS0) self.Bind(wx.EVT_TOOL, self.OnToolbar1tools1Tool, id=wxID_WXFRAME1TOOLBAR1TOOLS1) self.Bind(wx.EVT_TOOL, self.OnToolbar1tools2Tool, id=wxID_WXFRAME1TOOLBAR1TOOLS2) self.Bind(wx.EVT_TOOL, self.OnToolBar1OpentoolTool, id=wxID_WXFRAME1TOOLBAR1OPENTOOL) self.Bind(wx.EVT_TOOL, self.OnToolBar1SavetoolTool, id=wxID_WXFRAME1TOOLBAR1SAVETOOL) parent.Realize() def _init_coll_statusBar1_Fields(self, parent): # generated method, don't edit parent.SetFieldsCount(1) parent.SetStatusText(number=0, text='Status') parent.SetStatusWidths([-1]) def _init_sizers(self): # generated method, don't edit self.gridBagSizer1 = wx.GridBagSizer(hgap=3, vgap=2) self.gridBagSizer1.SetCols(2) self.gridBagSizer1.SetRows(10) self.gridBagSizer1.SetFlexibleDirection(12) self.gridBagSizer1.SetNonFlexibleGrowMode(1) self.bsPanel = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizerH = wx.BoxSizer(orient=wx.HORIZONTAL) self.boxSizerV2 = wx.BoxSizer(orient=wx.VERTICAL) self._init_coll_gridBagSizer1_Items(self.gridBagSizer1) self._init_coll_bsPanel_Items(self.bsPanel) self._init_coll_boxSizerH_Items(self.boxSizerH) self._init_coll_boxSizerV2_Items(self.boxSizerV2) self.SetSizer(self.bsPanel) def _init_utils(self): # generated method, don't edit self.menu1 = wx.Menu(title='File') self.menu3 = wx.Menu(title='Help') self.menuBar1 = wx.MenuBar() self.menu2 = wx.Menu(title='Analysis') self._init_coll_menu1_Items(self.menu1) self._init_coll_menu3_Items(self.menu3) self._init_coll_menuBar1_Menus(self.menuBar1) self._init_coll_menu2_Items(self.menu2) def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_WXFRAME1, name='', parent=prnt, pos=wx.Point(362, 472), size=wx.Size(730, 480), style=wx.DEFAULT_FRAME_STYLE, title='Model Builder - ODE') self._init_utils() self.SetClientSize(wx.Size(730, 480)) self.SetMenuBar(self.menuBar1) self.SetToolTipString('Model Builder') self.SetAutoLayout(True) self.SetBestFittingSize(wx.Size(730, 480)) self.SetMaxSize(wx.Size(730, 480)) self.SetIcon(wx.Icon('MB.ico',wx.BITMAP_TYPE_ICO)) self.Bind(wx.EVT_CLOSE, self.OnWxFrame1Close) self.statusBar1 = wx.StatusBar(id=wxID_WXFRAME1STATUSBAR1, name='statusBar1', parent=self, style=0) self.statusBar1.SetSize(wx.Size(80, 19)) self.statusBar1.SetPosition(wx.Point(-1, -1)) self._init_coll_statusBar1_Fields(self.statusBar1) self.SetStatusBar(self.statusBar1) self.toolBar1 = wx.ToolBar(id=wxID_WXFRAME1TOOLBAR1, name='toolBar1', parent=self, pos=wx.Point(0, 31), size=wx.Size(248, 50), style=wx.TRANSPARENT_WINDOW | wx.TB_HORIZONTAL | wx.NO_BORDER) self.toolBar1.SetToolTipString('') self.toolBar1.SetThemeEnabled(True) self.SetToolBar(self.toolBar1) self.panel1 = wx.Panel(id=wxID_WXFRAME1PANEL1, name='panel1', parent=self, pos=wx.Point(0, 0), size=wx.Size(730, 449), style=wx.TAB_TRAVERSAL) self.initValInput = wx.TextCtrl(id=wxID_WXFRAME1INITVALINPUT, name='initValInput', parent=self.panel1, pos=wx.Point(0, 208), size=wx.Size(465, 22), style=0, value='') self.initValInput.SetToolTipString('Initial conditions: values separated by spaces.') self.initValInput.SetBestFittingSize(wx.Size(465, 22)) self.startText = wx.StaticText(id=wxID_WXFRAME1STARTTEXT, label='Start time:', name='startText', parent=self.panel1, pos=wx.Point(0, 232), size=wx.Size(153, 20), style=0) self.textCtrl2 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL2, name='textCtrl2', parent=self.panel1, pos=wx.Point(0, 254), size=wx.Size(153, 22), style=0, value='0') self.textCtrl2.SetToolTipString('Time value at the start of simulation') self.endText = wx.StaticText(id=wxID_WXFRAME1ENDTEXT, label='End Time:', name='endText', parent=self.panel1, pos=wx.Point(160, 232), size=wx.Size(153, 20), style=0) self.endText.SetToolTipString('Time value to end simulation') self.textCtrl3 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL3, name='textCtrl3', parent=self.panel1, pos=wx.Point(160, 254), size=wx.Size(153, 22), style=0, value='10') self.textCtrl3.SetToolTipString('Time value to end simulation') self.timeStepText = wx.StaticText(id=wxID_WXFRAME1TIMESTEPTEXT, label='Time Step:', name='timeStepText', parent=self.panel1, pos=wx.Point(320, 232), size=wx.Size(153, 20), style=0) self.textCtrl4 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL4, name='textCtrl4', parent=self.panel1, pos=wx.Point(320, 254), size=wx.Size(153, 22), style=0, value='0.1') self.textCtrl4.SetToolTipString('Time step for the output') self.critTimeText = wx.StaticText(id=wxID_WXFRAME1CRITTIMETEXT, label='Critical Time Steps:', name='critTimeText', parent=self.panel1, pos=wx.Point(0, 278), size=wx.Size(153, 20), style=0) self.textCtrl5 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL5, name='textCtrl5', parent=self.panel1, pos=wx.Point(0, 300), size=wx.Size(309, 22), style=0, value='') self.textCtrl5.SetToolTipString('Time points where integration care should be taken.') self.firstStepText = wx.StaticText(id=wxID_WXFRAME1FIRSTSTEPTEXT, label='First Step:', name='firstStepText', parent=self.panel1, pos=wx.Point(320, 278), size=wx.Size(153, 20), style=0) self.textCtrl6 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL6, name='textCtrl6', parent=self.panel1, pos=wx.Point(320, 300), size=wx.Size(153, 22), style=0, value='0') self.textCtrl6.SetToolTipString('Size of the first step (0=auto)') self.textCtrl7 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL7, name='textCtrl7', parent=self.panel1, pos=wx.Point(0, 348), size=wx.Size(153, 22), style=0, value='0') self.textCtrl7.SetToolTipString('Minimum absolute step size allowed (0=auto).') self.maxStepText = wx.StaticText(id=wxID_WXFRAME1MAXSTEPTEXT, label='Max Step Size:', name='maxStepText', parent=self.panel1, pos=wx.Point(160, 324), size=wx.Size(153, 22), style=0) self.textCtrl8 = wx.TextCtrl(id=wxID_WXFRAME1TEXTCTRL8, name='textCtrl8', parent=self.panel1, pos=wx.Point(160, 348), size=wx.Size(153, 22), style=0, value='0') self.textCtrl8.SetToolTipString('Maximum absolute step size allowed (0=auto)') self.separaLine = wx.StaticLine(id=wxID_WXFRAME1SEPARALINE, name='separaLine', parent=self.panel1, pos=wx.Point(477, 0), size=wx.Size(30, 780), style=wx.MAXIMIZE_BOX | wx.LI_VERTICAL | wx.THICK_FRAME | wx.LI_VERTICAL| 1) self.separaLine.SetBackgroundColour(wx.Colour(0, 0, 0)) self.separaLine.SetToolTipString('') self.separaLine.SetThemeEnabled(True) self.separaLine.SetAutoLayout(True) self.separaLine.SetExtraStyle(0) self.focheckBox = wx.CheckBox(id=wxID_WXFRAME1FOCHECKBOX, label='Full Output', name='focheckBox', parent=self.panel1, pos=wx.Point(507, 174), size=wx.Size(208, 22), style=0) self.focheckBox.SetValue(True) self.focheckBox.SetToolTipString('Check if you want the full output.') self.paramText = wx.StaticText(id=wxID_WXFRAME1PARAMTEXT, label='Parameters:', name='paramText', parent=self.panel1, pos=wx.Point(507, 0), size=wx.Size(88, 16), style=0) self.parEdit = wx.TextCtrl(id=wxID_WXFRAME1PAREDIT, name='parEdit', parent=self.panel1, pos=wx.Point(507, 16), size=wx.Size(208, 158), style=wx.HSCROLL | wx.TE_PROCESS_TAB | wx.VSCROLL | wx.TE_MULTILINE, value='') self.parEdit.SetToolTipString('Enter parameter values or expressions, one per line. Parameter should be refered to as p[0], p[1],... in the DEs.') self.parEdit.SetHelpText('Each line corresponds to one Parameter (p[0], p[1], ...)') self.gauge1 = wx.Gauge(id=wxID_WXFRAME1GAUGE1, name='gauge1', parent=self.panel1, pos=wx.Point(320, 348), range=100, size=wx.Size(153, 22), style=wx.GA_HORIZONTAL, validator=wx.DefaultValidator) self.gauge1.SetLabel('Percent Done') self.gauge1.SetValue(0) self.gauge1.SetToolTipString('Percent Done') self.gauge1.SetHelpText('Show the percentage of the simulation done.') self.gauge1.SetShadowWidth(10) self.gauge1.SetBezelFace(1) self.eqnEdit = wx.TextCtrl(id=wxID_WXFRAME1EQNEDIT, name='eqnEdit', parent=self.panel1, pos=wx.Point(0, 24), size=wx.Size(477, 158), style=wx.HSCROLL | wx.TE_PROCESS_TAB | wx.TE_MULTILINE, value='') self.eqnEdit.SetToolTipString('ODE box. Enter one equation per line. Right hand side only.') self.eqText = wx.StaticText(id=wxID_WXFRAME1EQTEXT, label='Differential Equations:', name='eqText', parent=self.panel1, pos=wx.Point(0, 0), size=wx.Size(465, 22), style=0) self.eqText.SetThemeEnabled(True) self.eqText.SetBestFittingSize(wx.Size(465, 22)) self.initValText = wx.StaticText(id=wxID_WXFRAME1INITVALTEXT, label='Initial values:', name='initValText', parent=self.panel1, pos=wx.Point(0, 184), size=wx.Size(465, 22), style=0) self.initValText.SetBestFittingSize(wx.Size(465, 22)) self.minStepText = wx.StaticText(id=wxID_WXFRAME1MINSTEPTEXT, label='Min. Step Size:', name='minStepText', parent=self.panel1, pos=wx.Point(0, 324), size=wx.Size(153, 22), style=0) self.progressText = wx.StaticText(id=wxID_WXFRAME1PROGRESSTEXT, label='Progress:', name='progressText', parent=self.panel1, pos=wx.Point(320, 324), size=wx.Size(153, 22), style=0) self.convcheckBox = wx.CheckBox(id=wxID_WXFRAME1CONVCHECKBOX, label='Show Convergence Message', name='convcheckBox', parent=self.panel1, pos=wx.Point(507, 323), size=wx.Size(208, 22), style=0) self.convcheckBox.SetValue(False) self.convcheckBox.SetToolTipString('Check if you want the convergence message to be displayed.') self.convcheckBox.Enable(True) self.convcheckBox.SetThemeEnabled(True) self._init_coll_toolBar1_Tools(self.toolBar1) self._init_sizers() def __init__(self, parent): self._init_ctrls(parent) self.FileName = None self.ModLoaded = None #no model has been loaded self.Neq = None self.modict = {'modelname':''} self.modtree = Model() #Object containing dom tree with model specification self.modbuilt = 0 #model has never been built self.modRan = 0 #model has never been ran self.plot = 0 #no plot has ever been generated self.gauge1.SetRange(100) self.uncertainty = 0 # uncertainty analysis is off self.ceqs = [] #compiled equations self.cpars = [] #compiled parameters self.curdir = '' def OnMenu1items0Menu(self, event): """ Load a model file. """ self.modtree = Model() #reset the modtree object upon the opening of a new model if self.curdir: os.chdir(self.curdir) dlg = wx.FileDialog(self, "Choose a file", self.curdir, "", "*.ode", wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() a = self.modtree.readFile(filename) if a==1: #model is not a xml file f = open(filename) self.modict = pickle.load(f) self.fillGui() self.FileName = filename self.SetTitle('Model Builder - '+filename) f.close() elif a == 2: return else: self.modict.update(self.modtree.modict) self.fillGui() self.FileName = filename self.SetTitle('Model Builder - '+os.path.split(filename)[1]) #load data try: d = pickle.load(self.checkExt(filename,'.dat')) self.modict['results']=d[0] self.modict['trange']=d[1] except: pass self.ModLoaded = 1 self.curdir = os.path.split(filename)[0] finally: self.statusBar1.SetStatusText('Model loaded.') #print self.modict.keys() dlg.Destroy() def fillGui(self): """ fill GUI from model dictionary """ self.eqnEdit.SetValue(self.modict['equations']) self.textCtrl2.SetValue(str(self.modict['start'])) self.textCtrl3.SetValue(str(self.modict['end'])) self.textCtrl4.SetValue(str(self.modict['step'])) self.initValInput.SetValue(str(self.modict['init'])) self.parEdit.SetValue(self.modict['parameters']) self.BuildModel(r=0) # call BuildModel without running the model def checkExt(self,fn,ext): """ Add a filename extension to the filename or replace original extension. fn: file name ext: desired extension """ head,tail = os.path.split(fn) orext = '.'+tail.split('.')[-1] if not orext: tail += ext if orext and (ext != orext): tail = tail.replace(orext,ext) return head+tail def OnMenu1items1Menu(self, event): """ Save model. """ self.modtree = Model() if not self.FileName: return self.OnMenu1items2Menu(event) else: #print self.modict.keys() filename = os.path.split(self.FileName)[1] self.modict['modelname'] = filename self.modtree.path = self.curdir self.BuildModel(r=0) # call BuildModel without running the model #save data if self.modict.has_key('results')and self.modict.has_key('trange'): fna = open(self.checkExt(filename,'.dat'),'w') pickle.dump((self.modict['results'], self.modict['trange']),fna) fna.close() # Saving in xml format try: self.modict.pop('results') self.modict.pop('trange') except: pass self.modtree.Create(**self.modict) self.modtree.saveFile(self.checkExt(filename,'.ode')) self.ModLoaded = 1 self.statusBar1.SetStatusText('Model saved.') #print self.modict.keys() def OnMenu1items2Menu(self, event): """ Save as menu entry """ self.modtree = Model() dlg = wx.FileDialog(self, "Save File As", self.curdir, "", "*.ode", wx.SAVE) try: if dlg.ShowModal() == wx.ID_OK: self.FileName = dlg.GetPath() filename = os.path.split(self.FileName)[-1] self.modtree.path = self.curdir = os.path.split(self.FileName)[0] if not filename.endswith('.ode'): filename += '.ode' if not self.modbuilt: #check to see if model's dictionary has been built self.BuildModel(r=0) # call BuildModel without running the model self.modict['modelname'] = filename self.SetTitle('Model Builder - '+filename) #save data if self.modict.has_key('results'): os.chdir(self.curdir) fna = open(self.checkExt(filename,'.dat'),'w') pickle.dump((self.modict['results'], self.modict['trange']),fna) fna.close() # Saving in xml format #print self.modict.keys() try: self.modict.pop('results') self.modict.pop('trange') except: pass self.modtree.Create(**self.modict) self.modtree.saveFile(self.checkExt(filename,'.ode')) self.ModLoaded = 1 self.statusBar1.SetStatusText('Model saved.') finally: dlg.Destroy() def OnMenu1items3Menu(self, event): """ Close model menu entry. """ self.modtree = Model() self.FileName = None self.ModLoaded = None self.modict = {} self.eqnEdit.SetValue('') self.textCtrl2.SetValue('') self.textCtrl3.SetValue('') self.textCtrl4.SetValue('') self.initValInput.SetValue('') self.parEdit.SetValue('') self.SetTitle('Model Builder - ODE') def OnMenu1items4Menu(self, event): """ Exit the program """ self.Close() self.Destroy() def OnMenu2items0Menu(self, event): """ If Uncertainty Analysis has been selected, it will Open the uncertainty panel to set the parameters for the analysis. """ if not self.ModLoaded: self.OnMenu1items0Menu(event) return #--Checks if the Uncertainty item in the analysis menu (2) has been checked------ if self.menu2.IsChecked(wxID_WXFRAME1MENU2ITEMS0): self.uncertaintyPanel = LHS(None) #self.uncertaintyPanel=uncertaintyMiniFrame.create(None) self.initUncertainty() self.uncertaintyPanel.Show() self.uncertainty = 1 #raises uncertainty flag else: self.uncertainty = 0 #Uncertainty mode off try: self.uncertaintyPanel.Close() except: pass def checkErrors(self): """ Check for normal editing errors in model definition """ while not self.eqnEdit.GetValue()=='': val = self.eqnEdit.GetValue().strip().splitlines() Neq = len(val) break ##~ Neq = int(self.eqnEdit.GetNumberOfLines()) #get number of ODEs ##~ while strip(self.eqnEdit.GetLineText(Neq-1)) == '': # avoid getting empty lines at the end of the eq. box ##~ Neq = Neq-1 ##~ if Neq == 1:nty ##~ break if not self.parEdit.GetValue() == '': valp = self.parEdit.GetValue().strip().splitlines() Npar = len(valp) else: Npar = 0 ##~ Npar = int(self.parEdit.GetNumberOfLines()) #get Number of Parameters ##~ while strip(self.parEdit.GetLineText(Npar-1)) == '':# avoid getting empty lines at the end of the eq. box ##~ Npar=Npar-1 ##~ if Npar == 1: ##~ break ##~ if Npar == 0: ##~ Npar = 1 ##~ break #---Check number of initial conditions---------------------------------------------------------------------------- if self.initValInput.GetValue().strip() == '': ni = 0 else: ni = len(self.initValInput.GetValue().strip().split(' ')) if not ni == Neq: return 1 #---Check that all initial conditions are numbers---------------------------------------------------------------------------- for i in xrange(ni): try: float(self.initValInput.GetValue().strip().split(' ')[i]) except ValueError: e = 2 return 2 #---Check syntax of equations---------------------------------------------------------------------------- y=zeros(Neq)#fake equation array p=zeros(Npar)#fake parameter array t=0 eqs = self.eqnEdit.GetValue().strip().split('\n') eql = [i.split('=')[-1] for i in self.eqnEdit.GetValue().strip().split('\n')] vnames = [i.split('=')[0] for i in self.eqnEdit.GetValue().strip().split('\n') if '=' in i] pnames = [i.split('=')[0] for i in self.parEdit.GetValue().strip().splitlines() if '=' in i] #replace ocurrences of variable names in equations. if vnames: #create fake variables for v in vnames: exec('%s = 0'%v) #replace occurrences of parameter names in equations by p[i] if pnames: for p in pnames: exec('%s = 0'%p) for k in eql: try: eval(k) #dy(k)/dt except (SyntaxError, NameError), details: print details return 3 return 0 def OnToolbar1tools0Tool(self, event): """ Run button event. Call BuildModel with r=1, and times how long the model takes to run. The time elapsed is shown in a message dialog. """ if not self.ModLoaded: if self.eqnEdit.GetValue().strip() == '': return self.OnMenu1items0Menu(event) #----compile equations and store for later use eql = [i.split('=')[-1] for i in self.eqnEdit.GetValue().strip().split('\n')] self.vnames = [v.split('=')[0] for v in self.eqnEdit.GetValue().strip().split('\n') if '=' in v] try: self.ceqs = [compile(i,'','eval') for i in eql] except SyntaxError: dlg = wx.MessageDialog(self, 'There is a syntax error in the Equation Box.\nPlease fix it and try again.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() self.compilePars() #---checking for errors---------------------------------------------------------------------------- e = self.checkErrors() if e == 1: dlg = wx.MessageDialog(self, 'Wrong number of initial condition values.', 'Initial Condition Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return elif e == 2: dlg = wx.MessageDialog(self, 'There is a syntax error on the initial conditions box.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return elif e==3: dlg = wx.MessageDialog(self, 'There is a syntax error in the Equation Box.\nPlease fix it and try again.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() else: pass self.modbuilt = 0 self.updateGauge(0) if self.uncertainty == 0: self.BuildModel(r=1) #regular run self.modRan = 1 #set the flag indicating model has been run else: if self.uncertaintyPanel.Done: self.statusBar1.SetStatusText('Simulation Started!\n') self.BuildModel(r=1) # Melding setup self.modRan = 1 #set the flag indicating model has been run else: dlg = wx.MessageDialog(self, 'Set the parameters for the Uncertainty Analysis\nin its panel and press the "OK" button', 'Uncertain Parameters', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() def OnToolbar1tools0ToolRclicked(self, event): event.Skip() def updateGauge(self,t): """ This function simply updates the progress gauge """ pd = (100*t)/(float(str(self.textCtrl3.GetValue()).strip())-float(str(self.textCtrl2.GetValue()).strip())) #calcutates percentage done self.gauge1.SetValue(int(pd)) #self.gauge1.SetToolTipString(str(pd)+'%') self.gauge1.Refresh() #update the gauge def Equations(self, y, t): """ This function defines the system of differential equations, evaluating each line of the equation text box as ydot[i] returns ydot """ self.updateGauge(t) Neq=self.Neq Npar = self.Npar par = self.par #print "vnames:", self.vnames, self.pnames if self.vnames: #print y,type(y) exec('%s=%s'%(','.join(self.vnames),list(y))) ydot = zeros((Neq),'d') #initialize ydot p = zeros((Npar),'d') #initialize p #---Create Parameter Array---------------------------------------------------------------------------- if self.uncertainty == 0: pars = self.cpars #par.GetValue().strip().split('\n') if pars: #only if there is at least one parameter for j in xrange(len(pars)): if self.pnames: exec(pars[j]) else: p[j] = eval(pars[j]) #initialize parameter values else: if Npar: for i in xrange(Npar): if self.pnames: exec("%s=%s"%(self.pnames[i],par[i][self.run])) else: p[i] = par[i][self.run] # Get a new set of parameters for each repeated run #---Create equation array---------------------------------------------------------------------------- eqs = self.ceqs #print par[0][0].shape,type(par[0][0]),par[0].shape,type(par[0]),type(par[0]) for k in xrange(Neq): ydot[k] = eval(eqs[k]) #dy(k)/dt return ydot def compilePars(self): """ compile parameter expressions """ if self.parEdit.GetValue().strip() =="": self.cpars = [] return pars = self.parEdit.GetValue().strip().splitlines() self.pnames = [p.split('=')[0] for p in pars if '=' in p] if self.pnames: #in this case returns the compete expression, including the '=' #print pars try: self.cpars = [compile(i,'','exec') for i in pars] except (SyntaxError),details: self.cpars =pars dlg = wx.MessageDialog(self, 'There is a syntax error in the parameter Box:\n%s\nPlease fix it and try again.'%details, 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() else: try: self.cpars = [compile(i,'','eval') for i in pars] except SyntaxError: dlg = wx.MessageDialog(self, 'There is a syntax error in the parameter Box.\nPlease fix it and try again.', 'Syntax Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() def OnToolbar1tools1Tool(self, event): """ Show a figure with the equations typeset """ #---translate equations to pseudo-TeX notation---------------------------------------------------------------------------- texdict = { '**':r'^','sqrt':r'\sqrt','[':r'_{',']':r'}', 'sin':r'\rm{sin}','cos':r'\rm{cos}', 'alpha':r'\alpha ','beta ':r'\beta ','gamma':r'\gamma ' } #Can be extended to acomodate new strings texdict2 = {'*':r'\times '}# to take care of the multiplication sign * xlat = Xlator(texdict) xlat2 = Xlator(texdict2) if not self.modbuilt: self.BuildModel(r=0) eq = range(self.Neq) #initialize eqs = self.eqnEdit.GetValue().strip().split('\n') for i in xrange(self.Neq): e = eqs[i].split('=')[-1] eq[i] = xlat2.xlat(xlat.xlat(e)) #------------------------------------------------------------------------------- #getting variable names vnames = [n.split('=')[0].strip() for n in eqs if '=' in n] eqlist=[] for i in xrange(self.Neq): if len(vnames)==self.Neq: eq[i] = r'$d%s/dt = '%vnames[i] + eq[i] + r'$' else: eq[i] = r'$dY_%s/dt = '%i + eq[i] +r'$' eqlist.append(eq[i]) #---plot equations---------------------------------------------------------------------------- DP = PF.create(None) DP.SetTitle('Model '+str(self.FileName)[:-4]+': Equations') DP.plotEquation(eqlist) DP.Show() def plotOutput(self, x, y): """ Plots the results of a single run. Raises the flag that the plot has been created """ self.PF = PF.create(None) self.PF.plot_data(x,y,self.vnames) self.PF.Show() self.plot = 1 def plotMelding(self,x,y,tit='Results'): """ This function preprocesses the output of the repeated Runs, calls Bayesian Melding run and sends the data to PlotFigure.plotStats to be plotted. x contains the time values and y is a list of outputs from odeint, one from each run. """ self.statusBar1.SetStatusText('Preparing data for plotting...\n') yt = [] # initializes list of transposed runs nvar = min(y[0].shape) # Number of Variables runlen = max(y[0].shape) #Lenght of runs nruns = len(y) # Number of runs ## SPF = PF.create(None) ## SPF.plot_data(x,y) ## SPF.Show() self.nruns = nruns runs_byvar = [] #List of arrays that will contain all runs for each given variable for i in y: yt.append(transpose(i)) #Extracts the time series arrays and transpose them (the median function needs to have the series in rows, not in columns). for v in xrange(nvar): runs_byvar.append(array([yt[i][v] for i in xrange(nruns)])) # TODO: Turn medianruns into a function medianRuns = [median(i) for i in runs_byvar] self.statusBar1.SetStatusText('Done!\n\n') #---95% Limits---------------------------------------------------------- # TODO: Turn calculation of limits into a function self.statusBar1.SetStatusText('Calculating credibility intervals...\n') sorted=[] ll = [] ul = [] lc = int(runs_byvar[0].shape[0]*0.025) #column containing the lower boundary for the 95% interval hc = int(runs_byvar[0].shape[0]*0.975) #column containing the upper boundary for the 95% interval for l in xrange(nvar): sorted.append(msort(runs_byvar[l])) ll.append(sorted[l][lc]) ul.append(sorted[l][hc]) ts = (medianRuns,ll,ul) self.statusBar1.SetStatusText('Done!\n\n') #---testing--------------------------------------------------------------------- ## med = medianRuns[0]-medianRuns[1] ## SPF = PF.create(None) ## SPF.plot(x,med) ## SPF.Show() #------------------------------------------------------------------------------- TP = PF.create(None) TP.SetTitle(tit) TP.plotStats(x,ts,self.vnames) TP.Show() self.plot = 1 return (x,runs_byvar) def OnToolbar1tools2Tool(self, event): """ Show Output Table """ if self.modRan: self.TableOut = wxFrame2.create(None) output = self.modict['results'] # get output from model's dictionary x = self.modict['trange'] y = output[0] info = output[1] #extra information dictionary infoarray = array([info['hu'],info['tcur'],info['tsw'],info['nqu'],info['mused']]).transpose() infoarray = concatenate((zeros((1,5)),infoarray),axis=0) #print infoarray.shape, y.shape r,c = y.shape # get size of t_course array self.TableOut.grid1.CreateGrid(r+1,c+6) # Filling the grid x.shape = (len(x),1) data = concatenate((x,y,infoarray),axis=1) self.TableOut.Show() self.TableOut.fillGrid(data) self.TableOut.table.SetColLabelValue(0,'Time') for j in xrange(1,c+1): #fill column labels if self.vnames: self.TableOut.table.SetColLabelValue(j,self.vnames[j-1]) else: self.TableOut.table.SetColLabelValue(j,'y[%s]'%(j-1)) #Adding info column labels clabels = ['Step sizes','Time reached','Last method switch','Method order','Method nused'] for z in xrange(1,6): self.TableOut.table.SetColLabelValue(c+z,clabels[z-1]) def BuildModel(self, r=0): """ Constructs the model from the input fields and runs it if r==1 """ try: if self.modict:pass except: self.modict = {} try: self.modict['modelname'] = os.path.split(self.FileName)[-1] except AttributeError: self.modict['modelname'] = '' self.modict['equations'] = str(self.eqnEdit.GetValue()) #put equations into model's dictionary self.modict['parameters'] = str(self.parEdit.GetValue()) # put parameters into model's dictionary t_start = float(str(self.textCtrl2.GetValue()).strip()) self.modict['start'] = str(self.textCtrl2.GetValue()).strip() #store start time t_end = float(str(self.textCtrl3.GetValue()).strip()) self.modict['end'] = str(self.textCtrl3.GetValue()).strip() #store end time t_step = float(str(self.textCtrl4.GetValue()).strip()) self.modict['step'] = str(self.textCtrl4.GetValue()).strip() # Store step size init_conds = array([float(i) for i in self.initValInput.GetValue().strip().split(' ') if i != '']) self.modict['init'] = str(self.initValInput.GetValue()).strip() # Store initial conditions t_range = arange(t_start, t_end+t_step, t_step) self.modict['trange'] = t_range if self.focheckBox.GetValue(): fo = 1 else: fo = 0 if self.convcheckBox.GetValue(): cm = 1 else: cm = 0 eqs = self.eqnEdit.GetValue().strip().splitlines() self.vnames = [n.split('=')[0].strip() for n in eqs if '=' in n] self.pnames = [n.split('=')[0].strip() for n in self.parEdit.GetValue().strip().splitlines() if '=' in n] while not self.eqnEdit.GetValue()=='':#get number of ODEs val = self.eqnEdit.GetValue().strip().split('\n') Neq = len(val) break self.Neq = Neq#to be used by Equations if r==1: self.sw = wx.StopWatch() self.gauge1.SetValue(0) self.sw.Start() #----------------------------------------------------- if self.uncertainty == 0:#regular (single) run if not self.parEdit.GetValue() == '':#get Number of Parameters valp = self.parEdit.GetValue().strip().split('\n') Npar = len(valp) else: Npar = 0 self.Npar = Npar#to be used by Equations self.par = self.parEdit #to be used by Equations t_course = integrate.odeint(self.Equations,init_conds,t_range, full_output=fo, printmessg=cm) self.plotOutput(t_range,t_course) self.modict['results'] = t_course self.modRan = 1 else: #-------------Multiple runs (uncertainty analysis)------------------------------------ self.uncRun(init_conds,t_range,cm) t = gmtime(self.sw.Time()/1000) dlg = wx.MessageDialog(self, 'The simulation was completed in '+str(t[3])+' hours, '+str(t[4])+' minutes and '+str(t[5])+' seconds.', 'Time Elapsed', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() if self.uncertainty == 1: self.statusBar1.SetStatusText('The simulation was completed in: '+str(t[3])+' hours, '+str(t[4])+' minutes and '+str(t[5])+' seconds.') #------------------------------------------------------------------------------- self.modbuilt = 1 def uncRun(self, init_conds,t_range,cm): """ Runs the model in uncertainty mode """ Npar = len(self.uncertaintyPanel.theta) nr= int(self.uncertaintyPanel.specs['samples']) # Get K from uncertaity panel t_courseList = [] if self.uncertaintyPanel.anaChoice.GetStringSelection() == 'Uncertainty': self.parMeld = self.uncertaintyPanel.priords#[:Npar] else: #Sensitivity analysis self.parMeld = self.uncertaintyPanel.priords self.par = self.parMeld #to be used by Equations self.Npar = len(self.par) #print 'runs:%s'%nr for i in xrange(nr): self.run = i #---tcourselist for multiple runs does not contain the full output of odeint, just the time series-------------- t_courseList.append(integrate.odeint(self.Equations,init_conds,t_range, full_output=0, printmessg=cm)) #if self.run%20 == 0: # self.statusBar1.SetStatusText(str(self.run)+'\n') init_conds = array([float(i) for i in self.initValInput.GetValue().strip().split(' ') if i != '']) #reset initial conditions between runs self.modRan = 1 te = gmtime(self.sw.Time()/1000)#time elapsed so far (first stage of melding) if self.uncertaintyPanel.anaChoice.GetStringSelection() == 'Uncertainty': self.statusBar1.SetStatusText('First stage of simulation completed in:'+str(te[3])+' hours, '+str(te[4])+' minutes and '+str(te[5])+' seconds.'+'\n') (x,runs_byvar) = self.plotMelding(t_range,t_courseList,tit='Median Runs and 95 percent intervals. n=%s'%nr) self.Bmeld(x,runs_byvar) # Perform the rest of the melding calculations self.modict['meldruns'] = t_courseList else: #Sensitivity Analysis self.statusBar1.SetStatusText('Simulations completed in:'+str(te[3])+' hours, '+str(te[4])+' minutes and '+str(te[5])+' seconds.'+'\n') (x,runs_byvar) = self.plotMelding(t_range,t_courseList,tit='Median Runs and 95 percent intervals. n=%s'%nr) def Bmeld(self,t,ModOut): """ Performs the Melding. t is an array of time values. Modout is a list of n arrays of time courses where n is the number of variables. """ nvar = len(ModOut) dlg = wx.TextEntryDialog(self, 'for which time do you want to run the Melding', 'Choose Time', str(t[-1])) try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() if answer == '': time = t[-1] else: time = eval(answer) finally: dlg.Destroy() Phis = [ModOut[i][:,int(time)] for i in xrange(nvar)] # list with all the specified values for each variable q2phis = self.uncertaintyPanel.priords[-nvar:] # priors (pre-model) for the phis q1thetas = tuple(self.uncertaintyPanel.priords[:-nvar]) # priors for the thetas (parameters) plimits = self.uncertaintyPanel.priors[1][-nvar:] #limits of the prior distributions of the phis ptype = self.uncertaintyPanel.priors[0][:-nvar] #types of the prior distributions lik = self.uncertaintyPanel.lhoods alpha = self.uncertaintyPanel.alpha L = int(self.nruns*0.1) #---Run SIR---------------------------------------------------------------------------- #---meldout=(w, post_theta, qtilphi, q1est)---------------------------------------------------------------------------- meldout = meld.SIR(alpha,q2phis,plimits,ptype, q1thetas,Phis,L,lik) # output of meld.SIR: (w,qtiltheta,qtilphi,q1est) #---If SIR fails, don't proceed---------------------------------------------------------------------------- if meldout == None: return #---Calculate posterior of phis----------------------------------------------------- (x,post_phi) = self.postPHI(meldout, L) #---Plotting results--------------------------------------------------------------------------- nplots = len(self.uncertaintyPanel.priords) allpriors = self.uncertaintyPanel.priords nvp = self.uncertaintyPanel.theta + self.uncertaintyPanel.phi# Names of variable + parameters in the model) nlik = len (lik) # Get number of likelihood functions vname = ['prior of %s' % i for i in nvp] DP = PF.create(None) DP.SetTitle('Prior distributions for the parameters') DP.plotDist(allpriors,vname) DP.Show() #---Plot posteriors of theta---------------------------------------------------------------------------- MP = PF.create(None) MP.SetTitle('Theta posteriors') MP.plotMeldout(meldout, self.pnames) MP.Show() #---Plot posteriors of phi---------------------------------------------------------------------------- # TODO: extract the values of post_phi at time time for each variable to plot. self.plotMelding(x,post_phi,tit='Series After Melding Calibration') yt = [] runs_byvar = [] for i in post_phi: yt.append(transpose(i)) #Extracts the time series arrays and transpose them (the median function needs to have the series in rows, not in columns). for v in xrange(nvar): runs_byvar.append(array([yt[i][v] for i in xrange(L)])) data = [runs_byvar[i][:,-1] for i in xrange(nvar)] #vname2 = ['v[%s]' % i for i in xrange(nvar)] MP = PF.create(None) MP.SetTitle('Phi posteriors at time t='+str(time)) MP.plotDist(data,self.vnames) MP.Show() def postPHI(self,meldout,L): """ this function takes the output of the SIR algorithm and calculates the posterior distributions of the Phis from the posteriors of the thetas. """ self.post_theta = meldout[1] init_conds = array([float(i) for i in self.initValInput.GetValue().strip().split(' ') if i != '']) t_start = float(self.modict['start']) t_end = float(self.modict['end']) t_step = float(self.modict['step']) t_range = arange(t_start, t_end+t_step, t_step) t_courseList = [] for i in xrange(L): self.run = i t_courseList.append(integrate.odeint(self.Equations2,init_conds,t_range, full_output=0, printmessg=0)) #self.statusBar1.SetStatusText(str(self.run)+'\n') init_conds = array([float(i) for i in self.initValInput.GetValue().strip().split(' ') if i != '']) #reset initial conditions between runs return (t_range,t_courseList) def Equations2(self,y,t): """ Variation of the Equations function to calculate the posterior of phi """ Neq = self.Neq pars = self.post_theta Npar = len(pars) #get number of parameters if self.vnames: exec('%s=%s'%(','.join(self.vnames),list(y))) ydot = zeros((Neq),'d') #initialize ydot p = zeros((Npar),'d') #initialize p #---Create Parameter Array---------------------------------------------------------------------------- for i in xrange(Npar): if self.pnames: exec("%s=%s"%(self.pnames[i],pars[i][self.run])) else: p[i] = pars[i][self.run] # Get a new set of parameters for each repeated run #---Create equation array---------------------------------------------------------------------------- eqs = self.ceqs#self.eqnEdit.GetValue().strip().split('\n') for k in xrange(Neq): ydot[k] = eval(eqs[k]) #dy(k)/dt return ydot def OnMenu3items0Menu(self, event): """ Opens the about window """ dlg = about.wxDialog1(self) try: dlg.ShowModal() finally: dlg.Destroy() def initUncertainty(self): """ Initializes the values on the uncertainty Analysis Panel based on model specification """ while not self.eqnEdit.GetValue()=='':#get number of ODEs val = self.eqnEdit.GetValue().strip().split('\n') Neq = len(val) break if not self.parEdit.GetValue() == '':#get number of parameters valp = self.parEdit.GetValue().strip().split('\n') Npar = len(valp) else: Npar = 0 if self.vnames: phi = self.vnames else: phi = ["Y[%s]" % str(i) for i in xrange(Neq)] if Npar > 0: if self.pnames: theta = self.pnames else: theta = ['P[%s]' % str(i) for i in xrange(Npar)] self.uncertaintyPanel.phi = phi self.uncertaintyPanel.theta = theta self.uncertaintyPanel.grid_1.CreateGrid(Npar+Neq,Npar+Neq) self.uncertaintyPanel.parsCB.AppendItems(theta) #self.uncertaintyPanel.createVarList(items) # re-create varList on uncertaintyMiniFrame self.uncertaintyPanel.fileName = self.FileName #create local variable on Uncertainty panel with filename dir,fname = os.path.split(self.FileName)#[1] fname = fname[:-4]+'_unc.spec' if fname in os.listdir(dir): self.uncertaintyPanel.loadSpecs(fname) def OnWxFrame1Close(self, event): """ Things to do before Exiting. """ # Tries to close other windows if they exist try: DP.Close() except (NameError, AttributeError): pass try: self.PF.Close() except (NameError, AttributeError): pass try: MP.Close() except (NameError, AttributeError): pass try: self.TableOut.Close() except (AttributeError, NameError): pass try: self.uncertaintyPanel.Close() except (AttributeError, NameError): pass sys.exit() def OnMenu2Items1Menu(self, event): """ Call the quiver plot menu """ if not self.ModLoaded: dlg = wx.MessageDialog(self, 'Please Open or Create a Model First.', 'No Model Available', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return if not self.modbuilt: self.BuildModel() if self.vnames: QF.ch = self.vnames else: QF.ch = ['y[%s]'%i for i in xrange(self.Neq)] #print self.Neq, self.FileName Vector = QF.create(None) Vector.modict = self.modict Vector.initsCtrl.SetValue(self.modict['init']) inits = array([float(i) for i in self.modict['init'].strip().split(' ')]) Vector.limitsCtrl.SetValue("%s %s %s %s"%(min(inits),min(inits)*10,min(inits),min(inits)*10)) Vector.Show() def OnToolBar1OpentoolTool(self, event): return self.OnMenu1items0Menu(event) def OnToolBar1SavetoolTool(self, event): return self.OnMenu1items1Menu(event) def OnMenu3MbhelpMenu(self, event): helpviewer.main(['','MB.hhp']) class Future: """ By David Perry - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/84317 To run a function in a separate thread, simply put it in a Future: >>> A=Future(longRunningFunction, arg1, arg2 ...) It will continue on its merry way until you need the result of your function. You can read the result by calling the Future like a function, for example: >>> print A() If the Future has completed executing, the call returns immediately. If it is still running, then the call blocks until the function completes. The result of the function is stored in the Future, so subsequent calls to it return immediately. A few caveats: Since one wouldn't expect to be able to change the result of a function, Futures are not meant to be mutable. This is enforced by requiring the Future to be "called", rather than directly reading __result. If desired, stronger enforcement of this rule can be achieved by playing with __getattr__ and __setattr__. The Future only runs the function once, no matter how many times you read it. You will have to re-create the Future if you want to re-run your function; for example, if the function is sensitive to the time of day. For more information on Futures, and other useful parallel programming constructs, read Gregory V. Wilson's _Practical Parallel Programming_. """ def __init__(self,func,*param): # Constructor self.__done=0 self.__result=None self.__status='working' self.__C=Condition() # Notify on this Condition when result is ready # Run the actual function in a separate thread self.__T=Thread(target=self.Wrapper,args=(func,param)) self.__T.setName("FutureThread") self.__T.start() def __repr__(self): return '' def __call__(self): self.__C.acquire() while self.__done==0: self.__C.wait() self.__C.release() # We deepcopy __result to prevent accidental tampering with it. a=copy.deepcopy(self.__result) return a def Wrapper(self, func, param): # Run the actual function, and let us housekeep around it self.__C.acquire() try: self.__result=func(*param) except: self.__result="Exception raised within Future" self.__done=1 self.__status=`self.__result` self.__C.notify() self.__C.release() model-builder-0.4.1.orig/model_builder/wxFrame2.py0000644000175000017500000002474510601747060020173 0ustar godgod#----------------------------------------------------------------------------- # Name: wxFrame2.py # Purpose: Data output frame (wx.grid.Grid) # # Author: # # Created: 2003/02/04 # RCS-ID: $Id: wxFrame2.py,v 1.3 2004/01/13 10:51:44 fccoelho Exp $ # Copyright: (c) 2003-6 Flavio Codeco Coelho # Licence: This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #----------------------------------------------------------------------------- #Boa:Frame:wxFrame2 import wxversion wxversion.select('2.6') import wx import wx.grid from numpy import * import icones,cwt import PlotFigure as PF from pylab import show def create(parent): return wxFrame2(parent) [wxID_WXFRAME2, wxID_WXFRAME2GRID1, wxID_WXFRAME2PANEL1, wxID_WXFRAME2STATUSBAR1, wxID_WXFRAME2TOOLBAR1, ] = [wx.NewId() for _init_ctrls in range(5)] [wxID_WXFRAME2TOOLBAR1CWT, wxID_WXFRAME2TOOLBAR1PLOT, wxID_WXFRAME2TOOLBAR1PSD, wxID_WXFRAME2TOOLBAR1TOOLS0, ] = [wx.NewId() for _init_coll_toolBar1_Tools in range(4)] class wxFrame2(wx.Frame): def _init_coll_panelSizer_Items(self, parent): # generated method, don't edit parent.AddWindow(self.panel1, 1, border=0, flag=wx.EXPAND) def _init_coll_sheetBSizer_Items(self, parent): # generated method, don't edit parent.AddWindow(self.grid1, 1, border=0, flag=wx.EXPAND) def _init_coll_toolBar1_Tools(self, parent): # generated method, don't edit parent.AddTool(bitmap=icones.getSaveBitmap(), id=wxID_WXFRAME2TOOLBAR1TOOLS0, isToggle=False, longHelpString='Save this table', pushedBitmap=wx.NullBitmap, shortHelpString='Save As') parent.DoAddTool(bitmap=icones.getplotBitmap(), bmpDisabled=wx.NullBitmap, id=wxID_WXFRAME2TOOLBAR1PLOT, kind=wx.ITEM_NORMAL, label='plotSel', longHelp='Plot selected column', shortHelp='Plot') parent.DoAddTool(bitmap=icones.getSpectrumBitmap(), bmpDisabled=wx.NullBitmap, id=wxID_WXFRAME2TOOLBAR1PSD, kind=wx.ITEM_NORMAL, label='Spectrogram', longHelp='Spectrogram display', shortHelp='Spectrogram') parent.DoAddTool(bitmap=icones.getCWTBitmap(), bmpDisabled=wx.NullBitmap, id=wxID_WXFRAME2TOOLBAR1CWT, kind=wx.ITEM_NORMAL, label='Continuous Wavelet Transform', longHelp='Continuous Wavelet Transform', shortHelp='Wavelet Transform') self.Bind(wx.EVT_TOOL, self.OnToolbar1tools0Tool, id=wxID_WXFRAME2TOOLBAR1TOOLS0) self.Bind(wx.EVT_TOOL, self.OnToolBar1Tools1Tool, id=wxID_WXFRAME2TOOLBAR1PLOT) self.Bind(wx.EVT_TOOL, self.OnToolBar1PsdTool, id=wxID_WXFRAME2TOOLBAR1PSD) self.Bind(wx.EVT_TOOL, self.OnToolBar1CwtTool, id=wxID_WXFRAME2TOOLBAR1CWT) parent.Realize() def _init_coll_statusBar1_Fields(self, parent): # generated method, don't edit parent.SetFieldsCount(1) parent.SetStatusText(number=0, text='Status') parent.SetStatusWidths([-1]) def _init_sizers(self): # generated method, don't edit self.panelSizer = wx.BoxSizer(orient=wx.VERTICAL) self.sheetBSizer = wx.BoxSizer(orient=wx.VERTICAL) self._init_coll_panelSizer_Items(self.panelSizer) self._init_coll_sheetBSizer_Items(self.sheetBSizer) self.grid1.SetSizer(self.sheetBSizer) def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_WXFRAME2, name='', parent=prnt, pos=wx.Point(778, 556), size=wx.Size(686, 491), style=wx.DEFAULT_FRAME_STYLE, title='Output Table') self.SetClientSize(wx.Size(686, 491)) self.SetAutoLayout(True) self.SetToolTipString('') self.statusBar1 = wx.StatusBar(id=wxID_WXFRAME2STATUSBAR1, name='statusBar1', parent=self, style=0) self._init_coll_statusBar1_Fields(self.statusBar1) self.SetStatusBar(self.statusBar1) self.toolBar1 = wx.ToolBar(id=wxID_WXFRAME2TOOLBAR1, name='toolBar1', parent=self, pos=wx.Point(0, 0), size=wx.Size(204, 48), style=wx.TB_HORIZONTAL | wx.NO_BORDER) self.toolBar1.SetToolTipString('') self.SetToolBar(self.toolBar1) self.panel1 = wx.Panel(id=wxID_WXFRAME2PANEL1, name='panel1', parent=self, pos=wx.Point(1, 1), size=wx.Size(684, 464), style=wx.TAB_TRAVERSAL) self.grid1 = wx.grid.Grid(id=wxID_WXFRAME2GRID1, name='grid1', parent=self.panel1, pos=wx.Point(0, 0),size=wx.Size(684, 464), style=0) self.grid1.SetAutoLayout(True) self.grid1.SetMinSize(wx.Size(684, 464)) self.grid1.SetToolTipString(u'Data grid') self.grid1.SetThemeEnabled(True) self._init_coll_toolBar1_Tools(self.toolBar1) self._init_sizers() def __init__(self, parent): self._init_ctrls(parent) self.filename = None def OnToolbar1tools0Tool(self, event): dlg = wx.FileDialog(self, "Save Data As", ".", "", "*.dat", wx.SAVE) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() f = open(filename,'w') for i in xrange(self.table.GetNumberRows()): if i == 0: for k in xrange(self.grid1.GetNumberCols()): f.write(self.table.GetColLabelValue(k)+',') f.write('\n') for j in xrange(self.table.GetNumberCols()): f.write(self.grid1.GetCellValue(i,j)+',') f.write('\n') f.close() finally: dlg.Destroy() def fillGrid(self,data): """ this function will fill the spreadsheet """ self.table = TableBase(self.grid1,data) self.grid1.SetTable(self.table,True) def OnToolBar1Tools1Tool(self, event): """ Plot Selected columns """ sel = self.grid1.GetSelectedCols() data = self.createDataMatrix() leg = tuple([self.table.GetColLabelValue(i) for i in self.grid1.GetSelectedCols()]) y = [] for i in sel: y.append(data[:,i]) p=PF.create(None) p.SetTitle('Selected Variables') p.plot(data[:,0],y,leg) p.Show() def createDataMatrix(self): """ create a Numeric array with the contents of the spreadsheet """ rows = self.grid1.GetNumberRows() cols = self.grid1.GetNumberCols() data = zeros((rows-2,cols),float) for i in xrange(rows-2): for j in xrange(cols): data[i,j] = float(self.grid1.GetCellValue(i+1,j)) print data, data.shape, data[0,0] return data def OnToolBar1PsdTool(self, event): """ Plots the spectrogram of a vector """ sel = self.grid1.GetSelectedCols() if len(sel)!=1: dlg = wx.MessageDialog(self, 'You have selected %s columns.\nPlease select only one.'%len(sel), 'Selection Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return coln = self.grid1.GetSelectedCols()[0]#number of the selected column #print coln, type(coln) coll = self.grid1.GetNumberRows()#height of sel. column. name = self.table.GetColLabelValue(coln) y = zeros(coll,float) for i in xrange(coll): try: y[i] = float(self.grid1.GetCellValue(i,coln)) except: print i p=PF.create(None) p.SetTitle('Spectrogram') p.plotSpecg(y,name) p.Show() q=PF.create(None) q.SetTitle('Power Spectrum') q.plotSpec(y,name) q.Show() def OnToolBar1CwtTool(self, event): """ Plots the continuous wavelet transform of a given series. """ origin = 'image' interpolation = 'bilinear' sel = self.grid1.GetSelectedCols() if len(sel)!=1: dlg = wx.MessageDialog(self, 'You have selected %s columns.\nPlease select only one.'%len(sel), 'Selection Error', wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() finally: dlg.Destroy() return coln = self.grid1.GetSelectedCols()[0]#number of the selected column #print coln, type(coln) coll = self.grid1.GetNumberRows()#height of sel. column. name = self.table.GetColLabelValue(coln) y = zeros(coll,float) for i in xrange(coll): try: y[i] = float(self.grid1.GetCellValue(i,coln)) except: print i c = cwt.cwt(y,nvoice=8,wavelet="Morlet",oct=2,scale=4) cwt.imageCWT(c,title='%s Continuous Wavelet Transform\nMorlet wavelet'% name,origin=origin,interpolation=interpolation) show() class TableBase(wx.grid.PyGridTableBase): """ This class will store a numpy array to fill the grid """ def __init__(self, parentgrid, data): wx.grid.PyGridTableBase.__init__(self) self.data = data self.grid = parentgrid self.collabels = range(data.shape[1]+6) def GetNumberRows(self): return self.data.shape[0] def GetNumberCols(self): return self.data.shape[1] def GetValue(self, row, col): return self.data[row][col] def GetColLabelValue(self, col): return self.collabels[col] def SetColLabelValue(self, col, label): self.collabels[col]= label if __name__ == '__main__': app = wx.PySimpleApp() wx.InitAllImageHandlers() frame = create(None) frame.Show() app.MainLoop() model-builder-0.4.1.orig/model_builder/wxMiniFrame1.py0000644000175000017500000002011710536340441020773 0ustar godgod# -*- coding:iso8859-1 -*- #----------------------------------------------------------------------------- # Name: wxMiniFrame1.py # Purpose: # # Author: # # Created: 2003/02/04 # RCS-ID: $Id: wxMiniFrame1.py,v 1.3 2004/01/13 10:51:44 fccoelho Exp $ # Copyright: (c) 2003 Flávio Codeço Coelho # Licence: This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #----------------------------------------------------------------------------- #Boa:MiniFrame:wxMiniFrame1 import wx import wx.lib.buttons from scipy import gplt from string import * def create(parent): return wxMiniFrame1(parent) [wxID_WXMINIFRAME1, wxID_WXMINIFRAME1BUTTON1, wxID_WXMINIFRAME1BUTTON2, wxID_WXMINIFRAME1BUTTON3, wxID_WXMINIFRAME1BUTTON4, wxID_WXMINIFRAME1BUTTON5, wxID_WXMINIFRAME1BUTTON6, wxID_WXMINIFRAME1BUTTON7, wxID_WXMINIFRAME1GENTOGGLEBUTTON1, wxID_WXMINIFRAME1PANEL1, ] = [wx.NewId() for _init_ctrls in range(10)] class wxMiniFrame1(wx.MiniFrame): def _init_ctrls(self, prnt): # generated method, don't edit wx.MiniFrame.__init__(self, id=wxID_WXMINIFRAME1, name='', parent=prnt, pos= wx.Point(258, 166), size= wx.Size(200, 170), style=wx.DEFAULT_FRAME_STYLE, title='Plot Properties') self.SetClientSize(wx.Size(200, 170)) self.SetToolTipString('Edit plot properties') self.panel1 = wx.Panel(id=wxID_WXMINIFRAME1PANEL1, name='panel1', parent=self, pos= wx.Point(0, 0), size= wx.Size(200, 170), style=wx.TAB_TRAVERSAL) self.panel1.SetToolTipString('') self.panel1.SetLabel('Plot Properties') self.button1 = wx.Button(id=wxID_WXMINIFRAME1BUTTON1, label='Title', name='button1', parent=self.panel1, pos= wx.Point(14, 14), size= wx.Size(80, 22), style=0) self.button1.SetToolTipString('Set the title.') self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button, id=wxID_WXMINIFRAME1BUTTON1) self.button2 = wx.Button(id=wxID_WXMINIFRAME1BUTTON2, label='X title', name='button2', parent=self.panel1, pos= wx.Point(14, 44), size= wx.Size(80, 22), style=0) self.button2.SetToolTipString('Set title of X axis') self.button2.SetHelpText('Set X-axis title') self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button, id=wxID_WXMINIFRAME1BUTTON2) self.button3 = wx.Button(id=wxID_WXMINIFRAME1BUTTON3, label='Y title', name='button3', parent=self.panel1, pos= wx.Point(14, 74), size= wx.Size(80, 22), style=0) self.button3.SetToolTipString('Set title of Y axis') self.button3.SetHelpText('Set Y-axis title') self.button3.Bind(wx.EVT_BUTTON, self.OnButton3Button, id=wxID_WXMINIFRAME1BUTTON3) self.genToggleButton1 = wx.GenToggleButton(ID=wxID_WXMINIFRAME1GENTOGGLEBUTTON1, label='Grid', name='genToggleButton1', parent=self.panel1, pos= wx.Point(14, 104), size= wx.Size(80, 22), style=0) self.genToggleButton1.SetToggle(1) self.genToggleButton1.SetToolTipString('Toggle gridlines') self.genToggleButton1.Bind(wx.EVT_BUTTON, self.OnGentogglebutton1Button, id=wxID_WXMINIFRAME1GENTOGGLEBUTTON1) self.button4 = wx.Button(id=wxID_WXMINIFRAME1BUTTON4, label='Log Scale', name='button4', parent=self.panel1, pos= wx.Point(14, 134), size= wx.Size(80, 22), style=0) self.button4.SetToolTipString('Set logarithm scale for axes, individually.') self.button4.Bind(wx.EVT_BUTTON, self.OnButton4Button, id=wxID_WXMINIFRAME1BUTTON4) self.button5 = wx.Button(id=wxID_WXMINIFRAME1BUTTON5, label='X limits', name='button5', parent=self.panel1, pos= wx.Point(104, 44), size= wx.Size(80, 22), style=0) self.button5.Bind(wx.EVT_BUTTON, self.OnButton5Button, id=wxID_WXMINIFRAME1BUTTON5) self.button6 = wx.Button(id=wxID_WXMINIFRAME1BUTTON6, label='Y limits', name='button6', parent=self.panel1, pos= wx.Point(104, 74), size= wx.Size(80, 22), style=0) self.button6.Bind(wx.EVT_BUTTON, self.OnButton6Button, id=wxID_WXMINIFRAME1BUTTON6) self.button7 = wx.Button(id=wxID_WXMINIFRAME1BUTTON7, label='Autoscale', name='button7', parent=self.panel1, pos= wx.Point(104, 14), size= wx.Size(80, 22), style=0) self.button7.Bind(wx.EVT_BUTTON, self.OnButton7Button, id=wxID_WXMINIFRAME1BUTTON7) def __init__(self, parent): self._init_ctrls(parent) def OnButton1Button(self, event): """ sets the title of the plot on the event """ dlg = wx.TextEntryDialog(self, 'Enter a title for this plot:', 'Plot Title', 'Time Series') try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() gplt.title(answer) finally: dlg.Destroy() def OnButton2Button(self, event): """ sets the X axis title of the plot on the event """ dlg = wx.TextEntryDialog(self, 'Enter the X-axis title:', 'X-axis Title', 'Time') try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() gplt.xtitle(answer) finally: dlg.Destroy() def OnButton3Button(self, event): """ sets the Y axis title of the plot on the event """ dlg = wx.TextEntryDialog(self, 'Enter the Y-axis title:', 'Y-axis Title', 'Y[i]') try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() gplt.ytitle(answer) finally: dlg.Destroy() def OnGentogglebutton1Button(self, event): """ toggle gridlines """ t = self.genToggleButton1.GetValue() if t == 1: gplt.grid('on') else: gplt.grid('off') def OnButton4Button(self, event): """ log scale on chosen axis """ dlg = wx.SingleChoiceDialog(self, 'Choose Axis', 'Caption', ['X-axis','Y-axis', 'None']) try: if dlg.ShowModal() == wx.ID_OK: selected = dlg.GetStringSelection() if selected == 'X-axis': gplt.logx() elif selected == 'Y-axis': gplt.logy() elif selected == 'None': gplt.logx('off') gplt.logy('off') finally: dlg.Destroy() def OnButton5Button(self, event): dlg = wx.TextEntryDialog(self, 'Enter two numbers separated by a space:', 'Define X-Axis Limits', '') try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() lims = [i for i in strip(answer).split(' ') if i!= ''] gplt.xaxis((float(lims[0]),float(lims[1]))) finally: dlg.Destroy() event.Skip() def OnButton6Button(self, event): dlg = wx.TextEntryDialog(self, 'Enter two numbers separated by a space:', 'Define Y-Axis Limits', '') try: if dlg.ShowModal() == wx.ID_OK: answer = dlg.GetValue() answer = dlg.GetValue() lims = [i for i in strip(answer).split(' ') if i!= ''] gplt.yaxis((float(lims[0]),float(lims[1]))) finally: dlg.Destroy() event.Skip() def OnButton7Button(self, event): gplt.autoscale() event.Skip() model-builder-0.4.1.orig/CHANGELOG0000644000175000017500000000120610602226577014523 0ustar godgod------------------------------------------------------------------------ r87 | fccoelho | 2007-03-26 17:05:02 -0300 (Seg, 26 Mar 2007) | 7 lines 0.4.0 release Added support for named variables and parameters in their input boxes; Older models without variable/parameter names are still supported fixed bug that prevented variable names on spreadsheet columns. Variable names and parameter names (when used), are passed to all graphical utputs. other little bug fixes. Uncertainty analysis is partially broken due to large changes above. Will be fixed in the next release. ------------------------------------------------------------------------ model-builder-0.4.1.orig/COPYING0000644000175000017500000004312410272530275014345 0ustar godgod GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. model-builder-0.4.1.orig/MANIFEST0000644000175000017500000000367210536347031014446 0ustar godgodCOPYING MANIFEST README ez_setup.py setup.py model_builder/Introduction.html model_builder/MB.hhc model_builder/MB.hhk model_builder/MB.hhp model_builder/MB.htb model_builder/MB.ico model_builder/Model.py model_builder/ModelBuilder_About.html model_builder/PlotFigure.py model_builder/PyMB.py model_builder/The_main_Interface.html model_builder/__init__.py model_builder/__version__.py model_builder/about.py model_builder/backup_section.png model_builder/cwt.png model_builder/cwt.py model_builder/filesave.png model_builder/folder_open.png model_builder/gnuplot.png model_builder/graphics_section.png model_builder/icones.py model_builder/index.html model_builder/lhs.py model_builder/lhsframe.py model_builder/lhsframe_glade.py model_builder/mathematics_section.png model_builder/model-builder.desktop model_builder/odexml.py model_builder/quivVarFrame.py model_builder/spreadsheet_section.png model_builder/timemanagement_section.png model_builder/uncertaintyMiniFrame.py model_builder/wxFrame1.py model_builder/wxFrame2.py model_builder/wxMiniFrame1.py model_builder/Bayes/Bayeshelp.py model_builder/Bayes/Melding.py model_builder/Bayes/Meldingbas.py model_builder/Bayes/__init__.py model_builder/Bayes/flib.f model_builder/Bayes/gibbs.py model_builder/Bayes/kde1d.py model_builder/Bayes/lhs.py model_builder/Bayes/metropolis.py model_builder/Bayes/rejectBayes.py model_builder/Bayes/rejection.py model_builder/Docs/Quick-start.pdf model_builder/Examples/2eqs.ode model_builder/Examples/3eqs.ode model_builder/Examples/HH.ode model_builder/Examples/bmeld_example.ode model_builder/Examples/exponencial.ode model_builder/Examples/gastric.ode model_builder/Examples/lotka-volterra.ode model_builder/Examples/lotka-volterra_unc.spec model_builder/Examples/nagumo.ode model_builder/Examples/pk.ode model_builder/Examples/pk_unc.spec model_builder/Examples/sir.ode model_builder/Examples/sirdemog.ode model_builder/Examples/sprucebudworm.ode model_builder/Examples/verhulst.ode model-builder-0.4.1.orig/MANIFEST.in0000644000175000017500000000052610602227164015044 0ustar godgodinclude COPYING README MANIFEST CHANGELOG include model_builder/*.png include model_builder/*.ico include model_builder/MB* include model_builder/Examples/*.ode include model_builder/Examples/*.spec include model_builder/*.html include model_builder/Docs/*.pdf include model_builder/model-builder.desktop include ez_setup.py include setup.py model-builder-0.4.1.orig/README0000644000175000017500000000043110272530273014162 0ustar godgodThis is Model Builder version 0.2.2 Basic instructions on how to use Model Builder can be found on the project's Homepage at http://www.procc.fiocruz.br/~cursos/course/view.php?id=6 Until then, if you need to contact me about this project, you can find me at fccoelho@fiocruz.br model-builder-0.4.1.orig/ez_setup.py0000644000175000017500000002136410431162422015514 0ustar godgod#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools, set a download mirror, or use an alternate download directory, you can do so by supplying the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import sys DEFAULT_VERSION = "0.6a11" DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] md5_data = { 'setuptools-0.6a1-py2.3.egg': 'ee819a13b924d9696b0d6ca6d1c5833d', 'setuptools-0.6a1-py2.4.egg': '8256b5f1cd9e348ea6877b5ddd56257d', 'setuptools-0.6a10-py2.3.egg': '162d8357f1aff2b0349c6c247ee62987', 'setuptools-0.6a10-py2.4.egg': '803a2d8db501c1ac3b5b6fb4e907f788', 'setuptools-0.6a11-py2.3.egg': 'd12bf8e13aaeb25c91350c8d77f01a71', 'setuptools-0.6a11-py2.4.egg': 'a95d5bc7a070aa1028bc4dcb5270b133', 'setuptools-0.6a11dev_r43177-py2.3.egg': '068ef7c8522539af12f5fb14b4a8cf21', 'setuptools-0.6a11dev_r43295-py2.3.egg': 'eb78390e6beac3694342b5629cc6653f', 'setuptools-0.6a11dev_r43403-py2.3.egg': 'ba1a6b00f5c1fdd482284a7df3d8bd19', 'setuptools-0.6a11dev_r43417-py2.3.egg': 'c6014183afd9fd167d7d82eee78db2c6', 'setuptools-0.6a2-py2.3.egg': 'b98da449da411267c37a738f0ab625ba', 'setuptools-0.6a2-py2.4.egg': 'be5b88bc30aed63fdefd2683be135c3b', 'setuptools-0.6a3-py2.3.egg': 'ee0e325de78f23aab79d33106dc2a8c8', 'setuptools-0.6a3-py2.4.egg': 'd95453d525a456d6c23e7a5eea89a063', 'setuptools-0.6a4-py2.3.egg': 'e958cbed4623bbf47dd1f268b99d7784', 'setuptools-0.6a4-py2.4.egg': '7f33c3ac2ef1296f0ab4fac1de4767d8', 'setuptools-0.6a5-py2.3.egg': '748408389c49bcd2d84f6ae0b01695b1', 'setuptools-0.6a5-py2.4.egg': '999bacde623f4284bfb3ea77941d2627', 'setuptools-0.6a6-py2.3.egg': '7858139f06ed0600b0d9383f36aca24c', 'setuptools-0.6a6-py2.4.egg': 'c10d20d29acebce0dc76219dc578d058', 'setuptools-0.6a7-py2.3.egg': 'cfc4125ddb95c07f9500adc5d6abef6f', 'setuptools-0.6a7-py2.4.egg': 'c6d62dab4461f71aed943caea89e6f20', 'setuptools-0.6a8-py2.3.egg': '2f18eaaa3f544f5543ead4a68f3b2e1a', 'setuptools-0.6a8-py2.4.egg': '799018f2894f14c9f8bcb2b34e69b391', 'setuptools-0.6a9-py2.3.egg': '8e438ad70438b07b0d8f82cae42b278f', 'setuptools-0.6a9-py2.4.egg': '8f6e01fc12fb1cd006dc0d6c04327ec1', } import sys, os def _validate_md5(egg_name, data): if egg_name in md5_data: from md5 import md5 digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( "md5 validation of %s failed! (Possible download problem?)" % egg_name ) sys.exit(2) return data def use_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 ): """Automatically find/download setuptools and make it available on sys.path `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where setuptools will be downloaded, if it is not already available. If `download_delay` is specified, it should be the number of seconds that will be paused before initiating a download, should one be required. If an older version of setuptools is installed, this routine will print a message to ``sys.stderr`` and raise SystemExit in an attempt to abort the calling script. """ try: import setuptools if setuptools.__version__ == '0.0.1': print >>sys.stderr, ( "You have an obsolete version of setuptools installed. Please\n" "remove it from your system entirely before rerunning this script." ) sys.exit(2) except ImportError: egg = download_setuptools(version, download_base, to_dir, download_delay) sys.path.insert(0, egg) import setuptools; setuptools.bootstrap_install_from = egg import pkg_resources try: pkg_resources.require("setuptools>="+version) except pkg_resources.VersionConflict: # XXX could we install in a subprocess here? print >>sys.stderr, ( "The required version of setuptools (>=%s) is not available, and\n" "can't be installed while this script is running. Please install\n" " a more recent version first." ) % version sys.exit(2) def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay = 15 ): """Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. """ import urllib2, shutil egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) url = download_base + egg_name saveto = os.path.join(to_dir, egg_name) src = dst = None if not os.path.exists(saveto): # Avoid repeated downloads try: from distutils import log if delay: log.warn(""" --------------------------------------------------------------------------- This script requires setuptools version %s to run (even to display help). I will attempt to download it for you (from %s), but you may need to enable firewall access for this script first. I will start the download in %d seconds. (Note: if this machine does not have network access, please obtain the file %s and place it in this directory before rerunning this script.) ---------------------------------------------------------------------------""", version, download_base, delay, url ); from time import sleep; sleep(delay) log.warn("Downloading %s", url) src = urllib2.urlopen(url) # Read/write all in one block, so we don't create a corrupt file # if the download is interrupted. data = _validate_md5(egg_name, src.read()) dst = open(saveto,"wb"); dst.write(data) finally: if src: src.close() if dst: dst.close() return os.path.realpath(saveto) def main(argv, version=DEFAULT_VERSION): """Install or upgrade setuptools and EasyInstall""" try: import setuptools except ImportError: import tempfile, shutil tmpdir = tempfile.mkdtemp(prefix="easy_install-") try: egg = download_setuptools(version, to_dir=tmpdir, delay=0) sys.path.insert(0,egg) from setuptools.command.easy_install import main main(list(argv)+[egg]) finally: shutil.rmtree(tmpdir) else: if setuptools.__version__ == '0.0.1': # tell the user to uninstall obsolete version use_setuptools(version) req = "setuptools>="+version import pkg_resources try: pkg_resources.require(req) except pkg_resources.VersionConflict: try: from setuptools.command.easy_install import main except ImportError: from easy_install import main main(list(argv)+[download_setuptools(delay=0)]) sys.exit(0) # try to force an exit else: if argv: from setuptools.command.easy_install import main main(argv) else: print "Setuptools version",version,"or greater has been installed." print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' def update_md5(filenames): """Update our built-in md5 registry""" import re from md5 import md5 for name in filenames: base = os.path.basename(name) f = open(name,'rb') md5_data[base] = md5(f.read()).hexdigest() f.close() data = [" %r: %r,\n" % it for it in md5_data.items()] data.sort() repl = "".join(data) import inspect srcfile = inspect.getsourcefile(sys.modules[__name__]) f = open(srcfile, 'rb'); src = f.read(); f.close() match = re.search("\nmd5_data = {\n([^}]+)}", src) if not match: print >>sys.stderr, "Internal error!" sys.exit(2) src = src[:match.start(1)] + repl + src[match.end(1):] f = open(srcfile,'w') f.write(src) f.close() if __name__=='__main__': if len(sys.argv)>2 and sys.argv[1]=='--md5update': update_md5(sys.argv[2:]) else: main(sys.argv[1:]) model-builder-0.4.1.orig/setup.py0000644000175000017500000000336310745436422015031 0ustar godgod#-*- coding:latin-1 -*- import ez_setup ez_setup.use_setuptools() import setuptools, os, glob from setuptools import setup #from numpy.distutils.core import setup, Extension ###Configuring Build ##libs=[];libdirs=[];f2pyopts=[] ##if os.name == 'nt': ## pass#f2pyopts.extend(["--compiler=mingw32","--fcompiler=gnu"]) ## ## ## ##flib = Extension(name='model_builder.Bayes.flib', ## libraries=libs, ## library_dirs=libdirs, ## f2py_options=f2pyopts, ## sources=['model_builder/Bayes/flib.f'] ## ) setup(name = 'Model-Builder', version = '0.4.1', author = 'Flavio Codeco Coelho', author_email = 'fccoelho@fiocruz.br', license = 'GPL', url = 'http://model-builder.sourceforge.net', download_url = 'http://sourceforge.net/project/showfiles.php?group_id=164374', description='Model Builder is a graphical ODE simulator', long_description='Model Builder is a graphical tool for designing, simulating and analyzing Mathematical model consisting of a system of ordinary differential equations(ODEs).', include_package_data=True, entry_points = {'gui_scripts':['PyMB = model_builder.PyMB:main',]}, packages = ['model_builder','model_builder/Bayes'], package_data = {'':['MB*','*.pdf','*.desktop'],'model_builder':['Docs/*.pdf', 'model-builder.desktop']}, data_files=[('/usr/share/pixmaps',['model_builder/MB.ico']),('/usr/share/applications',['model_builder/model-builder.desktop']),('/usr/share/model-builder/examples',glob.glob("model_builder/Examples/*.ode")),('/usr/share/model-builder/docs',['model_builder/Docs/Quick-start.pdf'])], ) model-builder-0.4.1.orig/PKG-INFO0000644000175000017500000000076110745437177014423 0ustar godgodMetadata-Version: 1.0 Name: Model-Builder Version: 0.4.1 Summary: Model Builder is a graphical ODE simulator Home-page: http://model-builder.sourceforge.net Author: Flavio Codeco Coelho Author-email: fccoelho@fiocruz.br License: GPL Download-URL: http://sourceforge.net/project/showfiles.php?group_id=164374 Description: Model Builder is a graphical tool for designing, simulating and analyzing Mathematical model consisting of a system of ordinary differential equations(ODEs). Platform: UNKNOWN model-builder-0.4.1.orig/setup.cfg0000644000175000017500000000007310745437177015143 0ustar godgod[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0