cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Mathcad is lagging due to large size of matrix

yoohooos
11-Garnet

Mathcad is lagging due to large size of matrix

Is there a way to fix this? I have a single-very large size of matrix(10 pages) and when I do anything within this matrix, it will start lagging.

12 REPLIES 12
StuartBruff
23-Emerald II
(To:yoohooos)


@yoohooos wrote:

Is there a way to fix this? I have a single-very large size of matrix(10 pages) and when I do anything within this matrix, it will start lagging.


I'm afraid that the only way I know is to

  • expand the matrix to the size you want when you create it (to get the rest of your document spacing correct),
  • reduce it something quite small (eg, 5 rows),
  • do all your editing, recalc, etc, and then
  • expand it again

 

As you've noticed, the Mathcad Prime drawing algorithm tends to get rather glacial once the worksheet starts getting lengthy.

 

I've tried turning calculations off, switching to draft mode and reducing the zoom.   The last one helps a bit, but is somewhat limited by your screen size, resolution and eyesight!

 

Stuart

What's the size of the matrix (in terms of number of rows and columns)?  Is it sparse (i.e. does it have lots of zeros with relatively few non-zeros)?  What do you want to do with it - add/multiply it, invert it, find its determinant ...etc., just display it? 

 

Alan

You may try to "hide" that huge matrix in a collapsed area.
Or do you mean working speed gets down when you edit that matrix itself?

When I edit the matrix itself, the program starts lagging. This is only happens when I edit it, after I finished editing and hide them, no further problems were found. Thank you!!

So it looks like the math region you try to edit (the matrix) is too large for Prime to handle in a smooth way.

Any chance to define a couple of smaller matrices first and then building the large matrix using "stack" and/or "augment"?
Would be a workaround that shouldn't be necessary if Prime were properly and neatly programmed, but, alas - we can't change Prime, we only can change the way we use it.

 

StuartBruff
23-Emerald II
(To:Werner_E)

Hi Werner,

 

I find the drawing to be quite laggy anyway, once a worksheet gets to be more than a few pages long, regardless of the size of any arrays.   For example, I've often sat staring at the screen for several seconds waiting for Mathcad to enable the "Remove Space" context menu item.  Even worse is when I edit an expression in a worksheet then have to wait for about a minute for Mathcad to effect the changes.   I don't recall this being such an issue in M15, but my memory has never been that reliable.

 

Cheers,

 

Stuart

I see. Prime sucks and fails in many ways. I don't use Prime - my experience with this is essentially limited to trying to help the questioners here in the forum. But even with worksheets not that large I often felt that the workflow was quite tough and in no way pleasantly smooth.
But from what @yoohooos  is writing I understand, that the problem is not the size of the worksheet but the size of the matrix - or probably more correct the huge size of the math region he tries to edit.
I remember vaguely having seen a lengthy sheet here in the forum with a large programmed function spanning over a couple of pages. Editing something in that function was a nightmare - Prime seemed to freeze and not accept keystrokes but actually simply was reacting glacially just a couple of second after a letter was typed.

The solution was to split that function in a couple of smaller functions.

 

This. Exactly this. This is my first time experiencing this issue. Originally, I thought it was because of my keyboard is broken or my computer is too old to handle stuff. But then, I tried to use other windows in my computers and they worked just fine. I, then, tried to do something in a new Mathcad doc and experience nothing like that. What I decided to do was, I wrote each small submatrix and then copy and paste back into that large matrix.


@yoohooos wrote:

This. Exactly this. This is my first time experiencing this issue. Originally, I thought it was because of my keyboard is broken or my computer is too old to handle stuff. But then, I tried to use other windows in my computers and they worked just fine. I, then, tried to do something in a new Mathcad doc and experience nothing like that. What I decided to do was, I wrote each small submatrix and then copy and paste back into that large matrix.


Copy and paste is not a good idea in my opinion. Creating the large matrix via copy and paste every time you changed something in one of the sub-matrices is time consuming and failure prone. You should rather let the matrix automatically be created by using the "augment" and/or "stack" commands.

 

StuartBruff
23-Emerald II
(To:yoohooos)


@yoohooos wrote:

This. Exactly this. This is my first time experiencing this issue. Originally, I thought it was because of my keyboard is broken or my computer is too old to handle stuff. But then, I tried to use other windows in my computers and they worked just fine. I, then, tried to do something in a new Mathcad doc and experience nothing like that.

 

