operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Beginner1
Hi,

There is an error in how Octave first simplifies and then multiplies
matrixes.
Here is my code:
/*pkg load control
pkg load io  
pkg load signal

%eig_A=eig(sys.A);
%plot(real(eig_A),imag(eig_A),"rx")
%grid on



%% se define la variable para hacer el barrido
%cycle_vector = logspace(log10(0.5),log10(2),100);
cycle_vector = linspace(0,15,15);
color_plot = colormap(jet(length(cycle_vector))); %los colores van variando
del azul al rojo


%all = axes('position',[.1,.1,.8,.8])

%% cycle (secalcula las nuevas matrices para cada valor del barrido)
for n_cycle = 1:length(cycle_vector)
  %hay que recalcular la matrz A para el barridod e la variable puede que
haya que Volver a linealizar
  kv=cycle_vector(n_cycle);
  %kv=15;
  Tv=0.05;%1;%Constante de tiempo del PI de la componente d
  kq=0.4;%Constante proporcional del PI de la componente q
  Tq=0.02;%Constante de tiempo del PI de la componente q
  kdroop_AC=0;%-3;%Pendiente droop Q/U_AC
  droop_FSM=0.05;%Pendiente droop P/f
  FSM_slope=droop_FSM/0.002;%Pendiente droop P/f en p.u.
 
  %Inner Loop
  ki=5000;%1% Constante integral de los controladores proporcional
resonantes
  kp=1.5;% Constante proporcional de los controladores proporcional
resonantes
  w=2*pi*50;
  wg0=2*pi*50.01;
  w_r=2*pi*50;
  wr=2*pi*50;
  a23 = 2*(wg0^2+wr^2);
  da23 = 4*wg0;
  a03 = (wr^2-wg0^2)^2;
  da03 = -4*wg0*(wr^2-wg0^2);
  b33 = ki;
  db33 = 0;
  b13 = ki*(wg0^2+wr^2);
  db13 = ki*2*wg0;
  c23 = -ki*wg0;
  dc23 = -ki;
  c03 = ki*wg0*(wr^2-wg0^2);
  dc03 = ki*(wr^2-3*wg0^2);
 
  %2-level VSC&Normalization block
  Vdref_perm=1.002;%1.003;
  Vqref_perm=0.085;%0.077;
  Vdc_diff_perm=0.5;%0.492;
  kdiff=(0.7)*Vdc_diff_perm;%Según DIgilent debería ser multiplicada por 1.4
en vez de 0.7
  K_0=sqrt(3)/(2*sqrt(2));%Factor de modulación sinusoidal del VSC
  Ub_DC=640/2;%Tensión base en DC del VSC-Según DIgilent debería ser 640 en
vez de 640/2
  Ub_AC=275;%Tensión base en AC del VSC
  k0=(K_0)*Ub_DC/Ub_AC;
  Vdc_perm=1.001;%1.017;
  Pmd_perm=0.702;%0.702;%0.69;
  Pmq_perm=0;%0.053;
  Kvsc=k0*Vdc_perm;
 
  x1d_0= 0;
  x1q_0= 0;
  x2d_0=0;
  x2q_0=0;
  x3d_0=0;
  x3q_0=0;
  x4d_0=0;
  x4q_0=0;
 
%Función enable: para marcar la activación de la rama FSM
  enable=0;
 
%Definición de matrices A,B,C y D
 
  %Outer loop:Vdc-Q
 
  A_ol=[0 0;0 0];
  B_ol=[-kv/Tv kv/Tv 0 0 0 0 -kv*FSM_slope*enable/Tv kv*enable/Tv
-kv*enable/Tv kv*enable/Tv;0 0 kq/Tq -kq/Tq -(kq/Tq)*kdroop_AC
(kq/Tq)*kdroop_AC 0 0 0 0];
  C_ol=[1 0;0 1];
  D_ol=[-kv kv 0 0 0 0 -kv*FSM_slope*enable kv*enable -kv*enable kv*enable;0
0 kq -kq -kq*kdroop_AC kq*kdroop_AC 0 0 0 0];
 

  %Inner loop:PR current controller

  A_il=[0 1 0 0 0 0 0 0; 0 0 1 0 0 0 0 0;0 0 0 1 0 0 0 0; -(w^2-wg0^2) 0
-4*w^2 0 0 0 0 0;0 0 0 0 0 1 0 0;0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 1;0 0 0 0
-(w^2-wg0^2) 0 -4*w^2 0];
  B_il=[0 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 -1 0 1 0 -4*w*x3d_0;0
0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 -1 0 1 -4*w*x3q_0];
  C_il=[0 2*ki*w^2 0 ki 0 0 ki*w 0; 0 0 -ki*w 0 0 2*ki*w^2 0 ki];
  D_il=[1 0 -kp 0 kp 0 ki*(2*w*x2d_0+x3q_0+2*w^2*x1q_0); 0 1 0 -kp 0 kp
ki*(2*w*x2q_0-2*w^2*x1d_0-x3d_0)];

  %Normalization block
  D_nb=[kdiff 0 (0.7)*Vdref_perm;0 kdiff (0.7)*Vqref_perm];%Según DIgilent
debería ser multiplicada por 1.4 en vez de 0.7

  %2-level VSC:controlled voltage source-average model
  D_vsc=[k0*Vdc_perm 0 k0*Pmd_perm;0 k0*Vdc_perm k0*Pmq_perm];
 
  %Outer loop
  stname_ol = {'xv','xq'};
 
inname_ol={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos'};
  outname_ol={'idref','iqref'};
  sys_ol = ss
(A_ol,B_ol,C_ol,D_ol,'stname',stname_ol,'inname',inname_ol,'outname',outname_ol);
 
  %Inner loop
  stname_il = {'xd1','xd2','xd3','xd4','xq1','xq2','xq3','xq4'};
  inname_il={'Vd','Vq','Id','Iq','idref','iqref','omegagiro'};
  outname_il={'Vdref','Vqref'};
  sys_il = ss
(A_il,B_il,C_il,D_il,'stname',stname_il,'inname',inname_il,'outname',outname_il);
 
  %Normalization block
  inname_nb={'Vdref','Vqref','Vdcdiff'};
  %inname_nb={'Vdref','Vqref'};
  outname_nb={'Pmd','Pmq'};
  sys_nb = ss (D_nb,'inname',inname_nb,'outname',outname_nb);
 
  %2-level VSC
  inname_vsc={'Pmd','Pmq','vdc'};
  outname_vsc={'Vd_AC','Vq_AC'};
  sys_vsc = ss (D_vsc,'inname',inname_vsc,'outname',outname_vsc);
 
  %Assembled system1
 
inname_group={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos','Vd','Vq','Id','Iq','omegagiro','Vdcdiff'};
 
%inname_group={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos','Vd','Vq','Id','Iq'};
 
outname_group={'idref','iqref','Vdref','Vqref','Pmd','Pmq','Vd_AC','Vq_AC'};
  sys=connect(sys_ol,sys_il,sys_nb,sys_vsc,inname_group,outname_group);
  B=sys.B;
  K_cl=ones(16,9);
  Aol=sys.A;
  Acl=Aol+B*K_cl;
   
    end*/

