Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing of equations to Mathcad from text file

Status
Not open for further replies.

schummio

Computer
Mar 25, 2010
5
Hi,

I have the following problem.
I have a system with about 10K of equations in the form:
x1x2+5x2x3-10x3x10-...-6x985x545=15

It's stored in text file. How to import it to Mathcad so that all indexes would become real Mathcad indexes so that I would be able to ask Mathcad to find the solution of such equations system? I'm trying simple copy-paste but it inserts it as separate fields and doesn't want to calculate it. When I tried to do some kind of import, it imports tables... whatever except what I want. Would really appreciate your help.

Thanks,
Oleg
 
Replies continue below

Recommended for you

If you have Mathcad 14, you might be able to convert the text into XML, and insert it directly into the file. However, this is a non-trivial exercise.

TTFN

FAQ731-376
 
Hi,

Great thanks for suggestion. I have Mathcad 14. I looked into XML generated by Mathcad for simple system of equations and the result didn't make me too happy :) i'm not expert in XML (i'm specialist in embedded SW, not databases or XML stuff) so it wasn't easy to read. It's not trivial, but possible solution; are there any other thoughts on this?

Thanks,
Oleg
 
Can you explain your problem a bit better, I think you are asking for the simultaneous solution of 10000 equations of the form sigma a(i)*x(j)*x(k) ofr various different i j and k in each case.

I'm not entirely sure that is solvable by Mathcad.



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Hi Greg,

Your understanding is right. In fact, 1/2 of equations have the form you mentioned, other part has a form sigma a(i)*x(j), and totally, to be precise, there would be 6.5K equations.

I tried to enter manually about 20 equations and Mathcad solved them pretty quickly. I don't think such computation would be too complex for him. Anyway, we wouldn't know that until importing the equations to Mathcad. And now i'm searching the best way to import them.

Thanks,
Oleg
 
Hi Excognito.

I looked into it but can't understand how to use it. After its hidden sources there are some examples, but I can't understand what the stuff under "text" in yellow is producing.

Thanks,
Oleg
 
Hi All,

Any other ideas/thoughts/suggestions?

Thanks,
Oleg
 
If you do a <CTRL>-F9 on the sheet in question, you can see that it evaluates the expressions within quotation marks in the function.

However, that is not what you appearing to asking for, since the Calc interpreter is actually doing the math, and not actually entering equations into Mathcad.

The previous suggestion of running a parser to generate the XML code for Mathcad is probably the cleanest way.

Alternately, a brute force approach is to use something like the SENDKEYS function in Visual Basic to take the text equations and send the equivalent keystrokes into the Mathcad user interface.

TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor