From: <par...@us...> - 2012-09-16 07:35:12
|
Revision: 11034 http://octave.svn.sourceforge.net/octave/?rev=11034&view=rev Author: paramaniac Date: 2012-09-16 07:35:06 +0000 (Sun, 16 Sep 2012) Log Message: ----------- control: minor touch up in draft code Modified Paths: -------------- trunk/octave-forge/main/control/devel/__time_response_2__.m Modified: trunk/octave-forge/main/control/devel/__time_response_2__.m =================================================================== --- trunk/octave-forge/main/control/devel/__time_response_2__.m 2012-09-16 07:31:08 UTC (rev 11033) +++ trunk/octave-forge/main/control/devel/__time_response_2__.m 2012-09-16 07:35:06 UTC (rev 11034) @@ -23,7 +23,7 @@ ## Version: 0.3 % function [y, t, x_arr] = __time_response_2__ (sys, resptype, plotflag, tfinal, dt, x0, sysname) -function [y, t, x_arr] = __time_response_2__ (resptype, args) +function [y, t, x] = __time_response_2__ (resptype, args) sys_idx = cellfun (@isa, args, {"lti"}); # look for LTI models sys_cell = cellfun (@ss, args(sys_idx)); # system must be proper @@ -96,8 +96,26 @@ ## time vector t = reshape (0 : dt : tfinal, [], 1); l_t = length (t); -%} +%} +%function [y, x_arr] = __initial_response__ (sys, sys_dt, t, x0) +%function [y, x_arr] = __step_response__ (sys_dt, t) +%function [y, x_arr] = __impulse_response__ (sys, sys_dt, t) + + switch (resptype) + case "initial" + [y, x] = cellfun (@__initial_response__, sys_cell, sys_dt_cell, t, {x0} or x0); + case "step" + [y, x] = cellfun (@__step_response__, sys_dt_cell, t); + case "impulse" + [y, x] = cellfun (@__impulse_response__, sys_cell, sys_dt_cell, t); + otherwise + error ("time_response: invalid response type"); + endswitch + + + + if (plotflag) # display plot switch (resptype) case "initial" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |