help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lsim() trims time vector in an odd fashion


From: Lukas Reichlin
Subject: Re: lsim() trims time vector in an odd fashion
Date: Sun, 30 Nov 2014 17:00:06 +0100

> On 27.11.2014, at 03:19, Lukas Reichlin <address@hidden> wrote:
> 
> 
>> On 23.11.2014, at 18:28, rocketsound <address@hidden> wrote:
>> 
>> Yes, I get the same results. I noticed this approach works only if the system
>> supplied to lsim is discrete (i.e. if I replace discreteSystemZOH with
>> continousSystem in my example code it wont work and I get "invalid time
>> vector") but I guess this behaviour is correct.
> 
> For continuous-time models, try passing a scalar sampling time "t_sam" 
> instead of a time vector "t_vec".
> 
> [y_out, t_out, x_out] = lsim (sys, u_vec, t_sam, x_0)
> 
> where
> 
> t_sam = t_vec(2) - t_vec(1)
> 

BTW: The problem is caused by the for-loop on line 10 of your script.
Use t_vec = (0 : h : 10).' to define the time vector, see the comment in the 
script.


Attachment: lutzmager.m
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]