You can copy and paste this code and see what hapens afterwads. The error I
get is
error: rrr: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)
error: called from
    rrr at line 131 column 6

But what is important in this message is the last part of the code, that
refers to the sum of matrixes:
/*  B=sys.B;
  K_cl=ones(16,9);
  Aol=sys.A;
  Acl=Aol+B*K_cl;*/

The dimension problem should be solved by making K_cl equal to ones(16,10).
But when I do this, and run the code, the console reports again a new
dimension problem:
error: rrr: operator +: nonconformant arguments (op1 is 9x9, op2 is 9x10)
error: called from
    rrr at line 131 column 6

So Octave must be simplifying matrixes since they are plenty of zeros and
this does not allow to perform the sum of them as they cannot coincide in
dimension.

Any suggestion to avoid the simplification of matrixes in Octave?





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Mike Miller-4
On Wed, Aug 08, 2018 at 11:10:58 -0500, Beginner1 wrote:
> The dimension problem should be solved by making K_cl equal to ones(16,10).
> But when I do this, and run the code, the console reports again a new
> dimension problem:
> error: rrr: operator +: nonconformant arguments (op1 is 9x9, op2 is 9x10)
> error: called from
>     rrr at line 131 column 6

The original error was on the second iteration of your cycle_vector
loop. The new error is on the first iteration of the loop.

> So Octave must be simplifying matrixes since they are plenty of zeros and
> this does not allow to perform the sum of them as they cannot coincide in
> dimension.
>
> Any suggestion to avoid the simplification of matrixes in Octave?

