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

Multidimensional arrays and negative polar plots

Multidimensional arrays and negative polar plots

1. Support for multi-dimensional arrays.

2. Polar plots with a negative center point for plotting radiation patterns in dB. Excel calls this a radar plot.

3. An "if" block.

4. Better 3-D graphs allowing more user control.

I've been a user since 2.0 and have repeatedly requested these seemingly basic and useful features over the years.

It's a bit astounding to me that at least the first two have not been incorporated already.

25 Comments
MikeArmstrong
5-Regular Member

1. Support for multi-dimensional arrays..

James,

This must be the most requested feature since I joined this forum.

3. An "if" block.

Can't see the logic I'm afraid, we already have if statements.

Mike

RichardJ
19-Tanzanite
This must be the most requested feature since I joined this forum.

Since long before you joined this forum. A feature that could obviously be used by almost every scientist and engineeer in every field, and yet after at least one and a half decades of asking for it we still can't even see it on the horizon. It has been talked about for Prime, but when? Before the heat death of the universe, or after?

MikeArmstrong
5-Regular Member

Before the heat death of the universe, or after?

I hope it's before

I've got a feeling that PTC will implement this feature and Prime will be a success.

Mike

JamesCahill
5-Regular Member

By "if block" I mean the abilty to execute a number of statements, rather than just one, based on a condition. Sometimes a it is necessary to use a different set of equations based on whether a condition is true or false. I suppose in many cases both sets of calculations could be performed and the condition applied at the end, but in many instances, that is inefficient and confusing.

RichardJ
19-Tanzanite

The programming "if" statement doesn't do what you need?

MikeArmstrong
5-Regular Member

James Cahill wrote:

By "if block" I mean the abilty to execute a number of statements, rather than just one, based on a condition. Sometimes a it is necessary to use a different set of equations based on whether a condition is true or false.

You can use another If block.

We also have else in Mathcad Prime.

Mike

MichaelH
1-Newbie

Why don't you use the "otherwise" statement?

JamesCahill
5-Regular Member

It does, but having to use the programming constructs tends to defeat the benefits of using Mathcad. I often use the programming construct, but it makes debugging harder and the presentation is poor.

JamesCahill
5-Regular Member

If there are 10 statements to be perfromed based on the condition, it's very awkward to have to repeat the same condition 10 times.

MikeArmstrong
5-Regular Member

Can you provide an example. I still don't see where your coming from.

Mike

JamesCahill
5-Regular Member

Here's a simple example of an "if block" which might be embedded in the middle of a worksheet:

if Type=1 the

w=4

x=8

f(s)= s^2 +2s+a

r=16y+z

else

w=8

x=4

f(s)= 2s

r= y^2+9

end if

To me the need seems obvious. Often in engineering calculations, a different set of equations, or a different procedure must be followed based on an intermediate result. The intermediate result may be based on multiple input parameters, and the final result may involve multiple output values. That's why every programming language I've ever encountered allows something like the above.

StuartBruff
23-Emerald II

Richard Jackson wrote:

This must be the most requested feature since I joined this forum.

Since long before you joined this forum. A feature that could obviously be used by almost every scientist and engineeer in every field, and yet after at least one and a half decades of asking for it we still can't even see it on the horizon. It has been talked about for Prime, but when? Before the heat death of the universe, or after?

Is that one of those "rhetorical questions" I've heard about?

HarveyHensley
3-Visitor

I believe James has stated he realizes the if and otherwise construct is in the programming feature. What he (and I) would like is to have that type of block available in the whiteboard program. The current programming capability is great if you want to create a reusable subroutine, but if you don't need that in the current worksheet, why not have all of the features available at the worksheet level? We have solve blocks which are not a sequential structure, but a simultaneous structure. So why not have an if/otherwise or if/then block? And also a while block. In other words, all of the logic and looping capabilities of the programming option should be available at the worksheet level. The advantages would be improved readability. The whiteboard program has more spacing and formatting options than the programming option, so documentation just is more readable.

With the proposed approach, the "imbedded program" has no argument list, so it is single pass with respect to the incoming variables. For many worksheets, that is fine. If arguments are needed, then the programming option is still needed.

MikeArmstrong
5-Regular Member

What you mean like this?

11.jpg

22.jpg

Mike

StuartBruff
23-Emerald II

Mike Armstrong wrote:

What you mean like this?

