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

Feature Request - Align symbolic for loop behaviour with numeric

StuartBruff
23-Emerald II

Feature Request - Align symbolic for loop behaviour with numeric

It's great to see the symbolic engine being improved.  However, it would be nice to see a long-standing symbolic/numeric behavioural alignment problem fixed.

 

The numeric engine will iterate over a vector in a for loop but the symbolic engine does not, which requires workarounds that make the code more complex than need be.   For example,

 

2022 04 16 a.png

 

Stuart

 

2 REPLIES 2

The problem seems to be the local definition of the array. It also fails if the array is a function argument:

Werner_E_1-1650144198428.png

It also works OK if the local matrix is used directly

Werner_E_0-1650144373817.png

 

But of course neither a global definition nor using the matrix directly in the for-loop helps in writing utility functions.

 

 

 

StuartBruff
23-Emerald II
(To:Werner_E)


@Werner_E wrote:

The problem seems to be the local definition of the array. It also fails if the array is a function argument:

Werner_E_1-1650144198428.png

It also works OK if the local matrix is used directly

Werner_E_0-1650144373817.png

 

But of course neither a global definition nor using the matrix directly in the for-loop helps in writing utility functions.


Yes, I first hit the problem back when some tyrannosaurs noticed a rather bright object in the sky one fine Spring day.  I often use my vec function to completely flatten arrays (even nested ones).   The symbolic version loses the simplicity of the numeric version.

 

It's annoying enough to have to think once when writing recursive functions, but having to think twice (workaround) has the voices in my head suggesting it's time to start sharpening the broadswords.

 

(There was a time when I wouldn't have to add a note explaining that the latter is a joke and apologizing ahead of time for inadvertently triggering anyone)

 

Stuart

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."