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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Mathcad error cannot understand this syntax

ptc-4600533
1-Visitor

Mathcad error cannot understand this syntax

Hello everyone, i'm a beginner in programming with mathcad. I got 2 problems. First,i must resolve some equations and mathcad give me the error ''cannot understand this syntax'', but i wrote the lines like in the papers , where i go wrong?and second, i got some problems with strings, if anyone could show me where i go wrong please

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:ptc-4600533)

... the sequential worksheet had the same problem. Corrected in attached, but I haven't checked the algorithms for correctness (but have added a break variant of the for loop).

As a note, Mathcad 12 had some peculiarities that means it computes some things rather strangely from an 'normal' Mathcad perspective. Unfortunately, it's been so long since I've used M12 that I've forgotten what they are ... I think the attached should work in M12, but please let me know if they don't.

Stuart

View solution in original post

4 REPLIES 4
StuartBruff
23-Emerald III
(To:ptc-4600533)

Claudiu Florin wrote:

Hello everyone, i'm a beginner in programming with mathcad. I got 2 problems. First,i must resolve some equations and mathcad give me the error ''cannot understand this syntax'', but i wrote the lines like in the papers , where i go wrong?and second, i got some problems with strings, if anyone could show me where i go wrong please

Sorry I don't have time to look at the second worksheet, but the first one was fairly easy to fix. You wrote x1, etc using the array index notation for a subscript, whereas you meant the various 'x's to be variable names not array elements. For the latter you need to use the literal subsript ... just type 'x', then '.' then '1' ('2', '3', etc).

Furthermore, your assignment to S will create a nested array, with each element of S holding a single row of your intended result. Whereas some programming languages implement multi-dimensional arrays in this format, Mathcad doesn't. I've shown one way of getting the flat array format that you gave as an example.

Stuart

Message was edited by: StuartBruff Sorry, I realized I'd saved the file as an M15 xmcd not an M12 xmcd. Now saved as an M11 mcd file.

StuartBruff
23-Emerald III
(To:ptc-4600533)

... the sequential worksheet had the same problem. Corrected in attached, but I haven't checked the algorithms for correctness (but have added a break variant of the for loop).

As a note, Mathcad 12 had some peculiarities that means it computes some things rather strangely from an 'normal' Mathcad perspective. Unfortunately, it's been so long since I've used M12 that I've forgotten what they are ... I think the attached should work in M12, but please let me know if they don't.

Stuart

Thank you mr. Stuart for the help, i'm starting to understand now a little how it works, by the way i use mathcad v15, God bless you !

StuartBruff
23-Emerald III
(To:ptc-4600533)

Claudiu Florin wrote:

Thank you mr. Stuart for the help, i'm starting to understand now a little how it works, by the way i use mathcad v15, God bless you !

No worries. I don't know why I got the idea Mathcad 12 was involved ... if you see a spare brain cell anywhere, it's mine!

Stuart

Announcements

Top Tags