Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline ast123  
#1 Posted : 23 February 2024 02:11:35(UTC)
ast123

Rank: Newbie

Groups: Registered
Joined: 23/02/2024(UTC)
Posts: 2
India
Location: hyderbad

Hi,

I am new into the smath solver. I was using PTC mathcad prime v4.0. I have a force table in text/excel file from which I need to define each column as separate matrices. Please refer below snap from mathcad and help me how to do the same in smath solver
Fig.1.JPG
Offline overlord  
#2 Posted : 23 February 2024 05:38:54(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,134
Turkey

Was thanked: 516 time(s) in 344 post(s)
Every csv/xls/txt input-output command to SMath can be different.
It can need slight alterations according to format/version, etc.
If you can provide your Clamp Forces.txt file it would be easier.

Regards
Offline ast123  
#3 Posted : 23 February 2024 18:56:20(UTC)
ast123

Rank: Newbie

Groups: Registered
Joined: 23/02/2024(UTC)
Posts: 2
India
Location: hyderbad

Please find attached text file.

Clamp Forces_ACC.txt (1kb) downloaded 4 time(s).
Offline overlord  
#4 Posted : 23 February 2024 22:16:22(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,134
Turkey

Was thanked: 516 time(s) in 344 post(s)
There are two problems with your data file.

P1 - Your file is a comma separated file (CSV), without commas.
P2 - Strings are not between double quotes.

It can be imported into SMath but with compromises.
I wrote two methods for this two problems.
One is importing only essential data, other is whole table.

S1 - A typical CSV file uses commas, yours used tabular key instead.
importdata() can read it as it is, but writing tab as string is the key.
It is not possible to write tab character in Smath directly.
Yet it is not completely impossible, you can enter it via copy/paste.
What I did is open a notepad, wrote \0009\, which is ascii code for tab.
Then paste it between double quotes. Here the solution for first problem.
Now your numbers can be imported via partial importing.

Click to expand

S2 - I mentioned strings are not between quotes in your file.
Thus, just solving tab separation problem won't import your whole table.
As I have said earlier, strings should be quoted in a CSV file.
Because of that, your strings are not considered as strings by SMath.
SMath can read it without quotes but it will consider them as variables.
So it won't look right when import is concluded, if it can. Which I doubt.
You need to put strings between quotes. There is two way for this.
You either put it quotes manually via a text editor.
Or import in excel, select string cells, format them as text cells.
Then save your CSV file after necessary alterations made.
Without not forgetting to change your delimiter/separator to comma.
As it is the common way. After that you can import your file flawlessly.

Click to expand

When importing part is done, rest is splitting data into columns.
You can find how I did in the file below. Just extract them to same directory.

Regards

import_clamp.zip (5kb) downloaded 6 time(s).

Edited by user 24 February 2024 06:42:54(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.