I think your real question should be: why do sys.A and sys.B have 9 rows
in the first iteration of your loop, and 10 rows in the second and
subsequent iterations?

Maybe you can inspect the construction of your system in more detail and
see if there is a problem there.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Beginner1
That's the problem I am pointing out in octave. Octave simplifies the matrix
by removing rows if the row is entirely zero. And this does not allow me to
make the sum or multiplication of matrixes since they do not coincide in
dimensions because of this simplification.





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Mike Miller-4
On Thu, Aug 09, 2018 at 08:42:14 -0500, Beginner1 wrote:
> That's the problem I am pointing out in octave. Octave simplifies the matrix
> by removing rows if the row is entirely zero. And this does not allow me to
> make the sum or multiplication of matrixes since they do not coincide in
> dimensions because of this simplification.

Octave does not do this in general.

If you are right, that the A and B matrix should have 10 rows instead of
9 for this specific system, then it may be a bug in the control package.
If you want to help improve Octave, please file a bug report at

  https://savannah.gnu.org/bugs/?func=additem&group=octave

with the specifics of how the system is created, what you get, and what
you expect the result to be instead.

If you don't want to help improve Octave, then there are many ways to
pad the array with zeros to account for this in your own script.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Doug Stewart-4


On Thu, Aug 9, 2018 at 11:55 AM, Mike Miller <[hidden email]> wrote:
On Thu, Aug 09, 2018 at 08:42:14 -0500, Beginner1 wrote:
> That's the problem I am pointing out in octave. Octave simplifies the matrix
> by removing rows if the row is entirely zero. And this does not allow me to
> make the sum or multiplication of matrixes since they do not coincide in
> dimensions because of this simplification.

Octave does not do this in general.

If you are right, that the A and B matrix should have 10 rows instead of
9 for this specific system, then it may be a bug in the control package.
If you want to help improve Octave, please file a bug report at

  https://savannah.gnu.org/bugs/?func=additem&group=octave

with the specifics of how the system is created, what you get, and what
you expect the result to be instead.

If you don't want to help improve Octave, then there are many ways to
pad the array with zeros to account for this in your own script.

--
mike




Mike I  am trying to solve this problem, but???

I changed the last line to be
 Acl=sys.A + sys.B*ones(16,9);

now if I run it  it says sys.A is 10x10
 but if I change the last line to

 Acl=sys.A + sys.B*ones(16,10); 

It now says sys.A is 9x9

how can changing the dimensions of the ones command change 
an already stored data in sys?




--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Mike Miller-4
On Thu, Aug 09, 2018 at 12:03:38 -0400, Doug Stewart wrote:

> Mike I  am trying to solve this problem, but???
>
> I changed the last line to be
>  Acl=sys.A + sys.B*ones(16,9);
>
> now if I run it  it says sys.A is 10x10
>  but if I change the last line to
>
>  Acl=sys.A + sys.B*ones(16,10);
>
> It now says sys.A is 9x9
>
> how can changing the dimensions of the ones command change
> an already stored data in sys?
If you are running the OP's script, it's because you are looking at two
different iterations of the loop.

When n_cycle is 1, the system has A and B matrices with 9 rows. When
n_cycle is 2 or greater, the system has A and B matrices with 10 rows.

You'll have to look into how the system is created differently on each
iteration through the loop.

At a glance, it looks to me like almost everything is constant except
for the variable kv.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Doug Stewart-4


On Thu, Aug 9, 2018 at 12:46 PM, Mike Miller <[hidden email]> wrote:
On Thu, Aug 09, 2018 at 12:03:38 -0400, Doug Stewart wrote:
> Mike I  am trying to solve this problem, but???
>
> I changed the last line to be
>  Acl=sys.A + sys.B*ones(16,9);
>
> now if I run it  it says sys.A is 10x10
>  but if I change the last line to
>
>  Acl=sys.A + sys.B*ones(16,10);
>
> It now says sys.A is 9x9
>
> how can changing the dimensions of the ones command change
> an already stored data in sys?

If you are running the OP's script, it's because you are looking at two
different iterations of the loop.

When n_cycle is 1, the system has A and B matrices with 9 rows. When
n_cycle is 2 or greater, the system has A and B matrices with 10 rows.

You'll have to look into how the system is created differently on each
iteration through the loop.

At a glance, it looks to me like almost everything is constant except
for the variable kv.

--
mike



Thanks Mike.


--
DAS



Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Doug Stewart-4
In reply to this post by Beginner1


