Removing units from a result / variable

Removing units from a result / variable - Messages

#1 Posted: 1/31/2020 8:10:12 AM
Zigor Marroquín Martínez

Zigor Marroquín Martínez

0 likes in 7 posts.

Group: User

Hi all!

Maybe this is a stupid question, but I'm just starting with SMath.

I searched also in forums but didn't find a similar topic..

I perform my calculations in SMath using always units, very interesting and useful. But now I need just the number, the value without units. What I do now is just dividing it by '1' and the unit XD

Any other method or function more professional? :P

Thanks a lot!

Zigor
#2 Posted: 1/31/2020 8:33:28 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Hi all!

Maybe this is a stupid question, but I'm just starting with SMath.

I searched also in forums but didn't find a similar topic..

I perform my calculations in SMath using always units, very interesting and useful. But now I need just the number, the value without units. What I do now is just dividing it by '1' and the unit XD



In fact, this is the only professional way to do it, because this way you can control and display the unit to be used. Just suppressing the unit would force the reader to make assumptions on what unit has been used to derive the numerical value. The experienced reader knows that always base units are used (e.g. for plotting) but it is better to explicitly specify them.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 1/31/2020 9:02:40 AM
Zigor Marroquín Martínez

Zigor Marroquín Martínez

0 likes in 7 posts.

Group: User

Thanks, Martin..

It's exactly the way I work.

But now I want to export data to an Excel sheet, and afterwards to treat that data as numbers without unit (Excel works like that).. so instead removing the unit in Excel, I was just wondering if in SMath would be a function to do it before exporting

Best regards,

Zigor
#4 Posted: 1/31/2020 9:30:23 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Assuming you have a table with columnwise uniform units, then the following approach provides full control:

exportdata.sm (4 KiB) downloaded 40 time(s).
exportdata.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Alvaro Diaz Falconi 2/1/2020 4:59:00 PM
#5 Posted: 1/31/2020 11:51:27 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

I perform my calculations in SMath using always units,


That is incoherent with unitless maths.
1. It can't be QA whereas the unit system sub-processes.
2. Advanced maths [symbolic, solvers ..] don't take units.
... I'm immune to "thunder" from contradictory comments !
Engineering formulas are already given in corresponding units [SI , ...]
#6 Posted: 1/31/2020 12:07:07 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Engineering formulas are already given in corresponding units [SI , ...]


... or construct wrt the units you want.
... export table w/o header

Inst_Colebrook Pipe Data.sm (61 KiB) downloaded 59 time(s).
#7 Posted: 1/31/2020 1:00:29 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

... or construct wrt the units you want.



1. Vincenti is coded 'km' superb
2. Arc length is unary maths ... make it user c/w unit.

Angle Vincenty Earth Distance [Mike].sm (40 KiB) downloaded 47 time(s).
Integrate Compendium_4 ArcLength Parabola-Cubic.sm (20 KiB) downloaded 46 time(s).
  • New Posts New Posts
  • No New Posts No New Posts