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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Jason McCool  
#1 Posted : 30 October 2022 18:05:38(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 67
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
I've been using SMath for several years now, and I generally like it. But one shortcoming compared to Mathcad has always been the units for the US, even though consistent and automatic unit conversion is SMath's most helpful ability compared to something like Excel for engineering calcs. Most of the time, I can just go through the extra steps of typing in the units I actually want every time SMath displays the results in metric units. But I can't do that in matrices. If everything in the matrix is the same unit, then I can type in my USCS units outside the matrix and everythign is good. But sometimes I have mixed units like with stiffness matrices, and I end up with results like below with no way to force them to display correctly. Even these are the result of an extensive workaround earlier in the worksheet where I basically made all my inputs dimensionless and had to keep track of units manually, as some of my stiffness matrices will have various elements in kips, kips/in, and kip-inches, all in the same matrix and not segregated by row or column. I've tried using the "Imperial" option in the user settings file several times over the years, but that is worse than leaving it metric and manually changing every unit in every formula. I've tried editing the Units.xml file, but I'm not sure how to go about that. Is there any guidance on how to edit that? Long story short, I would really request a better ability to define default units, especially when dealing with matrices. They need to be able to have certain units on a per-element basis.
SMath deficiency.png
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline mkraska  
#2 Posted : 30 October 2022 22:28:16(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,759
Germany

Was thanked: 967 time(s) in 615 post(s)
The disadvantage of messing around with Units.xml is that your sheets won't be portable unless you convince the recipient of your sheets to also install your Units.xml. I tried to include a custom Units.xml in my inofficial portable distribution of SMath Studio but I skipped that because for me, the added value was very limited. This trade-off might be different for you.

In my Handbook (google SMath handbuch) you find some hints on the format of Units.xml (appendix F.3). This, however, hasn't been tested for a while and doesn't include re-definition of default units, because I never managed to do this.

This, btw. would also be handy for metric units. E.g. if you define an angular velocity of 1 rad/s this simplifies to 1 Hz, which is plain wrong. 1/s would be acceptable. You get this if you switch to symbolic evaluation but at the cost of rational representation of the numeric value.

In 2016 I filed a feature request on this.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 31/10/2022(UTC)
Offline Razonar  
#3 Posted : 31 October 2022 05:16:47(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,031
Uruguay

Was thanked: 575 time(s) in 370 post(s)
Originally Posted by: Jason McCool Go to Quoted Post
... If everything in the matrix is the same unit, then I can type in my USCS units outside the matrix and everythign is good. But sometimes I have mixed units ...


Hi Jason. This is a workaround. You can't show a column vector with mixed units, but a row vector.

Clipboard01.png
row_vec_mixed_units.sm (4kb) downloaded 6 time(s).

Best regards.
Alvaro.
thanks 2 users thanked Razonar for this useful post.
on 31/10/2022(UTC),  on 31/10/2022(UTC)
Offline Jason McCool  
#4 Posted : 31 October 2022 15:52:27(UTC)
Jason McCool


Rank: Advanced Member

Groups: Registered
Joined: 27/05/2016(UTC)
Posts: 67
Man
United States
Location: Little Rock, Arkansas

