4
$\begingroup$

Bug introduced in 10.0.1 and persisting through 10.2 or later


I have same code that works in version 9.0.1, but not in version 10.0.1.0 (according to @Sektor, it works in 10.0.0.0, too).

in = UnitStep[t - 20] - UnitStep[t - 75];
tMax = 100;
time = {t, 0, tMax};

thisWc = TransferFunctionModel[{{{0.9 (1 + 19 s)}}, 19 s}, s]

Wp23 = TransferFunctionModel[{{{E^((-2) s)}}, (1 + 2 s)^5}, s]

out = OutputResponse[
  SystemsModelFeedbackConnect[
   SystemsModelSeriesConnect[thisWc, Wp23]], in, time]

One can approximate the TF in v10 with (thanks to @Nasser):

Wp23Approx = SystemsModelDelayApproximate[Wp23]

outApprox = 
 OutputResponse[
  SystemsModelFeedbackConnect[
   SystemsModelSeriesConnect[thisWc, Wp23Approx]], in, time]

Then the Error changes from

NestList::intnm: Non-negative machine-sized integer expected at position 3 in NestList[#1/. Control`RecastDEquationsDump`xx$_[t+Optional[Pattern[<<2>>]]]:>Control`RecastDEquationsDump`xx$[t+Control`RecastDEquationsDump`nn0$+1]&,Control`RecastDEquationsDump`y$615011[t]->Control`RecastDEquationsDump`stVar$6154[t]+Control`RecastDEquationsDump`cst$6156 Subscript[\[FormalU], 1][t],2.]. >> ....

to

NDSolve::ndsz: At t == 20.00000000000057`, step size is effectively zero; singularity or stiff system suspected. >>

Surprisingly in v9 (and 10.0.0.0) both ways give the same result: enter image description here

Edit: I'm using Win7 64bit

$\endgroup$
9
  • $\begingroup$ I get the same error-free output executing this code @ 9.0.1.0 and @ 10.0.0.0. Try starting a clean kernel. $\endgroup$
    – Sektor
    Commented Feb 5, 2015 at 11:01
  • $\begingroup$ @Sektor Unfortunately, evaluating this code on a new (empty) notebook with new started kernel, I still get the errors. I'm using v10.0.1.0 $\endgroup$
    – Phab
    Commented Feb 5, 2015 at 11:42
  • $\begingroup$ What is your OS ? We should wait for others to confirm before filing a bug report. $\endgroup$
    – Sektor
    Commented Feb 5, 2015 at 11:52
  • $\begingroup$ I'm working with Mma 10.0.1.0 and Windows 7 (64bit) $\endgroup$
    – Phab
    Commented Feb 5, 2015 at 12:02
  • 2
    $\begingroup$ Doesn't work in 10.0.2 under Windows. I vote for "bug." $\endgroup$
    – Mr.Wizard
    Commented Feb 5, 2015 at 13:48

1 Answer 1

1
$\begingroup$

You can get output if you first approximate your system. You have a delayed control system there due to the E^(-2) in the numerator of the wp23 transfer function. So use this below. In addition, asking for Minimal state model allows you to solve for this specific input you have

ClearAll[t, s];
in = 2 UnitStep[t - 20] - UnitStep[t - 500];
tMax = 100;
time = {t, 0, tMax};
wp23 = TransferFunctionModel[{{{E^((-2) s)}}, (1 + 2 s)^5}, s];
wp23 = SystemsModelDelayApproximate[wp23];
thisWcA = TransferFunctionModel[{{{0.8908858730832925 (1 + 19.096 s)}}, 19.096 s}, s];
tf = SystemsModelSeriesConnect[thisWcA, wp23];
tf = SystemsModelFeedbackConnect[tf];
ss = MinimalStateSpaceModel@StateSpaceModel@tf;
out = First@OutputResponse[ss, in, time];
Plot[out /. t -> i, {i, 0, tMax}, PlotRange -> All]

Mathematica graphics

See DelayControlSystems.html for more information on delay control systems and SystemsModelDelayApproximate

$\endgroup$
5
  • $\begingroup$ Ok, well, but in this old notebook I could evaluate exactly this code. Even with this input. @Sektor could do an error-free executing of this code, too. $\endgroup$
    – Phab
    Commented Feb 5, 2015 at 11:54
  • $\begingroup$ @Phab In version 10, your code produces error. The above fix removes the error. I do not know why it worked in version 9. May be they fixed something and it should not have worked in V 9. I do not know. You asked to make it work in V10. $\endgroup$
    – Nasser
    Commented Feb 5, 2015 at 11:58
  • $\begingroup$ Sorry, you're right. But what could i do with this workaround, if I can't see it with the input signal I want? ... but v9 does. $\endgroup$
    – Phab
    Commented Feb 5, 2015 at 12:37
  • $\begingroup$ @Phab as I said, with your specific input, the delayed unit step, the error is not related to the invalid TF. It is due to system being stiff with this specific input. The error now is At t == 20.00000000000057, step size is effectively zero; singularity or stiff system suspected. >> So this is a separate issue, not related to original error about invalid TF. There can be other work around this now. But I did it pursue this, since I do not think it is related to your original error. $\endgroup$
    – Nasser
    Commented Feb 5, 2015 at 12:46
  • $\begingroup$ I tried to get a response of the approximated TF in v9, there it works fine. So your answer pushed my problem one step further, but didn't solve it. ... I'll edit the question acordingly. $\endgroup$
    – Phab
    Commented Feb 5, 2015 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.