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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Looping

0 Kudos

Looping

For Prime 2.0, as a completely new capability, we should be able to do looping through whole sections of a worksheet, in the same way that For-Loops can be run across regular code.

Without this style of operation, which gives the necessary "illusion of control" that many users desire, and algorithm development and simulations need, we'll continue to play second fiddle.

The capability is in one sense similar to the FRAME function for animation, but would allow some values to be retained between runs, so you can finish with Results[FRAME as being valid.

The looping needs to be nestable.

Labview is a similar product with a looping capability

Philip

17 Comments
RogerMansfield
1-Newbie

I have made the case elsewhere that Matlab is so much more widely accepted in the engineering disciplines because it got there first. Your posts above indicate that things are not that simple ... Matlab does indeed do a lot of important things better.

As regards looping through entire worksheets, I read a counter from a .txt file at the beginning of the worksheet, and increment the counter before writing it to the same .txt file at the end of the worksheet. Thus, each Ctrl-F9 click loops through the entire worksheet and updates the counter. I know this is crude, but it works for me.

I don't see a workaround for quaternion algebra. I don't use quaternions -- Euler angle rotations suffice for me. But I have been told that the rotational dynamics of rockets in powered flight is more reliably modeled using quaternions, as opposed to rotation matrices (and reliability is paramount in rocket flight).

O.K., here at last is my two cents on what I'd like to see in Mathcad Prime (and in Mathcad 15+). It is just one thing (not three):

When I construct a function, the more arguments it has, the less space I have for the typically-multiple assignment statements of the function. Because all of the assignment lines start to the right of the vertical bars ||, which are all positioned right below the very first one.

Long_Function_Name(Argument1, Argument2, Argument3, Argument4, Argument5, ... ) := || Addline, Addline, Addline, ...

Why not have the vertical bars || all line up below the first character of the function name (here, the "L" in "Long"), rather than to the right of the assignment operator colon-equals (:=)? That way, you have the entire width of the worksheet to construct the function's assignment statements. Here's what I mean:

Screen Capture1.jpg

Although I was not able to paste in the entire function, you can still see that I have less than half the width of the worksheet for constructing my function. If the vertical add-line bars || started right below the E in EURO, I would have the entire width of the worksheet to work with. The workaround is to make function names short and arguments implicit, but that is not necessarily good programming.

MikeArmstrong
5-Regular Member
Long_Function_Name(Argument1, Argument2, Argument3, Argument4, Argument5, ... ) := || Addline, Addline, Addline, ...

Why not have the vertical bars || all line up below the first character of the function name (here, the "L" in "Long"), rather than to the right of the assignment operator colon-equals (:=)? That way, you have the entire width of the worksheet to construct the function's assignment statements. Here's what I mean:

Screen Capture1.jpg

Although I was not able to paste in the entire function, you can still see that I have less than half the width of the worksheet for constructing my function. If the vertical add-line bars || started right below the E in EURO, I would have the entire width of the worksheet to work with. The workaround is to make function names short and arguments implicit, but that is not necessarily good programming.


To be honest, I dislike the layout Prime has adopted regarding the layout of Prime. The vertical bars ||look horrible, why they have left the solid bar is beyond me.

Mike

RichardJ
19-Tanzanite
Why not have the vertical bars || all line up below the first character of the function name (here, the "L" in "Long"), rather than to the right of the assignment operator colon-equals (:=)?

I am with you 100% on that, and have also requested this. I know for sure some other people have requested it too.

RichardJ
19-Tanzanite
To be honest, I dislike the layout Prime has adopted regarding the layout of Prime. The vertical bars ||look horrible, why they have left the solid bar is beyond me.

I agree with you, but it's not something I'm going to lose too much sleep over.The new vertical bars are as only as irritating as a mosquito bite, whereas the ribbon is a flea infestation.

PhilipOakley
5-Regular Member

RogerMansfield wrote:

As regards looping through entire worksheets, I read a counter from a .txt file at the beginning of the worksheet, and increment the counter before writing it to the same .txt file at the end of the worksheet. Thus, each Ctrl-F9 click loops through the entire worksheet and updates the counter. I know this is crude, but it works for me.

I don't see a workaround for quaternion algebra. I don't use quaternions -- Euler angle rotations suffice for me. But I have been told that the rotational dynamics of rockets in powered flight is more reliably modeled using quaternions, as opposed to rotation matrices (and reliability is paramount in rocket flight).

Roger,

Thanks for the reply - I'd missed it because it had scrolled off the recent activity page (which annoys me)

I've used similar crude techniques, more often using +FRAME*0 in the key variables as the technique to get the programme run as many times as needed.

However the real problem is when one wants to run a portion of the sheet many times and retain part of the calculations and then continue, without these fancy (error prone) work-arounds. I'd like an easy method embeded in the code (e.g. allowing Areas to be a for-loop)

I see that from a human factors view point, most people want the 'illusion of control' that loops give - At my company we also have large numbers of folk on expensive Matlab 'seats' doing try, edit, run loops all day because they don't quite want to take the time to think (there is no visible work activity to thinking, and managers like visible activity) when it should be the other way round. MathCAD is a think once, get the answer you wanted type product. And it is rubbish at simulations.

My comment on quaternion algebra should be seen as simply an example of someone's 'special case' that can be generalised to being able to extend data types (one view of how that generalisation may be formulated). I would not expect most folk to want/need/desire/even know about quaternions, they would have their own "special case" <smile> .

Matlab provides quaternion multiplication etc in their aerospace toolboix (I think it is that one). But the users has to track which vectors are quaternions, so mistakes can still be made.

Philip

Efried
1-Newbie

you might pack variables handed over into one vector...

mzeftel
1-Newbie

I have captured and logged all suggestions posted before March 2, 2011.

Thanks,

Mona

MikeArmstrong
5-Regular Member

Mona,

Can this thread be locked until we see Prime 2.0 show it's face?

Mike

RichardJ
19-Tanzanite

Why?

MikeArmstrong
5-Regular Member

Because all the negative comments are offering little benefit to the development off the product and the thread has enough information as it is.

I think a Mathcad Prime section within this forum would be beneficial.

Mike

RichardJ
19-Tanzanite
Because all the negative comments are offering little benefit to the development off the product and the thread has enough information as it is.

I don't think threads should be locked because people are saying negative things, or because someone decides that nothing more useful could be said on the subject.

I'm not a big fan of censorship.

I think a Mathcad Prime section within this forum would be beneficial.

At this point, that might be a good idea. Not sure how it would work as Prime's capabilities get closer to MC15's though. Perhaps a section called "Prime 1.0" would be better.

MikeArmstrong
5-Regular Member

I don't think threads should be locked because people are saying negative things, or because someone decides that nothing more useful could be said on the subject.

I'm not a big fan of censorship.

I agree but there will be a cut off point where PTC will have to proritise what additional functions go into Prime 2.0 and if this thread keeps getting added to good posts/ideas might get lost.

At this point, that might be a good idea. Not sure how it would work as Prime's capabilities get closer to MC15's though. Perhaps a section called "Prime 1.0" would be better.

Good idea.

Mike

RichardJ
19-Tanzanite

I agree but there will be a cut off point where PTC will have to proritise what additional functions go into Prime 2.0

I would guess that for major features, that point has already passed. For minor adjustments it should continue right up to the release. Otherwise there wouldn't be any point in having a beta test.

if this thread keeps getting added to good posts/ideas might get lost.

I have every confidence in Mona

MikeArmstrong
5-Regular Member
I would guess that for major features, that point has already passed. For minor adjustments it should continue right up to the release. Otherwise there wouldn't be any point in having a beta test.

I thought the feedback from the beta test where passed back to PTC via e-mail not the forum.

I might be mistaking though.

Mike

RichardJ
19-Tanzanite
I thought the feedback from the beta test where passed back to PTC via e-mail not the forum.

My point was that feedback has some influence right up to the release date. If they locked out even minor changes 9 months before the release date there would be no point in having a beta test.

MikeArmstrong
5-Regular Member

Ok I give in - agreed

Mike

olivierlp
Community Manager
Status changed to: Archived

Hello,

We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.

You can always post a new idea with all the details required in the form.

Thank you for your participation.