discSpec.py
def MaxwellModes(z, t, Gt, isPlateau):
	"""
	
	 Function: MaxwellModes(input)
	
	 Solves the linear least squares problem to obtain the DRS

	 Input: z  = points distributed according to the density, [z = log(tau)]
	        t  = n*1 vector contains times,
	        Gt = n*1 vector contains G(t),
	        isPlateau = True if G0 \neq 0
	
	 Output: g, tau = spectrum  (array)
	         error = relative error between the input data and the G(t) inferred from the DRS
	         condKp = condition number
	"""
	N      = len(z)
	tau    = np.exp(z)
	n      = len(t)
	Gexp   = Gt

	#
	# Prune small and -ve weights g(i)
	#
	g, error, condKp = nnLLS(t, tau, Gexp, isPlateau)


	# search for small 
	if isPlateau:
		izero = np.where(g[:-1]/max(g[:-1]) < 1e-7)
	else:
		izero = np.where(g/max(g) < 1e-7)
	
	tau   = np.delete(tau, izero)
	g     = np.delete(g, izero)

	return g, tau, error, condKp

	
	 Function: MaxwellModes(input)
	
	 Solves the linear least squares problem to obtain the DRS

	 Input: z  = points distributed according to the density, [z = log(tau)]
	        t  = n*1 vector contains times,
	        Gt = n*1 vector contains G(t),
	        isPlateau = True if G0 \neq 0
	
	 Output: g, tau = spectrum  (array)
	         error = relative error between the input data and the G(t) inferred from the DRS
	         condKp = condition number
	
MaxwellModes(input)
Solves the linear least squares problem to obtain the DRS



g, tau = spectrum  (array)
error = relative error between the input data and the G(t) inferred from the DRS
condKp = condition number
MaxwellModes ( input ) Solves the linear least squares problem to obtain the DRS g tau = spectrum ( array ) error = relative error between the input data and the G ( t ) inferred from the DRS condKp = condition number
def MaxwellModes(z, t, Gt, isPlateau):
	N      = len(z)
	tau    = np.exp(z)
	n      = len(t)
	Gexp   = Gt
	 Prune small and -ve weights g(i)
	g, error, condKp = nnLLS(t, tau, Gexp, isPlateau)
	 search for small 
	if isPlateau:
		izero = np.where(g[:-1]/max(g[:-1]) < 1e-7)
	else:
		izero = np.where(g/max(g) < 1e-7)
	tau   = np.delete(tau, izero)
	g     = np.delete(g, izero)
	return g, tau, error, condKp
def MaxwellModes ( z , t , Gt , isPlateau ) : N = len ( z ) tau = np . exp ( z ) n = len ( t ) Gexp = Gt g , error , condKp = nnLLS ( t , tau , Gexp , isPlateau ) if isPlateau : izero = np . where ( g [ : - 1 ] / max ( g [ : - 1 ] ) < 1e-7 ) else : izero = np . where ( g / max ( g ) < 1e-7 ) tau = np . delete ( tau , izero ) g = np . delete ( g , izero ) return g , tau , error , condKp
Function: MaxwellModes(input)
Solves the linear least squares problem to obtain the DRS
Function : MaxwellModes ( input ) Solves the linear least squares problem to obtain the DRS
"""
	
	 Function: MaxwellModes(input)
	
	 Solves the linear least squares problem to obtain the DRS

	 Input: z  = points distributed according to the density, [z = log(tau)]
	        t  = n*1 vector contains times,
	        Gt = n*1 vector contains G(t),
	        isPlateau = True if G0 \neq 0
	
	 Output: g, tau = spectrum  (array)
	         error = relative error between the input data and the G(t) inferred from the DRS
	         condKp = condition number
	""" # # Prune small and -ve weights g(i) # # search for small 
z
t
Gt
isPlateau