Was thanked: 9 time(s) in 7 post(s)
Martin, I agree. I would rather not have to edit Units.xml, but I'm not sure how else to accomplish it besides preventing SMath from even knowing those other units exist. Other than occasionally getting into some Eurocode calcs for structural mass timber connections, 99% of my work is in the US where metric is never an issue, and I'm basically the only one at my office (or in my grad school class, which is actually where I'm getting more heavily into the matrices now) that uses SMath or any of the calcs I develop from it. Office colleagues use Excel, and classmates use Mathcad. So a custom xml file might not be a big deal for me. I would like to see some more control of units moved into the program UI where you don't have to exit the program and edit settings files just to switch the default from Metric to Imperial or vice versa. But then the switch to Imperial has never really helped me because it always wants to use units I don't want, so I end up retyping all my units just as much as I did when it was set to metric, so I normally just leave it metric in the User Settings file.

Alvaro, thanks for the workaround suggestion. I don't think it will help, but let me add some more context. These stiffness matrices are (currently) 4x4 matrices with bending stiffnesses in 2 positions of each column and rotational stiffnesses in the other two positions. Previously, for truss stiffness matrix work, I was able to just apply kips/in outside the matrix because they were all axial stiffness terms, but now I have more degrees of freedom and more terms, and different units among the terms. This week, my class is proceeding to frames that will add more degrees of freedom and more variety of units among the different terms. See below for an example where I made everything unitless based on my input being in a specific input (length in inches, etc) so that my numerical values are correct in all terms, and what the same matrix looked like before when I had units assigned. I would like to see the units assigned and carried through if possible, because it is extra work to make sure I apply the correct units to my results at the end based on which elements were used from the matrix (e.g. is the value in my final system matrix based on the bending or axial stiffness value? One or the other might get canceled out because of boundary conditions, and that elimination happens in subsequent steps.) So while the row vector may be a workaround for the smaller vectors I'd initially shown in my first post, the matrices those derive from are bigger and more complicated and are actually the root problem, and I don't think that would be an option for those. But thank you for the suggestion!

2022-10-31_SMathMatrix1.png

2022-10-31_SMathMatrix2.png
Jason McCool
Robbins Engineering
Little Rock, AR, USA
Offline Razonar  
#5 Posted : 31 October 2022 19:04:03(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,031
Uruguay

Was thanked: 575 time(s) in 370 post(s)
Hi Jason. This is a workaround for show mixed units in a matrix.

matrix_mixed_units.sm (19kb) downloaded 5 time(s).

Clipboard01.png

Best regards.
Alvaro.
thanks 2 users thanked Razonar for this useful post.
on 31/10/2022(UTC),  on 31/10/2022(UTC)
Offline Kenny Lemens  
#6 Posted : 31 October 2022 23:25:29(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 38
Man
United States
Location: Wisconsin

Was thanked: 9 time(s) in 7 post(s)
Jason,

I know you were involved on this thread, but I'll share this thread regardless:

Originally Posted by: Engr Go to Quoted Post
... the attached units.xml must be used in place of the original file in the C:\Program Files (x86)\SMath Studio\entries folder. Please make a backup copy of the original units.xml file before switching so that you can always go back to the original.

Units.xml.txt (27kb) downloaded 97 time(s). (remove the .txt extension before use)

The attached units.xml file has been modified so that US Imperial units are the default for the Length, Area, Volume, Force, Pressure, and Mass categories.



As for the construction of the Units.xml file, I have a decent grasp on how it works and the issue would be this: changing the units to Imperial will not exactly make it easier to read as time (i.e. Seconds) is involved; so instead of 11 kip/in = 1,926,395 kg/s², you would get the answer of 11 kip/in = 4,246,974 lbm/s².

One thing you could try is to construct your matrix with pseudo units (that is, use a "unit" that is not defined, before your matrix for ease of reviewing. Just remember to define your "unit" afterwards to make the math work out). Below is an example, I create a matrix with the unit of 'customKIP. I multiply that matrix by inches (see variable F2) and display the result. After that, I define 'customKIP:='kip and the math now works out:
SMATH-matrixWithUnits.jpg


Hope this helps!
- Kenny Lemens, P.E. ᵂᴵ
Offline Razonar  
#7 Posted : 01 November 2022 00:59:08(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,031
Uruguay

Was thanked: 575 time(s) in 370 post(s)
Another way (always there is one more). Using Dimension utility, from this post.

dimensions v2.sm (69kb) downloaded 7 time(s).

Clipboard01.png

Best regards.
Alvaro.

Edited by user 01 November 2022 01:09:32(UTC)  | Reason: Not specified

thanks 2 users thanked Razonar for this useful post.
on 01/11/2022(UTC),  on 05/11/2022(UTC)
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.