Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
I am using MC Prime 3. I am trying to see if it is possible to interpret various points using indexes as per the attached.
Basically I have defined various matrixes and interpreted lines between them as a function of z. Then I have used solve blocks to find the z value when the two lines interpreted from my matrixes meet. However, as I am doing many iterations of the same thing I want to know if it is possible using indexes or if there is a better approach? I have never got into MC Programming but guess that might be an approach?
Thanks,
Andy.
Solved! Go to Solution.
May be so
Hi Valery,
That is really interesting! I think that solves my initial problem. as outline. Could you take this a step further. Where I want to interpolate ST with the WL values but I have multiple sets of WL as the attached.
Cheers,
Andy.
@awibroe wrote:
Hi Valery,
That is really interesting! I think that solves my initial problem. as outline. Could you take this a step further. Where I want to interpolate ST with the WL values but I have multiple sets of WL as the attached.
Cheers,
Andy.
In Prime 4 all ok. In Prime 3.1 I have your error.
Can you show me a screen shot of what you are doing to get the second problem? i.e. multiple sets of WL?
Hi,
Yes I got that working OK. Just looking at the further problem in the attached introducing the same loginc but to two sets of indexes i.e. "I" for the existing problem but adding "ii" to get two sets of WL plots to intersect ST.
Attached.
Thanks,
Andy
I think it is not a bug but a ??? in Mathcad. We can not so work with a Nested Array. Only with a vector or a matrix!
That has never been possible in Mathcad.
It's a lack of ...support for multidimensional arrays/matrices... in Mathcad.
Success!
Luc
Hi Luc,
So in the context of my problem, I think the attached is the closest to what I want? i.e. I will still have to manually write out each variable of t?
A
I am not really sure what you are trying and I don't know why all your S[i seem to be the very same. I also wonder if tha adding of 0.001 or 0.0001 here and there was done on purpose or if it was done just to avoid an error when using linterp. It looks like you just want to cut a vertical with a horizontal?
Anyway - could it be that you are just looking for something like the following?
Or
idx:= 0 . . last(S)
Just trying to get my head around what is going on here Fred.
I have tried to better explain what I am after in the attached.
@Fred_Kohlhepp wrote:
Or
idx:= 0 . . last(S)
No. A range won't work OK as you can't access the result. You can't assign the output to a variable.
So idx has to be a vector.
But of course we do not have to resort to a program to create it.
We could use an auxiliary range
or we can use the undocumented trick with the inline evaluation
Undocumented : entirely true, for Mcd15 too.
So, same behavior in Mcd15. Just placing an inline = after the definition of a range variable makes it no more usable for working with, e.g. for retrieving elements of vectors and operate with them in the subsequent part of the worksheet.
That seems to me not being consistent with the usage of the inline = with other type of variables, since in the case of range variables it completely changes their significance.
Just putting an inline = after such definition made the rest of my worksheet of about 30 pages full of errors and to spend one hour to (re)discover the reason why. I initially thought that's a kind of a bug, but it appears it isn't....
Therefore, users, take care with this inline = with indexes !
Regards, Liv.
I don't think Mathsoft ever intended us to put an in-line equals after a range variable. (I'm not sure when the in-line equals became possible.) I'm a little surprised it doesn't throw an immediate error after a range variable.
Think of it as "Here's an in-line equal. They must mean they wanted a vector, not a range variable. . ." And, since it got converted to a vector, unless you index it you are referring to the whole thing, so if it's positioned as an index Mathcad can't figure out which element of the vector you wanted.
There are very few times an in-line equal is worthwhile. I think it got added so that you could format answers the way professors wanted you to:
Another use for the inline evaluation is to stop the symbolics to backtrack the exact origin of the definition of a variable which was derived by a method which is only available for numeric evaluation. So we are able to use those numerically derived variable values in symbolic calculations.
We had a few examples for this here in the forum the last months.
Thanks guys,
Many possibilities. I will look through these at the weekend.
I also feel like it is about time I start dabbling in programmes. Any advice on where to start? Are the standard help files any good at learning programming in MC?
Cheers,
A
awibroe wrote:
I also feel like it is about time I start dabbling in programmes. Any advice on where to start? Are the standard help files any good at learning programming in MC?
Most what I know about Mathcad I learned from the help and from this forum (and of course by trial and error). But it was a better help (Mathcad 15 and below) and a better forum (the good old Mathcad collab).
Even though the help in Prime was simply converted from Mathcad 15 in great parts, I find the look and feel mediocre and navigation cumbersome. But just give it a try and if you get stuck come here and ask.
I still use Mathcad 15 as I find it much superior and powerful compared to Prime ans mainly use Prime only for answering questions here. So maybe you find the help in Prime helful anyway.
I just found some older Prime sheets from PTC which should still open with Prime 3.0. Note sure if they are useful - give it a try ad judge yourself:
Thanks everyone!
Also thanks for the notes on programming. I have never really tried MC15 as Prime is what I know...