Repository navigation
lsim warning for TF systems #625
|
Dear all, Can I skip this warning? Is there another function for simulating transfer function systems that does not require a conversion to state space? Thanks, Marco from SIPPY teams The example tested is the following: from __future__ import division
from past.utils import old_div
from sippy import functionset as fset
from sippy import *
import numpy as np
import control.matlab as cnt
sampling_time = 1. # [s]
end_time = 400 # [s]
npts = int(old_div(end_time, sampling_time)) + 1
Time = np.linspace(0, end_time, npts)
switch_probability = 0.08 # [0..1]
[Usim,_,_] = fset.GBN_seq(npts, switch_probability, Range = [-1, 1])
white_noise_variance = [0.01]
e_t = fset.white_noise_var(Usim.size, white_noise_variance)[0]
DEN = [1., -2.21, 1.7494, -0.584256, 0.0684029, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
NUM = [1.5, -2.07, 1.3146]
g_sample = cnt.tf(NUM, DEN, sampling_time)
Y1, Time, Xsim = cnt.lsim(g_sample, Usim, Time) |
Replies: 4 comments 5 replies
|
You can ignore that warning if you don't intend to make use of x. x is the "internal state" of the system, and depends on the specific realization of your state-space representation of the transfer function you provided. |
|
Hi @ sawyerbfuller and thanks for the prompt answer. Is there a way to not show the warning? Otherwise I'll just ignore it. Thanks again, Marco |
|
Hi Marco, one way is to use the more pythonic forced_response, which gives you more control, and in particular, I believe you can ask it to not give you x. |
|
Dear @murrayrm and @sawyerbfuller, ValueError: Parameter T: time values must be equally spaced. Digging into the code we found the error line and tested the commands on the input we passed: dt = T[1] - T[0] = 1 line 340 of timeresp.py Is it possible that the function _check_convert_array "does something wrong" to the array produced by linspace so Can you help us with this issue? Thanks, SIPPY team |
Hi Marco,
one way is to use the more pythonic forced_response, which gives you more control, and in particular, I believe you can ask it to not give you x.