What I decided to do was, I wrote each small submatrix and then copy and paste back into that large matrix.


scream - copy paste 01 [2].png

 

Just ... No.    

 

If I had a Queen's shilling for each time I've seen cut&paste catastrophize a document, I'd be lending Bill Gates money from my loose change. 

 

Please, Listen to Werner.  It's fairly straightforward to either use the existing basic array functions (eg, submatrix, stack and augment), together with some programming, to combine/replace elements of a matrix.   In addition, if you're a maintenance user, then some of the premium functions could be useful, eg  putregion (https://support.ptc.com/help/mathcad/r6.0/en/index.html#page/PTC_Mathcad_Help%2Freplacing_a_part_of_an_image.html%23)

 

Even, and I feel ashamed just thinking about this let alone suggesting it, create your data in Excel and use the Mathcad READEXCEL function to import the data.  

 

However, regardless of your particular problem, the underlying issue would seem to be the slowness of Prime's drawing algorithms.  Hopefully, some kind maintenance user might raise a problem report and demand instant action (whilst threatening that, otherwise, they'll hold their breath until they turn blue in the face).

 

Stuart

StuartBruff
23-Emerald II
(To:Werner_E)


@Werner_E wrote:

I see. Prime sucks and fails in many ways. I don't use Prime - my experience with this is essentially limited to trying to help the questioners here in the forum. But even with worksheets not that large I often felt that the workflow was quite tough and in no way pleasantly smooth. 


In day-to-day use, the major gripes for me are: glacial slowness, having to press ctl-t to create a text region, lack of auto-pushdown of text regions (and math regions), inability to cut&paste multiple math regions into a text region, lack of ability to drag regions into and out of an Area, lack of ctl-g(*) within text, and lack of user-defined math and text styles.   Find and Replace? ... just plain annoying and counter-intuitive. Local functions can't be recursive (what's that all about???).  I've got a list, but no one's interested. 

 

OTOH, I would never want to go back to entering arrays the M15 way.  I now find it expedient to manually enter arrays when I only need a short example; in M15, I'd write a function.   In addition, when I was using premium Prime, ctl-j was another feature I really appreciated for entering programs (I dislike the amount of vertical space that Prime's programs take up, though - makes them look quite amateurish and cartoony). 

 


But from what @yoohooos  is writing I understand, that the problem is not the size of the worksheet but the size of the matrix - or probably more correct the huge size of the math region he tries to edit.
I remember vaguely having seen a lengthy sheet here in the forum with a large programmed function spanning over a couple of pages. Editing something in that function was a nightmare - Prime seemed to freeze and not accept keystrokes but actually simply was reacting glacially just a couple of second after a letter was typed.

The solution was to split that function in a couple of smaller functions.

 


In yoohooos' case, the size of the input region would indeed seem to be an issue.   However, in my (recent) experiences with Mathcad Express 6.0, I don't have programs longer than 1 line!

 

Well, OK, maybe one or two wider than one page, but not that many.   I usually break them down into smaller single-line functions (readability/performance trade-off), with the longer ones being cases where I can't do recursion otherwise.

 

Cheers,

 

Stuart

 

(*) Occasionally, I write expressions or text in Cyrillic.  Given that there are a few Russian and Ukrainian users, I would like to suggest that a latin-to-cyrillic control key would be useful (ctl-r, maybe, as ctl-c is taken and r is both suggestive of "Russian" for English speakers and the "r" key is "к" (for Кири́ллица) on a Russian keyboard).

Admittedly Prime with its many drawbacks and missing feature also has some advantages.
Getting rid of SUC and being able to mix quantities of different dimensions in a matrix is one if them.
The Ctrl-J feature is really great and a fine replacement (and improvement) for the missing toolbar in that case.

And yes, the way we can enter matrices in Prime in an intuitive way is  a great improvement along with the ability to easily remove columns or rows. Also the new row selector is highly welcome.

But - speaking of matrices. The display and especially scrolling in larger matrices with those silly and apparently arbitrary reacting (if they are reacting at all) sliders is a nightmare. Guess someone at the development team who never uses Prime himself thought its cool to try something different and was playing around with a programmers toolbox.

I couldn't be bothered switching over to Prime. The disadvantages still prevail enormously and in my opinion that will remain so. I see no significant development and burning problems like the catastrophic 2D graphics PTC tries to "solve" by purchasing third party components which are terrible to use because badly integrated and cannot even handle units. Thats sure not a promising approach.

 

 

Top Tags