Skip to main content
3-Newcomer
June 8, 2025
Question

Copy and paste AI-generated formulas

  • June 8, 2025
  • 3 replies
  • 2065 views

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...

3 replies

25-Diamond I
June 8, 2025

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.

 

3-Newcomer
June 9, 2025

(:= (@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.

Community Moderator
June 13, 2025

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.

21-Topaz II
June 8, 2025

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

21-Topaz II
June 8, 2025

Hi,

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

 

Capture3.JPG

Capture4.jpg

3-Newcomer
June 9, 2025

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.

23-Emerald IV
June 9, 2025