def u(z, par):
    """ Calculates utility of assets
    
        Args:
            par.theta (int): Degree of risk aversion
            z (float or int): Input in utility function
            par: SimpleNamespace
        
        Returns:
            u (float): Utility of assets 
    """
    return z**(1+par.theta)/(1+par.theta)