Or possibly like this (dating from an older discussion on worksheet level looping mechanisms rather than being restricted to the programming model)?

Note the function variant at the bottom ...

Stuart

2012-10-18+Worksheet+Looping.jpg

HarveyHensley
3-Visitor

Mike,

Is the example above something real in Prime 2, or is this just a typed example of what is needed? I don't have Prime 2.

JamesCahill
5-Regular Member

Harvey provides a good explanation of what I meant by an "if block". In addtion to formatting and readability, the problem with Mike's October 18, 2012 programming constrauct example is that w, x, f(s), and z are not defined outside of the construct. I don't simply want to calculate a number. I want to define variables and functions for use later in the worksheet based on a condition.

Stuart's October 18 example is close to what I had in mind, but more than one expression should be permitted betweeen the if condition and the end of the block (else or end if).

I don't think encountered a case where looping was better handled in the whiteboard than in the programming construct, but having the option couldn't hurt.

RichardJ
19-Tanzanite

It's what a program looks like in Prime.

StuartBruff
23-Emerald II

JAMES CAHILL wrote:

Harvey provides a good explanation of what I meant by an "if block". In addtion to formatting and readability, the problem with Mike's October 18, 2012 programming constrauct example is that w, x, f(s), and z are not defined outside of the construct. I don't simply want to calculate a number. I want to define variables and functions for use later in the worksheet based on a condition.

Stuart's October 18 example is close to what I had in mind, but more than one expression should be permitted betweeen the if condition and the end of the block (else or end if).

I don't think encountered a case where looping was better handled in the whiteboard than in the programming construct, but having the option couldn't hurt.

The If condition was the only limit I'd envisaged on the number of statements for the blocks - it wouldn't be greatly useful if only one statement could appear in a for loop or if..elsif..else block.

There were several reasons for my suggestion.

1. Improved formatting / commenting with more user control over placement of expressions (including keeping them all on one page!).

2. Easier conversion of a single complex chain of expressions into a loop (many sheets start off as non-programmed sequences of (scalar) statements, which then currently have to be converted to a program to allow correct operation (merely adding range variables doesn't always work as the iteration order may be changed thus affecting sequential dependencies)

3. Following on from reasons 1 and 2, providing an alternative method of implementing functions (effectively as Mathcad sub-worksheets)

There are many cases where the 'whiteboard' method would be better than a 'program'. For example, there have been many instances posted on this site (and the old Collaboratory) of people developing single-pass algorithms at worksheet level and then being faced with the prospect of converting them to functions to iterate over some variable. Many algorithms implemented as programs would benefit from the improved commenting that a worksheet level implementation would provide.

Stuart

MikeArmstrong
5-Regular Member

Harvey,

It was a program created in Prime 2.0.

Mike

MikeArmstrong
5-Regular Member

Very good example Stuart, but I feel looking over your sheet it is much more difficult to understand and take in.

Maybe it's just me

Mike

MikeArmstrong
5-Regular Member

JAMES CAHILL wrote:

Harvey provides a good explanation of what I meant by an "if block". In addtion to formatting and readability, the problem with Mike's October 18, 2012 programming constrauct example is that w, x, f(s), and z are not defined outside of the construct. I don't simply want to calculate a number. I want to define variables and functions for use later in the worksheet based on a condition.

Once the program has finish you could return the required answer and define the variables outside the program.

The program could return the three outputs.

Z was defined above the program.

Mike

JamesCahill
5-Regular Member

I figured that you intended to allow more than one statement, but since the example did not show that, I wanted to make it clear what the point was.

JamesCahill
5-Regular Member

You're right about z, I should have said r.

But, the main point is that I want to define functions and variables based on a condition, and have them be valid for rest of the program.

There have been several times over the years when an "if block" would have been useful to me. I've tried to avoid providing a specific an example because I was afraid of providing a bad one, but I'll try. Suppose you want to analyze a circuit with several inputs and outputs that contains switches that get thrown if a particular node reaches 5V. In that case, you might want to use a whole different set of equations based on the state of the switches. In other words, the majority of the worksheet would be contained within the branches of the if block.

For this example, at least, you might calculate everything, and sort it out with a bunch of if statements at the end, but that's really messy and inefficient.

If you don't have a need for an "if block", that's fine, but I think many people would find it useful.

As indicated in the original post, the "if block" is 3rd on my list of improvements. With support for multi-dimensional arrays being number 1 by a wide margin.

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.