Anthrazit

855 Reputation

11 Badges

5 years, 131 days

MaplePrimes Activity


These are replies submitted by Anthrazit

@Mac Dude 

As far as I can see now, a file based approach seems to be most promising.

There are at least 2 packages available for Maple that look interesting - JSON and XML.

I've never used any of those formats myself in a self written program, but what do you think about using them? I've actually also looked into IFC, which is an exchange format for buildings, but this looks a bit complicated and there is no package available in Maple yet.

@tomleslie 

Very good questions indeed.

What I have in mind, is the following situasjon.

Currently we are building up a set of calculation sheets for structural building designs, which mainly consists of a set of workbooks for the different materials (steel, concrete, timber). This workbooks calculate the design resistance of the different materials.

In addition we are doing the same thing for sections as well, where specific section data needs to be calculated.

On the other hand I've done a workbook which calculates the forces (shear forces, moments) and deflections.

I need to get over a set of specific data from the material side to the calculation side already (stiffness data, modulus of elasticity). But later on I will also need to transfer some calculation results (maximum and minimum moments, deflections) back to the material design to do the verification of the capacity.

Of course I could simply implement the whole bunch of calculation and dimensioning in one workbook, but I think that's not a good idea.

I like the idea of keeping things apart, and just transfer the necessary data.

One principle I'd like to follow is that the calculating worksheet/program itself decides which data is good for further processing, and make that available.

@Carl Love 

While I appreciate the idea, it seems a bit risky to me. In general I'd like to exchange data between specific sheets, and not all that are open at the moment.

Any other methods, like file based or copy/paste?

@dharr 

I tried to find what a single "Do" statement does, but the only reference to "do" was in a for...while clause.

@acer 

Thanks a lot for the explanation and the solution.

Probably interesting why I came up with the way I did that.

As far as I can remember, it was a copy paste operation from document mode. While a direct definition gets what you have (Unit('kN'*'m')), the result of a product of a force and a length keeps the units apart. But that does just apply to when you don't use the Units package. If you use the Units package, it will give you Joule as a unit.

Still not done with the problem, I'm opening a new thread.

https://www.mapleprimes.com/questions/230284-Units-again?sq=230284

@Carl Love

I think I've fixed it.

And the reason is connected to the problem you have described - though in the oppositve way. And I think actually your first sentence is wrong.

The main problem was that I loaded the Units package by using "with Units" - which loads the Units:-Simple package. The units Simple package apparently does NOT replace the basic arithmetic operations, or it doesn't do it good enough.

But when I changed the init procedure by using "with Units[Standard]" the error suddenly disappears and it seems to work now.

Somehow Maple thinks that there are still units in the matrix, even if i dropped them - but that will be something for Maplesoft to have a look into. I've filed a case on that issue. 

@Carl Love 

The reason why I switched to the unitless matrix was because of the error. Originally the matrix to be compared with comes with units. In addition it is just in the init of the loop that one of the matrices is zero.

I have so far not been able to recreate the problem with a simplified worksheet, so for now it needs to be fixed in the current workbook.

If you need to have a look at the code, open the lib/Main code in the workbook, and go to the end of the file. The 2 very last lines of the code in this file are the problem, I have put in comments there.

@Carl Love 

No, that gives the same error.

Here's the workbook in question, execute the entire workbook and go to the end of it.

Koyaanisqatsi.zip

@acer 

This is brilliant - though I didn't got it to work directly (store the variable in the matrix).

What I however managed to do was to do it indirectly - storing the contents of the variable in the matrix. Thus I can reread the values in the startup script to the variable.

storebetweensessions.mw

@acer

One of things I'm struggling with are tables, like...

S := table([2 = 45, 4 = 61])

They can't be shown with datatables as far as I can see. Btw., I am usually working with Workbooks nowadays, so if it's easier with workbooks that would do. 

Upon reboot of the PC the problem seems to have disappeared.

Strange, as I have tried multiple times yesterday, closing and starting Maple again, and the other component boxes worked without any problems.

@acer 

Thanks again for the thorough explanation.

From me as an user it is not important how things are done internally in the program, as long as I get what I want in the end. I've played around a bit more, and I think I finally found what I need.

The clue was to do a little bit more fiddling with the results in the end.

SumLoadcase[1 .. (), 1] := evalf(convert~(SumLoadcase[1 .. (), 1], 'units', Unit('m')));                # position on beam
SumLoadcase[1 .. (), 2] := evalf(convert~(SumLoadcase[1 .. (), 2], 'units', Unit('kN')*Unit('m')));        # M
SumLoadcase[1 .. (), 3] := evalf(convert~(SumLoadcase[1 .. (), 3], 'units', Unit('kN')));                # Q
SumLoadcase[1 .. (), 4] := evalf(convert~(SumLoadcase[1 .. (), 4], 'units', Unit('kN')));                # Qi
SumLoadcase[1 .. (), 5] := evalf(convert~(SumLoadcase[1 .. (), 5], 'units', Unit('kN')));                # Qk
SumLoadcase[1 .. (), 6] := evalf(convert~(SumLoadcase[1 .. (), 6], 'units', Unit('kN')/Unit('m')));        # load / m
  • the convert function not only makes consistent units across a cell, but also calculates the cells
  • the evalf function calculates the rest
  • the rest of the code is unchanged.

@Carl Love 

I do neither have the technical background nor the experience in Maple to comment on that, but Units are source of most of the problems we have had with Maple so far.

First 11 12 13 14 15 16 17 Page 13 of 18