tennisman03110

0 Reputation

2 Badges

10 years, 304 days

MaplePrimes Activity


These are replies submitted by tennisman03110

I have looked at this page, and tried to change matrix options, but I can not find anywhere how to truly implement this into the code.  Is there a specfiic call to put the matrix into this style.  I can never get my matrix decomposed into three separate vectors.

I have looked at this page, and tried to change matrix options, but I can not find anywhere how to truly implement this into the code.  Is there a specfiic call to put the matrix into this style.  I can never get my matrix decomposed into three separate vectors.

If I were to store the matrix in vectors, would I make 47088 of  1..47088 vectors?  Or would I make one very long vector.  I will have to end up using linear solve eventually, and am not sure how I would do this with a vector.  Here is a small section of code. In the code Mat2 is a vector filled with letters a though j, in which I want to write a statement to create the nodal equation for each letter.  This code is only trying to create the eqatations into the matrix wherever there is a b in the vector.  Although I know it works on much smaller matrices, I have not gotten even this part to finish computing.  I can only imagine it would take more space and time when each letter has a different elif statement.  I am puzzled on what to do, have looked at NAG but not sure how to use it, and right now I am stuck. Is there a better way to accomlish what I wish to create?  Thanks

> Mat2 := Reshape(Mat, 47088, 1);
> t := proc (i, j)

if Mat2(i) = b then

    if i = j then -4

         elif j = i+1 or j = i-1 or j = i+216 or j = i-216 then 1

          else 0

         end if;

       else 0

      end if

   end proc;

Mat3 := Matrix(47088, t, storage = sparse);

 

Edit: I let it go to the end and now it says matrix too large. Hmm..how to fix

 

If I were to store the matrix in vectors, would I make 47088 of  1..47088 vectors?  Or would I make one very long vector.  I will have to end up using linear solve eventually, and am not sure how I would do this with a vector.  Here is a small section of code. In the code Mat2 is a vector filled with letters a though j, in which I want to write a statement to create the nodal equation for each letter.  This code is only trying to create the eqatations into the matrix wherever there is a b in the vector.  Although I know it works on much smaller matrices, I have not gotten even this part to finish computing.  I can only imagine it would take more space and time when each letter has a different elif statement.  I am puzzled on what to do, have looked at NAG but not sure how to use it, and right now I am stuck. Is there a better way to accomlish what I wish to create?  Thanks

> Mat2 := Reshape(Mat, 47088, 1);
> t := proc (i, j)

if Mat2(i) = b then

    if i = j then -4

         elif j = i+1 or j = i-1 or j = i+216 or j = i-216 then 1

          else 0

         end if;

       else 0

      end if

   end proc;

Mat3 := Matrix(47088, t, storage = sparse);

 

Edit: I let it go to the end and now it says matrix too large. Hmm..how to fix

 

I am not sure what you mean by the diagonal rigidity.  I tried to change the first 31 cloumns of the A matrix to zero, corresponding to my boundry conditions, but linear solve gave no answer and said that it was an inconsitent system. Could you please explain the input of the boundry conditions a little more?  Thanks

I am not sure what you mean by the diagonal rigidity.  I tried to change the first 31 cloumns of the A matrix to zero, corresponding to my boundry conditions, but linear solve gave no answer and said that it was an inconsitent system. Could you please explain the input of the boundry conditions a little more?  Thanks

Page 1 of 1