|
From: | Nicholas Jankowski |
Subject: | Re: test this in matlab for my please |
Date: | Tue, 15 Mar 2016 12:25:57 -0400 |
On Tue, Mar 15, 2016 at 10:34 AM, Nicholas Jankowski <address@hidden> wrote:On Tue, Mar 15, 2016 at 9:52 AM, Doug Stewart <address@hidden> wrote:On Fri, Mar 11, 2016 at 1:17 PM, Doug Stewart <address@hidden> wrote:Thanks again.On Fri, Mar 11, 2016 at 1:00 PM, Nicholas Jankowski <address@hidden> wrote:On Fri, Mar 11, 2016 at 12:41 PM, Doug Stewart <address@hidden> wrote:2016-03-11 12:28 GMT-05:00 Doug Stewart <address@hidden>:try again pleaseWould someone kindly run this in matlab and post the results for me.Thankss=tf('s')sys=1/sc2d(sys,.1,'zoh')c2d(sys,.1,'matched')c2d(sys,.1,'tustin')sys=1/(s^2)c2d(sys,.1,'zoh')c2d(sys,.1,'matched')c2d(sys,.1,'tustin')sys=1/(s*(s+1))c2d(sys,.1,'zoh')c2d(sys,.1,'matched')c2d(sys,.1,'tustin')--DAS--DASno errors this time:
>>
s=tf('s')
sys=1/s
c2d(sys,.1,'zoh')
c2d(sys,.1,'matched')
c2d(sys,.1,'tustin')
sys=1/(s^2)
c2d(sys,.1,'zoh')
c2d(sys,.1,'matched')
c2d(sys,.1,'tustin')
sys=1/(s*(s+1))
c2d(sys,.1,'zoh')
c2d(sys,.1,'matched')
c2d(sys,.1,'tustin')
s =
s
Continuous-time transfer function.
sys =
1
-
s
Continuous-time transfer function.
ans =
0.1
-----
z - 1
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.1001
------
z - 1
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.05 z + 0.05
-------------
z - 1
Sample time: 0.1 seconds
Discrete-time transfer function.
sys =
1
---
s^2
Continuous-time transfer function.
ans =
0.005 z + 0.005
---------------
z^2 - 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.005003 z + 0.005003
---------------------
z^2 - 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.0025 z^2 + 0.005 z + 0.0025
-----------------------------
z^2 - 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
sys =
1
-------
s^2 + s
Continuous-time transfer function.
ans =
0.004837 z + 0.004679
----------------------
z^2 - 1.905 z + 0.9048
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.004761 z + 0.004761
----------------------
z^2 - 1.905 z + 0.9048
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.002381 z^2 + 0.004762 z + 0.002381
------------------------------------
z^2 - 1.905 z + 0.9048
Sample time: 0.1 seconds
Discrete-time transfer function.From this I see that the "matched" results are different than octavesby about 5%Doug--DAS
Would you please run this on Matlab for me ,and post the results.I am still trying to track down an error in control pkg.s=tf('s')sys=1/sc2d(sys,.1,'matched')c2d(sys,.1,'impulse')[a, b, c, d, e, stname] =ssdata(sys)sys=1/(s^2)c2d(sys,.1,'matched')c2d(sys,.1,'impulse')[a, b, c, d, e, stname] =ssdata(sys)sys=1/(s*(s+1))c2d(sys,.1,'matched')c2d(sys,.1,'impulse')[a, b, c, d, e, stname] =ssdata(sys)0.1 z
s =
s
Continuous-time transfer function.
sys =
1
-
s
Continuous-time transfer function.
ans =
0.1001
------
z - 1
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
-----
z - 1
Sample time: 0.1 seconds
Discrete-time transfer function.
Warning: Obsolete syntax. Use the "InputDelay" property to access input delays in LTI models.
> In ctrlMsgUtils.warning (line 25)
In DynamicSystem/ssdata (line 103)
a =
0
b =
1
c =
1
d =
0
e =
0
stname =
0
sys =
1
---
s^2
Continuous-time transfer function.
ans =
0.005003 z + 0.005003
---------------------
z^2 - 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.01 z + 4.441e-18
------------------
z^2 - 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
Warning: Obsolete syntax. Use the "InputDelay" property to access input delays in LTI models.
> In ctrlMsgUtils.warning (line 25)
In DynamicSystem/ssdata (line 103)
a =
0 0
1 0
b =
1
0
c =
0 1
d =
0
e =
0
stname =
0
sys =
1
-------
s^2 + s
Continuous-time transfer function.
ans =
0.004761 z + 0.004761
----------------------
z^2 - 1.905 z + 0.9048
Sample time: 0.1 seconds
Discrete-time transfer function.
ans =
0.009516 z
----------------------
z^2 - 1.905 z + 0.9048
Sample time: 0.1 seconds
Discrete-time transfer function.
Warning: Obsolete syntax. Use the "InputDelay" property to access input delays in LTI models.
> In ctrlMsgUtils.warning (line 25)
In DynamicSystem/ssdata (line 103)
a =
-1 0
1 0
b =
1
0
c =
0 1
d =
0
e =
0
stname =
0One more test the 2 values printed should be close to 1 but they areans = 10.430ans = 0.31421in octave.clears=tf('s')sys=(1/s)sys=sys*1/(s+1)[y t x]=impulse(sys,5);y(length(y))sys2=ss(sys);[ y2 t2 x2]=impulse(sys2,5);y2(length(y2))
[Prev in Thread] | Current Thread | [Next in Thread] |