@@ -482,24 +482,24 @@ def get_IRF_matrix(self, freq:np.ndarray, frf_method:str="f", return_t_axis:bool
482
482
return IRF_matrix
483
483
484
484
485
- def get_response (self , exc_dof :np .ndarray | list , exc :np .ndarray , sampling_rate :int ,
486
- resp_dof :np .ndarray = None , domain :str = "f" , frf_method :str = "f" ,
485
+ def get_response (self , exc_dof :np .ndarray | list | int , exc :np .ndarray , sampling_rate :int ,
486
+ resp_dof :np .ndarray | int = None , domain :str = "f" , frf_method :str = "f" ,
487
487
return_matrix :bool = False , return_t_axis :bool = False , return_f_axis :bool = False ,
488
488
** kwargs ) -> np .ndarray | tuple [np .ndarray ]:
489
489
"""
490
490
Get response time series.
491
491
492
492
Parameters
493
493
----------
494
- exc_dof : ndarray, list
494
+ exc_dof : ndarray, list, int
495
495
Degrees of freedom (masses) where the system is excited.
496
496
exc : ndarray
497
497
Excitation time array 1D (one excitation DOF) or 2D (multiple excitation DOFs).
498
498
1D shape (single excitation DOF): (time series)
499
499
2D shape (multiple excitation DOFs): (number of DOFs, time series)
500
500
sampling_rate : int
501
501
Sampling rate of excitation time signals.
502
- resp_dof : ndarray, list, optional
502
+ resp_dof : ndarray, list, int, optional
503
503
Degrees of freedom (masses) where the response is calculated. If None - responses of all masses are caluclated.
504
504
frf_method : str, optional
505
505
Method of calculating the FRF matrix:
@@ -540,13 +540,17 @@ def get_response(self, exc_dof:np.ndarray|list, exc:np.ndarray, sampling_rate:in
540
540
# check exc_dof:
541
541
if isinstance (exc_dof , list ):
542
542
exc_dof = np .array (exc_dof )
543
+ elif isinstance (exc_dof , int ):
544
+ exc_dof = np .array ([exc_dof ])
543
545
if len (exc_dof .shape ) > 1 :
544
546
raise Exception ("Multiple dimension array not allowed for exc_dof array" )
545
547
546
548
# check resp_dof:
547
549
if resp_dof is not None :
548
550
if isinstance (resp_dof , list ):
549
551
resp_dof = np .array (resp_dof )
552
+ elif isinstance (resp_dof , int ):
553
+ resp_dof = np .array ([resp_dof ])
550
554
if len (resp_dof .shape ) > 1 :
551
555
raise Exception ("Multiple dimension array not allowed for resp_dof array" )
552
556
else : # all rsponse DOFs are calculated
0 commit comments