On Wed, Aug 8, 2018 at 12:10 PM, Beginner1 <[hidden email]> wrote:
Hi,

There is an error in how Octave first simplifies and then multiplies
matrixes.
Here is my code:
/*pkg load control
pkg load io 
pkg load signal

%eig_A=eig(sys.A);
%plot(real(eig_A),imag(eig_A),"rx")
%grid on



%% se define la variable para hacer el barrido
%cycle_vector = logspace(log10(0.5),log10(2),100);
cycle_vector = linspace(0,15,15);
color_plot = colormap(jet(length(cycle_vector))); %los colores van variando
del azul al rojo


%all = axes('position',[.1,.1,.8,.8])

%% cycle (secalcula las nuevas matrices para cada valor del barrido)
for n_cycle = 1:length(cycle_vector)
  %hay que recalcular la matrz A para el barridod e la variable puede que
haya que Volver a linealizar
  kv=cycle_vector(n_cycle);
  %kv=15;
  Tv=0.05;%1;%Constante de tiempo del PI de la componente d
  kq=0.4;%Constante proporcional del PI de la componente q
  Tq=0.02;%Constante de tiempo del PI de la componente q
  kdroop_AC=0;%-3;%Pendiente droop Q/U_AC
  droop_FSM=0.05;%Pendiente droop P/f
  FSM_slope=droop_FSM/0.002;%Pendiente droop P/f en p.u.

  %Inner Loop
  ki=5000;%1% Constante integral de los controladores proporcional
resonantes
  kp=1.5;% Constante proporcional de los controladores proporcional
resonantes
  w=2*pi*50;
  wg0=2*pi*50.01;
  w_r=2*pi*50;
  wr=2*pi*50;
  a23 = 2*(wg0^2+wr^2);
  da23 = 4*wg0;
  a03 = (wr^2-wg0^2)^2;
  da03 = -4*wg0*(wr^2-wg0^2);
  b33 = ki;
  db33 = 0;
  b13 = ki*(wg0^2+wr^2);
  db13 = ki*2*wg0;
  c23 = -ki*wg0;
  dc23 = -ki;
  c03 = ki*wg0*(wr^2-wg0^2);
  dc03 = ki*(wr^2-3*wg0^2);

  %2-level VSC&Normalization block
  Vdref_perm=1.002;%1.003;
  Vqref_perm=0.085;%0.077;
  Vdc_diff_perm=0.5;%0.492;
  kdiff=(0.7)*Vdc_diff_perm;%Según DIgilent debería ser multiplicada por 1.4
en vez de 0.7
  K_0=sqrt(3)/(2*sqrt(2));%Factor de modulación sinusoidal del VSC
  Ub_DC=640/2;%Tensión base en DC del VSC-Según DIgilent debería ser 640 en
vez de 640/2
  Ub_AC=275;%Tensión base en AC del VSC
  k0=(K_0)*Ub_DC/Ub_AC;
  Vdc_perm=1.001;%1.017;
  Pmd_perm=0.702;%0.702;%0.69;
  Pmq_perm=0;%0.053;
  Kvsc=k0*Vdc_perm;

  x1d_0= 0;
  x1q_0= 0;
  x2d_0=0;
  x2q_0=0;
  x3d_0=0;
  x3q_0=0;
  x4d_0=0;
  x4q_0=0;

%Función enable: para marcar la activación de la rama FSM
  enable=0;

%Definición de matrices A,B,C y D

  %Outer loop:Vdc-Q

  A_ol=[0 0;0 0];
  B_ol=[-kv/Tv kv/Tv 0 0 0 0 -kv*FSM_slope*enable/Tv kv*enable/Tv
-kv*enable/Tv kv*enable/Tv;0 0 kq/Tq -kq/Tq -(kq/Tq)*kdroop_AC
(kq/Tq)*kdroop_AC 0 0 0 0];
  C_ol=[1 0;0 1];
  D_ol=[-kv kv 0 0 0 0 -kv*FSM_slope*enable kv*enable -kv*enable kv*enable;0
0 kq -kq -kq*kdroop_AC kq*kdroop_AC 0 0 0 0];


  %Inner loop:PR current controller

  A_il=[0 1 0 0 0 0 0 0; 0 0 1 0 0 0 0 0;0 0 0 1 0 0 0 0; -(w^2-wg0^2) 0
-4*w^2 0 0 0 0 0;0 0 0 0 0 1 0 0;0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 1;0 0 0 0
-(w^2-wg0^2) 0 -4*w^2 0];
  B_il=[0 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 -1 0 1 0 -4*w*x3d_0;0
0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 -1 0 1 -4*w*x3q_0];
  C_il=[0 2*ki*w^2 0 ki 0 0 ki*w 0; 0 0 -ki*w 0 0 2*ki*w^2 0 ki];
  D_il=[1 0 -kp 0 kp 0 ki*(2*w*x2d_0+x3q_0+2*w^2*x1q_0); 0 1 0 -kp 0 kp
ki*(2*w*x2q_0-2*w^2*x1d_0-x3d_0)];

  %Normalization block
  D_nb=[kdiff 0 (0.7)*Vdref_perm;0 kdiff (0.7)*Vqref_perm];%Según DIgilent
debería ser multiplicada por 1.4 en vez de 0.7

  %2-level VSC:controlled voltage source-average model
  D_vsc=[k0*Vdc_perm 0 k0*Pmd_perm;0 k0*Vdc_perm k0*Pmq_perm];

  %Outer loop
  stname_ol = {'xv','xq'};

inname_ol={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos'};
  outname_ol={'idref','iqref'};
  sys_ol = ss
(A_ol,B_ol,C_ol,D_ol,'stname',stname_ol,'inname',inname_ol,'outname',outname_ol);

  %Inner loop
  stname_il = {'xd1','xd2','xd3','xd4','xq1','xq2','xq3','xq4'};
  inname_il={'Vd','Vq','Id','Iq','idref','iqref','omegagiro'};
  outname_il={'Vdref','Vqref'};
  sys_il = ss
(A_il,B_il,C_il,D_il,'stname',stname_il,'inname',inname_il,'outname',outname_il);

  %Normalization block
  inname_nb={'Vdref','Vqref','Vdcdiff'};
  %inname_nb={'Vdref','Vqref'};
  outname_nb={'Pmd','Pmq'};
  sys_nb = ss (D_nb,'inname',inname_nb,'outname',outname_nb);

  %2-level VSC
  inname_vsc={'Pmd','Pmq','vdc'};
  outname_vsc={'Vd_AC','Vq_AC'};
  sys_vsc = ss (D_vsc,'inname',inname_vsc,'outname',outname_vsc);

  %Assembled system1

inname_group={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos','Vd','Vq','Id','Iq','omegagiro','Vdcdiff'};

%inname_group={'vdcref','vdc','qacref','qac','vacref','vac','fmeas','pdcref','paux','FSMcoordpos','Vd','Vq','Id','Iq'};

outname_group={'idref','iqref','Vdref','Vqref','Pmd','Pmq','Vd_AC','Vq_AC'};
  sys=connect(sys_ol,sys_il,sys_nb,sys_vsc,inname_group,outname_group);
  B=sys.B;
  K_cl=ones(16,9);
  Aol=sys.A;
  Acl=Aol+B*K_cl;

    end*/

