From 21738ade880a054cca99f48d5e56095a0f3272f2 Mon Sep 17 00:00:00 2001 From: Duncan Hobbs Date: Tue, 17 Sep 2019 21:33:39 -0400 Subject: [PATCH] Raise value error if C != 0 and beta >= 1. --- quantecon/lqcontrol.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quantecon/lqcontrol.py b/quantecon/lqcontrol.py index 1ada7a320..503ad0e1f 100644 --- a/quantecon/lqcontrol.py +++ b/quantecon/lqcontrol.py @@ -145,6 +145,10 @@ def __init__(self, Q, R, A, B, C=None, N=None, beta=1, T=None, Rf=None): self.d = None self.T = None + if (self.C != 0).any() and beta >= 1: + raise ValueError('beta must be strictly smaller than 1 if ' + + 'T = None and C != 0.') + self.F = None def __repr__(self):