Skip to main content
3-Newcomer
Jun 8, 2025 1:11 AM UTC
Question

Copy and paste AI-generated formulas

Hello, I have solved some problems and formulas in artificial intelligence: Deepseek and ChatGPT then and converted them to MATHCAD format. There are no errors, they are well written, but Mathcad does not recognize formulas or numbers, it pastes them as text... Is there any way to solve this? Is it possible to use a programming language to use the Gauss Seidel and Newton Raphson methods directly in Mathcad? I have the codes in Python but I want Mathcad to generate the .mcdx document for me...

8 replies

Werner_E
25-Diamond I
Jun 8, 2025 2:36 AM UTC

So you're saying that the AI ​​actually generated valid Mathcad code that actually worked correctly without modification after being manually typed in? Did I understand that correctly?

If so, I'd say you were very lucky, because while AIs have already reached a fairly high level of proficiency in programming in common languages ​​like Python or C, this hasn't been the case with proprietary niche syntax like the programming language in Mathcad Prime. We've already had examples posted here in the forum by a user, and the AI's output had little to do with Prime syntax.

 

I suspect that in any case, you'll have no choice but to manually retype the program yourself in Prime, since the AI ​​is supposedly delivering it in plain text form.

 

Of course, it would be possible to reverse engineer the format of a Prime sheet and write a program that creates a correctly formatted Prime worksheet (essentially a zipped directory structure of multiple XML files) from the text-based Mathcad program.

If you actually intend to write such a program, I wish you the best of luck—it's certainly not an easy undertaking and will be time-consuming.

 

Instead of creating a whole XML worksheet, you could program a converter to convert text like

f(x):=sin(x)^2+6

into

(:= (@FUNCTION (@LABEL VARIABLE f) (@ARGS (@LABEL VARIABLE x))) (+ (^ (@APPLY sin (@ARGS x)) 2) 6))

When you create a math region in Prime by typing Ctrl-Shift-M and then copy the above, you will have created a correct Prime function definition:

Werner_E_0-1749350137485.png

Of course automating this process would also require you to reverse engineer to find out the necessary syntax for all possible expressions.

 

Translate
3-Newcomer
Jun 9, 2025 12:39 AM UTC

(:= (@FUNCTION (@LABEL VARIABLE f) (@ARGS (@LABEL VARIABLE x))) (+ (^ (@APPLY sin (@ARGS x)) 2) 6))

Interesting, really interesting. I think this sample can teach AI how to translate correctly. Thanks.

Translate
Community Moderator
Jun 13, 2025 4:04 AM UTC

Hello @RL_13320206,

 

It looks like you have some responses from our community champions. If any of these replies helped you solve your question, please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Translate
terryhendicott
21-Topaz II
Jun 8, 2025 5:31 AM UTC

You wrote: "Is it possible to use a programming language to use the Gauss Seidel and Newton Raphson methods directly in Mathcad?"

Good news is there are two ways to perform each already built into Mathcad Prime you do not need to program them.

1) Gauss Seidel, use lsolve(A,b) or A^-1*b to solve the matrix problem.

2) Use root() function or a solve block to find the root of a function.

 

Perhaps if you upload Mathcad worksheet it is possible to advise further.

 

Cheers

Terry

Translate
terryhendicott
21-Topaz II
Jun 8, 2025 6:24 AM UTC

Hi,

Thought it might be more productive if an example of each is provided.

 

Capture3.JPG

Capture4.jpg

Translate
3-Newcomer
Jun 9, 2025 12:36 AM UTC

Hello friends, your answers are very interesting, but it's a bit more complex. I'm referring to Gauss-Seidel and Newton-Raphson for electrical power systems. Newton-Raphson for SEP requires finding the Jacobians and matrix iterations.

Translate
23-Emerald V
Jun 9, 2025 2:47 PM UTC