From 0ab435641766558a0bc96e818a7b12c9ed356ba2 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Sat, 2 Sep 2023 07:11:46 +0200 Subject: [PATCH] Added some basic info logging to ConstraintCollocator. --- opty/direct_collocation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opty/direct_collocation.py b/opty/direct_collocation.py index bf14e15..dbf0345 100644 --- a/opty/direct_collocation.py +++ b/opty/direct_collocation.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from functools import wraps +import logging import numpy as np import sympy as sm @@ -732,6 +733,7 @@ def _discretize_eom(self): The column vector of the discretized equations of motion. """ + logging.info('Discretizing the equations of motion.') x = self.state_symbols xd = self.state_derivative_symbols u = self.input_trajectories @@ -921,6 +923,7 @@ def _gen_multi_arg_con_func(self): adjacent_start = 1 adjacent_stop = None + logging.info('Compiling the constraint function.') f = ufuncify_matrix(args, self.discrete_eom, const=constant_syms + (h_sym,), tmp_dir=self.tmp_dir, parallel=self.parallel) @@ -1261,11 +1264,13 @@ def _gen_multi_arg_con_jac_func(self): # This creates a matrix with all of the symbolic partial derivatives # necessary to compute the full Jacobian. + logging.info('Differentiating the constraint function.') symbolic_partials = self.discrete_eom.jacobian(wrt) # This generates a numerical function that evaluates the matrix of # partial derivatives. This function returns the non-zero elements # needed to build the sparse constraint Jacobian. + logging.info('Compiling the Jacobian function.') eval_partials = ufuncify_matrix(args, symbolic_partials, const=constant_syms + (h_sym,), tmp_dir=self.tmp_dir,