Removing units from a result / variable

Removing units from a result / variable - Poruke

#1 Objavljeno: 31. 1. 2020. 08:10:12
Zigor Marroquín Martínez

Zigor Marroquín Martínez

0 svidjanja u 7 postova.

Grupa: 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 Objavljeno: 31. 1. 2020. 08:33:28
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: 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.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#3 Objavljeno: 31. 1. 2020. 09:02:40
Zigor Marroquín Martínez

Zigor Marroquín Martínez

0 svidjanja u 7 postova.

Grupa: 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 Objavljeno: 31. 1. 2020. 09:30:23
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

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

exportdata.sm (4,81 KiB) preuzeto 1251 put(ova).
exportdata.png
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 korisnika je svidelo ovu objavu
Alvaro 1. 2. 2020. 16:59:00
#5 Objavljeno: 31. 1. 2020. 11:51:27
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: 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 Objavljeno: 31. 1. 2020. 12:07:07
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: 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,76 KiB) preuzeto 1294 put(ova).
#7 Objavljeno: 31. 1. 2020. 13:00:29
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: 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,27 KiB) preuzeto 1067 put(ova).
Integrate Compendium_4 ArcLength Parabola-Cubic.sm (20,33 KiB) preuzeto 1358 put(ova).
  • Novi postovi
  • Nema novih postova