You can copy and paste this code and see what hapens afterwads. The error I
get is
error: rrr: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)
error: called from
    rrr at line 131 column 6

But what is important in this message is the last part of the code, that
refers to the sum of matrixes:
/*  B=sys.B;
  K_cl=ones(16,9);
  Aol=sys.A;
  Acl=Aol+B*K_cl;*/

The dimension problem should be solved by making K_cl equal to ones(16,10).
But when I do this, and run the code, the console reports again a new
dimension problem:
error: rrr: operator +: nonconformant arguments (op1 is 9x9, op2 is 9x10)
error: called from
    rrr at line 131 column 6

So Octave must be simplifying matrixes since they are plenty of zeros and
this does not allow to perform the sum of them as they cannot coincide in
dimension.

Any suggestion to avoid the simplification of matrixes in Octave?





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



I modified the end of your file to:

 n_cycle
 if (n_cycle ==1)
    Acl=sys.A + sys.B*ones(16,9);
 else
     Acl=sys.A + sys.B*ones(16,10);
  endif

now it runs 15 times.
What this shows is that the first tome through you have a 9x9
and after that you have 10x10  sys.A

I don't know what you are trying to do so can't help much more.



--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Mike Miller-4
On Thu, Aug 09, 2018 at 13:09:45 -0400, Doug Stewart wrote:

