Anthrazit

885 Reputation

13 Badges

5 years, 346 days

MaplePrimes Activity


These are replies submitted by Anthrazit

@acer 

I have attached the example as a zip file, probably you can make something out of that. In addition I have also opened a formal support case on that issue yesterday, so I guess someone from Maplesoft will have a look at that in the near future.

Did a quick search on Maple Cloud also, and tried to find a public example including a workbook. Didn't find anything - though I have to admit that I skipped the ones with asian (chinese ?) characters in titles...

@acer 

Thanks, here's the upload once again in a zip file.

Tre_Materialegenskaper.zip

Here's the Maple Workbook in question.

Tre_Materialegenskaper.maple

I think the answer might be to save the file as a Maple Workbook.

At least I am getting the same errors as in the Maple Cloud when working with the workbook format.

The question is - how do I use an attached Maple repository file (.mla) in the workbook?

The repository path is "this:///NODETre.mla" - so how I attach that?

libname := "this://", libname

gives a Maple Error regarding Kernel connection

@tomleslie 

Try to read once again what I have written.

The differences in rounding of halv integers - and that is really the only thing where implementations are different - are more or less known.

When I wrote that one can't always trust the last digit, that doesn't mean I don't trust the implementation of the rounding in the different software packages. It means that I don't actually know which kind of rounding (up or down) the different software packages use.

I could even extend that further to human languages. In German we have two words for that - "aufrunden" (round up) and "abrunden" (round down). In Norwegian we usually just use "avrunde" which doesn't give any indications about which way it is done.

So in my personal point of view we still stand where we started.

  • Maple does at the moment not have any function to round numbers to a specific number of digits.
  • It should have one. There are situations where simply defining how many digits are shown in a result is not enough (see using numbers for indexing of tables, or output to Math Containers, etc.)

@acer

Apparently it is possible if the code is run during startup or through "Execute entire worksheet".

Startupcode.mw

@acer 

No, not that I am aware of.

Tre_Materialegenskaper.mw

@acer 

Thanks a lot, that was very helpful.

@tomleslie 

Yes, the rnd2 function seems to work as I would expect from a rounding function, and like it is implemented in the software I named previously.

@tomleslie 

The question regarding halv-integers is indeed a bit strange, and the rounding behaviour of Python is indeed a bit unexpected I have to admit.

But that is common knowledge, the last digit is the one you can't always trust.

As my teacher in steel at university said.

In steel you calculate 3 digits and hope that 2 are correct. In concrete you calculate 2 digits and hope that 1 is correct. And in soil mechanics you calculate 1 digit and hope that the sign is correct.

@Christopher2222 

Well, I've filed that as a product suggestion - and it would be nice if Maplesoft took it on their list for future implementation.

For the time being we'll go around the issue somehow.

@Kitonum 

That just fixes the way things are displayed in specific portions of the sheet.

Unfortunatly this is not enough sometimes.

I've got at least 2 things where that doesn't work.

  • When using numbers as index for tables
  • For text fields

@Christopher2222 

I'm a structural engineer, and I can tell you that this is something we never would have any use for.

Excel btw. does it exactly the same way as Python, as well as Visual Basic. Rounding does give an indication about how many digits are correct. If a measurement is in meters, and you show 3 digits, than the measurement is correct in millimeters. Regardless if the figures show local coordinates (typically 1 to 3 digits before the delimiter) or real coordinates (might be 10 digits before the delimiter).

And no - this isn't anything any engineer would get used to.

.

 

Why would I need to implement that in a code?

Rounding is a basic functionality which is available in every software package I know.

https://www.w3schools.com/python/ref_func_round.asp

round(123456,2) returns 123456 in the Python example which is correct.
(but I could live with 123456.00 as well.)

evalf[2](123456) in Maple on the other hand gives 120000 (actually "12000 0.") which is complete nonsense.

@acer 

In that case the data is complete, so it's not so large.

I have a different example with material data, where seq is used instead. The code however is much more difficult to read in my opinion, that's one thing I have to admit I struggle with at the moment.

In Maple you can do very many thing in one line.

https://www.mapleprimes.com/questions/228884-Getting-List-Of-Properties-And-Items-Of-A-Library

First 15 16 17 18 19 Page 17 of 19