-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about to_string() function #264
Comments
The string output is driven by a large map, which generally defaults to including mostly SI based units, and probably could use improvements. The two cases you mentioned I could see adding to the to_string(...) output as they are common enough. However, in the mean time if there are specific outputs/inputs you want to display that are different than what exists currently.
I will make some adjustments based on your comments in the near future, so this shouldn't be necessary but you can use this at present. |
Thank you so much for your response it solved the issues, Another issue maybe related and currently I'm struggling with is regarding Strain, As Strain is a dimensionless value I can use "precise::one" or "precise::percentage" to show it and it works fine but when it comes to Strain rate i.e. "one/s" it becomes dimensionally equivalent to Hz and my software shows it as it is frequency but I need to show it as 1/s or s-1 which is standard strain rate unit. The problem is that if I override the behavior with I think although Strain is dimensionless but it needs to be distinguished from other dimensionless types, |
The units of strain should be Then you can use this in the string definitions of your choice, including strain rate and it will be distinct from precise::one so shouldn't be conflicting with other frequency units. |
Yes strain is "deformation/original length" but it is a unitless value or 1. I think it can't be And also I don't have much information about per unit system as I understood it seems that per unit system is mostly used in power electronics is that true? is it then OK to use it with strain ? |
When per unit values are used in power systems they are dimensionless units as well for example puMW, is actual power/power base. This simplifies a lot of calculations, but also maintains certain relationships. puV*puA=puW still hold true. So to me strain would function similarly using perunit meters. The other option is to define it as In the units library the pu flag is meant as an indicator that the unit is dimensionless. This admittedly gets a little fuzzy when mixing things like strain rate but I have had things like puMW/hr and the calculations work out fine. I would be interested in knowing how this might play out in a different field. |
Thanks for the explanation; I think I get the concept. i did make a trade off between these two approaches and I think using eflag is better for my use case because it preserves the base units which I need to analyze elsewhere in of my software. |
I am going to add a few tests that play around with strain and some example problems, after which I will close this issue. |
Hi
I'm using your code in my material testing software, Normally string functionality works fine but sometimes seems it not working as I expect.
For example in this code:
outputs 4.44822161526049964N instead of "lbf"
And another question which can be relevant to the previous one, suppose this code:
outputs "1/ms" which is theatrically correct but I need to show "kHz" to my user.
is it possible to do that?
As you know in material testing there are lots of rate units, e.g. force/time, stress/time, strain/time and as multiplier factors all of them are working properly in your library but sometimes I need to present them with different strings in my software, it would be great for me to if there is a way to achieve that.
Thanks in advance.
The text was updated successfully, but these errors were encountered: