- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Is there a length limitation on vectors?
Is there a length limitation on vectors?
Is there a length limitation on vectors?
Hello,
I am trying to implement a simple sinc filter for a model I am working on. The following code works for n<=19 but for higher orders it fails:
Code:
block SyncFilter
parameter Real UpdateRate = 25000.0;
parameter Integer n = 5;
extends Modelica.Blocks.Interfaces.DiscreteSISO(samplePeriod = 1.0 / (n * UpdateRate));
output Real x[n - 1] "State of transfer function from controller canonical form";
Real b[n] = ones(n) / (1.0 * n);
Real xext[n];
Real x1;
equation
when sampleTrigger then
x1 = u;
xext = vector([x1;x]);
x = xext[1:size(x, 1)];
y = vector([b]) * xext;
end when;
end SyncFilter;
With n=20, I get the following error:
Code:
"Error: Wrong type or wrong number of arguments to vector([b])'.
Any Thoughts?
Re: Is there a length limitation on vectors?
We fixed quite some bugs recently and it seems this started to work in OpenModelica.
I added a test for it so we don't break it again
http://openmodelica.org/svn/OpenModelic … cFilter.mo
http://openmodelica.org/svn/OpenModelic … Filter.mos
user: anonymous, pass: none <- write none here.
You can download the latest nightly-build from here:
http://build.openmodelica.org/omc/builds/windows/
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Is there a length limitation on vectors?