> with(linalg):
Warning, the protected names norm and trace have been redefined and
unprotected

> Matrix_d:= matrix(1,4,[d[1],d[2],d[3],d[4]]);

              Matrix_d := [d[1]    d[2]    d[3]    d[4]]

> J:= multiply(transpose(Matrix_d),S*Matrix_d):  K:= Int(evalm(J),x);

          / [      2                                          ]
         |  [S d[1]  , d[1] S d[2] , d[1] S d[3] , d[1] S d[4]]
         |  [                                                 ]
         |  [                    2                            ]
         |  [d[1] S d[2] , S d[2]  , d[2] S d[3] , d[2] S d[4]]
   K :=  |  [                                                 ] dx
         |  [                                  2              ]
         |  [d[1] S d[3] , d[2] S d[3] , S d[3]  , d[3] S d[4]]
         |  [                                                 ]
         |  [                                                2]
        /   [d[1] S d[4] , d[2] S d[4] , d[3] S d[4] , S d[4] ]

# Die kubischen "shape functions" knnen 3.1.24 entnommen werden.Aus
# ihren ersten Ableitungen erhlt man die Matrix d: 
> N[1]:=x-> 1- 11*x/2+9*x^2-9*x^3/2;  d[1]:= x-> - 11/2+18*x -27*x^2/2; 

                                            2        3
               N[1] := x -> 1 - 11/2 x + 9 x  - 9/2 x


                                                    2
                 d[1] := x -> - 11/2 + 18 x - 27/2 x

> N[2]:= x-> 9*x-45*x^2/2+27*x^3/2;       d[2]:= x-> 9 -  45*x +
> 81*x^2/2; 

                                          2         3
                 N[2] := x -> 9 x - 45/2 x  + 27/2 x


                                                 2
                   d[2] := x -> 9 - 45 x + 81/2 x

>  N[3]:= x-> -9*x/2+18*x^2-27*x^3/2;   d[3]:= x-> - 9/2+36*x -
> 81*x^2/2; 

                                          2         3
                N[3] := x -> -9/2 x + 18 x  - 27/2 x


                                                   2
                 d[3] := x -> - 9/2 + 36 x - 81/2 x

>  N[4]:= x-> x - 9*x^2/2+9*x^3/2;   d[4]:= x-> 1-9*x +27*x^2/2; 

                                         2        3
                   N[4] := x -> x - 9/2 x  + 9/2 x


                                                 2
                    d[4] := x -> 1 - 9 x + 27/2 x

# Die Summe S ist  folgendermaen definiert:
> S:= x->N[1]*y[1] + N[2]*y[2] + N[3]*y[3] + N[4]*y[4];

       S := x -> N[1] y[1] + N[2] y[2] + N[3] y[3] + N[4] y[4]

# Unter Bercksichtigung der Randbedingugen y1 = y(0) = 1 und y4 =y(1) =
# 0 wird: 
> S := x-> 1- 11*x/2+9*x^2 - 9*x^3/2 + (9*x-45*x^2/2+27*x^3/2)*y[2] +
> (-9*x/2+18*x^2-27*x^3/2)*y[3];;

                            2        3
  S := x -> 1 - 11/2 x + 9 x  - 9/2 x

                        2         3
         + (9 x - 45/2 x  + 27/2 x ) y[2]

                         2         3
         + (-9/2 x + 18 x  - 27/2 x ) y[3]

# Die "Steifigkeitsmatrix"  [K] ergibt sich zu:
> p := map(int,J(x),x = 0..1):   K:= (1/2240)*evalm(2240*p);

  K := 1/2240

        [4795 + 4539 y[2] - 1455 y[3] , -6753 - 4131 y[2] + 1053 y[3]

        , 2481 - 567 y[2] + 243 y[3] , -523 + 159 y[2] + 159 y[3]]

        [-6753 - 4131 y[2] + 1053 y[3] , 9585 + 8505 y[2] + 4131 y[3]

        , -3699 - 4617 y[2] - 4617 y[3] , 867 + 243 y[2] - 567 y[3]]

        [2481 - 567 y[2] + 243 y[3] , -3699 - 4617 y[2] - 4617 y[3] ,

        1971 + 4131 y[2] + 8505 y[3] , -753 + 1053 y[2] - 4131 y[3]]

        [-523 + 159 y[2] + 159 y[3] , 867 + 243 y[2] - 567 y[3] ,

        -753 + 1053 y[2] - 4131 y[3] , 409 - 1455 y[2] + 4539 y[3]]

> Inverse(K) := inverse(K);
Error, (in inverse) singular matrix

# Die "Steifigkeitsmatrix ist symmetrisch und singulr. Den "Lastvektor"
# {F} ermittelt man gem: 
> Matrix_N := matrix(1,4,[N[1],N[2],N[3],N[4]]):   F := -
> map(Int,Matrix_N,x=0..1); 

  F := -

        [   1              1              1              1        ]
        [  /              /              /              /         ]
        [ |              |              |              |          ]
        [ |   N[1] dx ,  |   N[2] dx ,  |   N[3] dx ,  |   N[4] dx]
        [ |              |              |              |          ]
        [/              /              /              /           ]
        [  0              0              0              0         ]

> q := -map(int,Matrix_N(x),x=0..1):    F := (1/8)*evalm(8*q);

                   F := 1/8 [-1    -3    -3    -1]

> 
> 
> 