> I modified the end of your file to:
>
>  n_cycle
>  if (n_cycle ==1)
>     Acl=sys.A + sys.B*ones(16,9);
>  else
>      Acl=sys.A + sys.B*ones(16,10);
>   endif
>
> now it runs 15 times.
> What this shows is that the first tome through you have a 9x9
> and after that you have 10x10  sys.A
Yes, that is one obvious workaround. I thought you were interested in
investigating why that is.

I think Beginner1 is attempting to claim that sys.A should always be
10×10, and sys.B should always be 10×16, and that there is a bug in here
somewhere. I don't yet know whether that is true.

That's why I asked for a bug report, we need a concise explanation of
what is passed in, what is returned, and how that differs from what is
expected.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Doug Stewart-4


On Thu, Aug 9, 2018 at 1:53 PM, Mike Miller <[hidden email]> wrote:
On Thu, Aug 09, 2018 at 13:09:45 -0400, Doug Stewart wrote:
> I modified the end of your file to:
>
>  n_cycle
>  if (n_cycle ==1)
>     Acl=sys.A + sys.B*ones(16,9);
>  else
>      Acl=sys.A + sys.B*ones(16,10);
>   endif
>
> now it runs 15 times.
> What this shows is that the first tome through you have a 9x9
> and after that you have 10x10  sys.A

Yes, that is one obvious workaround. I thought you were interested in
investigating why that is.

I think Beginner1 is attempting to claim that sys.A should always be
10×10, and sys.B should always be 10×16, and that there is a bug in here
somewhere. I don't yet know whether that is true.

That's why I asked for a bug report, we need a concise explanation of
what is passed in, what is returned, and how that differs from what is
expected.

--
mike






I have figured out what is happening.

The loop uses kv from 0 to 15

the code  forms:
sys_ol
sys_il
sys_nb
sys_vsc

The code then uses the connect comand
sys=connect(sys_ol,sys_il,sys_nb,sys_vsc,inname_group,outname_group);

to connect them all together into one big sys.

On the 1st pas kv=0
and this makes one row all zeroes, and connect then eliminates that row!!!!

if we set the 15 voltages to not start at 0 but close to zero then all works as expected.

cycle_vector = linspace(0.0000001,15,15);
you probably want
cycle_vector = linspace(0.0000001,15,16);

That is a work around that will get you going.

We will have to look at connect and see why it is dropping the 0 vector.


Doug


--
DAS



Reply | Threaded
Open this post in threaded view
|

Re: operator +: nonconformant arguments (op1 is 10x10, op2 is 10x9)

Doug Stewart-4


On Thu, Aug 9, 2018 at 8:31 PM, Doug Stewart <[hidden email]> wrote:


On Thu, Aug 9, 2018 at 1:53 PM, Mike Miller <[hidden email]> wrote:
On Thu, Aug 09, 2018 at 13:09:45 -0400, Doug Stewart wrote:
> I modified the end of your file to:
>
>  n_cycle
>  if (n_cycle ==1)
>     Acl=sys.A + sys.B*ones(16,9);
>  else
>      Acl=sys.A + sys.B*ones(16,10);
>   endif
>
> now it runs 15 times.
> What this shows is that the first tome through you have a 9x9
> and after that you have 10x10  sys.A

Yes, that is one obvious workaround. I thought you were interested in
investigating why that is.

I think Beginner1 is attempting to claim that sys.A should always be
10×10, and sys.B should always be 10×16, and that there is a bug in here
somewhere. I don't yet know whether that is true.

That's why I asked for a bug report, we need a concise explanation of
what is passed in, what is returned, and how that differs from what is
expected.

--
mike






I have figured out what is happening.

The loop uses kv from 0 to 15

the code  forms:
sys_ol
sys_il
sys_nb
sys_vsc

The code then uses the connect comand
sys=connect(sys_ol,sys_il,sys_nb,sys_vsc,inname_group,outname_group);

to connect them all together into one big sys.

On the 1st pas kv=0
and this makes one row all zeroes, and connect then eliminates that row!!!!

if we set the 15 voltages to not start at 0 but close to zero then all works as expected.

cycle_vector = linspace(0.0000001,15,15);
you probably want
cycle_vector = linspace(0.0000001,15,16);

That is a work around that will get you going.

We will have to look at connect and see why it is dropping the 0 vector.


Doug


--
DAS




Before I spend time looking at connect, I would like to know what matlab does.

would someone with matlab run the attached code and see if there is a size mismatch reported,please.





--
DAS




test444124.m (6K) Download Attachment