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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Default vertical concatenation. Difference between Prime and Mathcad 15

DM_10127316
7-Bedrock

Default vertical concatenation. Difference between Prime and Mathcad 15

Hi,

 

I converted a Mathcad 15 file to Prime and most of the results are different. These differences are due to the way in which Mathcad 15 and Prime append vectors vertically (see image).

 

The solution I found was to transpose the matrix in Prime (see AzD_(j,jw) in image). Unfortunately for this particular Mathcad 15 file, there are several matrices that have the same issue and I would have to transpose each one of them individually.

 

I wonder if there is a way to automatically change all the matrices in Prime that have this issue. I tried changing the range of (j,jw) without success.

 

P.S. I attached a Prime and Mathcad file exemplifying the issue.

 

Thank you!

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:DM_10127316)

What you get with

Werner_E_0-1637929186297.png

is NOT a vector, Its nothing you can assign to a variable

Werner_E_1-1637929269223.png

and so you cannot use it for any further calculations - its useful(?) for display purposes only.

A range is kind of an implicit loop, and, yes, Prime loops in a different way compared to real Mathcad. This should be no problem, though, if you use ranges just for the situations they are made for (index a matrix when defining it, define a plot range, for-loop in a program).

 

So I can only support Lucs suggestion to create the desired vector in a different way.

 

Here is yet another function which does the job (in MC15 as well as in Prime)

Werner_E_2-1637930434672.png

Of course this small function will deal with matrices of any dimension:

Werner_E_3-1637930895298.png

Prime 6 file attached

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald III
(To:DM_10127316)

What is wrong with

LucMeekes_0-1637926106403.png

That should work in Prime the same as in (real) Mathcad.

 

And if you have more columns:

LucMeekes_1-1637926371777.png

 

Success!
Luc

Werner_E
25-Diamond I
(To:DM_10127316)

What you get with

Werner_E_0-1637929186297.png

is NOT a vector, Its nothing you can assign to a variable

Werner_E_1-1637929269223.png

and so you cannot use it for any further calculations - its useful(?) for display purposes only.

A range is kind of an implicit loop, and, yes, Prime loops in a different way compared to real Mathcad. This should be no problem, though, if you use ranges just for the situations they are made for (index a matrix when defining it, define a plot range, for-loop in a program).

 

So I can only support Lucs suggestion to create the desired vector in a different way.

 

Here is yet another function which does the job (in MC15 as well as in Prime)

Werner_E_2-1637930434672.png

Of course this small function will deal with matrices of any dimension:

Werner_E_3-1637930895298.png

Prime 6 file attached

StuartBruff
23-Emerald III
(To:Werner_E)


@Werner_E wrote:

What you get with

Werner_E_0-1637929186297.png

is NOT a vector, Its nothing you can assign to a variable

Werner_E_1-1637929269223.png

and so you cannot use it for any further calculations - its useful(?) for display purposes only.

A range is kind of an implicit loop, and, yes, Prime loops in a different way compared to real Mathcad. This should be no problem, though, if you use ranges just for the situations they are made for (index a matrix when defining it, define a plot range, for-loop in a program).

 

So I can only support Lucs suggestion to create the desired vector in a different way.

 

Here is yet another function which does the job (in MC15 as well as in Prime)

Werner_E_2-1637930434672.png

Of course this small function will deal with matrices of any dimension:

Werner_E_3-1637930895298.png

Prime 6 file attached


And if you want to handle nested arrays, here's another way using the vec function:

 

93384_pastedImage_4

 

https://community.ptc.com/t5/PTC-Mathcad/The-vec-function/m-p/170273

 

Stuart

Announcements

Top Tags