Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Matrix sum

Subject: Matrix sum

From: Milos Milenkovic

Date: 27 Feb, 2013 19:42:08

Message: 1 of 3

Dear,
how to generate matrix A[4,4] which is defined as the B0(j,b)*Ke1(a,b)*B1(i,a)+B0(j,b)*Ke1(a,b)*Delta1(i,a)+Delta0(j,b)*Ke1(a,b)*B1(i,a):
Delta1=sym('Delta1%d%d', [4,4]);
Delta0=sym('Delta0%d%d', [4,4]);
Inputs are:
K1=[-0.2582 -18.596 0 -0.2582; -34.737 -1300.188 0 -34.737; 0 0 0 0; -0.2582 -18.596 0 -0.2582];
K0=[2.337 48.551 0 2.337; 48.551 3072.487 0 48.551; 0 0 0 0; 2.337 48.551 0 2.337];
B1=[0.01 0.02 0.07 0.03; 0.02 0.05 0.06 0.02; 0.07 0.09 0.01 0.03; 0.01 0.03 0.02 0.04];
B0=[-1 0 0 0; 0 -1 0 0 ; 0 0 -1 0; 0 0 0 -1];
Ke1=[-785 -29351 2 -785; 758 28831 5 758; 72 2623 6 72; -382 -14175 2 -382];

Trial is:

   for i=1:4
      for j=1:4
      A=0;
           A=zeros(i,j);
            for b=1:4
                for a=1:4
                                    A=A+B0(j,b)*Ke1(a,b)*B1(i,a)+B0(j,b)*Ke1(a,b)*Delta1(i,a)+Delta0(j,b)*Ke1(a,b)*B1(i,a)
                end
            end
       end
    end
end

the output for cell 1,1 of matrix A is:
(89*Delta011)/100 + (4147*Delta012)/100 + (3*Delta013)/5 + (89*Delta014)/100 + 785*Delta111 - 758*Delta112 - 72*Delta113 + 382*Delta114 - 89/100

Subject: Matrix sum

From: Bruno Luong

Date: 28 Feb, 2013 07:47:07

Message: 2 of 3

FYI the matrix A you compute is simply sum of three matrix products:

B1*Ke1*B0.' + Delta1*Ke1*B0.' + B1*Ke1*Delta0.'

or

B1*Ke1*(B0+Delta0).' + Delta1*Ke1*B0.'


% Bruno

Subject: Matrix sum

From: Milos Milenkovic

Date: 5 Mar, 2013 21:36:08

Message: 3 of 3

Thanks Bruno,
sorry for late replay.
Best

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kgn21r$nqc$1@newscl01ah.mathworks.com>...
> FYI the matrix A you compute is simply sum of three matrix products:
>
> B1*Ke1*B0.' + Delta1*Ke1*B0.' + B1*Ke1*Delta0.'
>
> or
>
> B1*Ke1*(B0+Delta0).' + Delta1*Ke1*B0.'
>
>
> % Bruno

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us