Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline RFreund  
#1 Posted : 01 February 2015 21:55:30(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Relevant links:

http://smath.info/file/NESDC
Thank you Martin Kraska

http://en.smath.info/for...culations.aspx#post12778
(Look toward the end)

Attached is a deconstructed version of the preprocessor with notes

Modeller output
What does the 8th column represent?

What is "sym" template?Does it create a beam that is symmetric about that line or is it a 'fixed' support (i.e. fixed against rotation)?

What is the difference between t.hinge and t.cφ ?
In t.cw and tcφ what does the 'c' stand for?

Preprocessor

FYI-
I changed EI (blue) to E##*I## so that multiple inputs on one page should not cause a problem.
updated 'x' to x##.
EI is now EI# and EI() is EI#()
I ran out of time but will continue to update terms using # so that they are not affected by 'global variables'.
E# stands for Element but I will probably modify this in the future as E is generally used for Modulus of elasticity (<- note to myself).

In BeamPre(model, E#, N#)
Why do you have E# and N# as arguments (is arguments the correct term to use here?) when they never get input (or maybe I should say defined) outside of the function? Is this for graphing purposes? Or maybe so the function outputs these values?

Where is Absmax defined? (I had wrote this down as a question but now that I'm reviewing can't seem to find why I wrote this down....)

Comment: Very interesting (brilliant/elegant) way to handle the distributed load. I wish my brain could see these mathematical ways as easy as you make it seem.

Why do you not organize the the element matrix through sort at the end? There is a potential for the elements to be out of order, no? Maybe this is OK? I it possible to sort a matrix based on a certain matrix row (csort I believe)? I seem to get odd results where the start node and end node are 'reversed' in the element matrix when I start adding hinges. Is this ok?

What is the 7th column used for in the N# matrix?

General:
Why/when do you use eval()?
Are stack and augment essentially the same thing, except stack creates a rows and augment creates columns?
range creates a column matrix. Is there a similar command to create a row matrix?
File Attachment(s):
FEA Beam - Decon - Preprocessor.sm (83kb) downloaded 78 time(s).
Offline mkraska  
#2 Posted : 03 February 2015 01:09:33(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,495
Germany

Was thanked: 796 time(s) in 509 post(s)
8th column of the modeler output is a unique object ID

template sym represents a constraint phi=0, i.e. no rotation but free displacement. This is equivalent to a symmetry constraint or can be used together with a displacement constraint w=w.0 to make an encastre condition (built-in)

t.hinge is the template number of the hinge symbol (circle)

t.cphi is the template number of the constraint phi=0 symbol. The c stands for constraint (as the description string tries to say)

The arguments E# and N# are output arguments, to be recognized by assignment to them inside the function.

AbsMax is defined in the Postprocessing area region (collapsed in the cloud version)

Take care that the Element matrix has the left node I in column 1 and the right node J in column 2.

As far as I recall, there is no need for the nodes or elements to be in order from left to right inside the N or E matrix. Discontinuities in node numbering will result in larger bandwidth of the global matrix but I don't know if that is an issue for the linear solver (matrix inversion).




In the seventh column of the N matrix you can specify a rotation value, if the sixth column is set to 1. This sets a non-homogeneous rotational constraint. This is not supported in the modeler interface.

I use eval(), wherever I want to enforce numeric evaluation, mainly for performance, mostly inside loops in order to avoid nested symbolic expressions.


You are right with stack() and augment()

If you want to create a row vector with range, simply apply transpose.

Thanks for your comment on the handling of distributed loads. This results from direct application of Finite Element design techniques to the given problem. It is essentially an enhanced strain element with condensation of internal degrees of freedom using the given distributed loads. Thus the element can represent trapezoidal loads with just four degrees of freedom per element, where you would normally have 6 DOFs in the Ansatz function (four times integrated linear function gives a fifth degree polynom with 6 constants).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 03/02/2015(UTC)
Offline RFreund  
#3 Posted : 05 February 2015 06:00:10(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Thanks for the response Martin. I didn't realize you had replied already (forgot to set the email remainder).

How do you recognize when you have nested symbolic expressions? I'm missing something here, it just isn't 'clicking'.

So if you want a built in constraint (i.e. Fixed), you would have a support (aka t.cw) and sym (aka t.cphi) at the same 'x' location (and thus the same node), correct?

What are your thoughts on allowing "global variables" to be use inside a function (The function is not self-contained)? I like that you can call on outside functions from with in a function. But I'm starting to think that it would be better if you had to deliberately "promote" a variable to be enabled for use inside a function if it is defined outside that function.

Quote:
The arguments E# and N# are output arguments, to be recognized by assignment to them inside the function.

Do you have to include these as function arguments (aka inputs)? Could you not just output the information via a system of equations? What is the reason to do this one way over the other?

Thanks again!
Offline mkraska  
#4 Posted : 05 February 2015 15:09:20(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,495
Germany

Was thanked: 796 time(s) in 509 post(s)
One example for nested expressions is if you build a matrix in a loop with stack(), then no intermediate simplification is made, except if you apply eval().

You are right in how to make a fixed constraint. If you want to convey global parameters in a clean way, you might setup a list or vector of key=value pairs, hand that over as a regular input argument and evaluate them inside the function using Assign(). Didn't test this, but it might work.

If you by some reason don't like output arguments, then feel free to modify the functions accordingly. I feel it a bit cumbersime to extract the individual result items to new variables by individual assignment operations. But you are right, I could create a system of equations and apply Assign() to it.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline RFreund  
#5 Posted : 08 February 2015 18:15:42(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Quick question:
Is there a good way to "recognize and strip" units? Currently we define what units we are working in. I would like to directly input the values into the function I would need to recognize which units are being used, then strip them, then re-apply them at the end.

Thanks again.
Offline RFreund  
#6 Posted : 08 February 2015 21:47:24(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Can you take a look at the attached (scroll down to you see big red text with "problem with cases". I seem to be having a problem with cases(). Maybe there is a better way in general to handle this situation.

Thanks again for your help Martin.
File Attachment(s):
FEA Beam - Decon - Preprocessor.sm (126kb) downloaded 40 time(s).
Offline Davide Carpi  
#7 Posted : 08 February 2015 22:19:44(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,192
Man
Italy
Location: Italy

Was thanked: 1105 time(s) in 726 post(s)
Switch the optimization to numeric (use an eval when you are inside a loop), otherwise you can't mix numbers and strings...

moreover matrix(#,0) is not supported (0 columns) and is converted by SMath into a mat(#,0) - that is a broken mat() function


About units, I think you may define "design base units (lenght/mass/force)" on the top of your worksheet, like in a common FEM program...

Edited by user 08 February 2015 22:35:29(UTC)  | Reason: Not specified

File Attachment(s):
FEA Beam - Decon - Preprocessor.sm (128kb) downloaded 34 time(s).
Davide Carpi attached the following image(s):
2015-02-08 20_26_18-SMath Studio Desktop - [FEA Beam - Decon - Preprocessor.sm].png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline RFreund  
#8 Posted : 09 February 2015 04:02:28(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Davide, Thanks for the reply.

First let me establish the problem.
I have and input matrix w.p# in which you can define a partial uniform load, a triangular load or a trapezoidal load. However, I need to break down any trapezoidal loads into a uniform load and a triangular load. Therefore I need create a new matrix (change the origonal) which will have 2 columns for every trapezoidal load.

I see your adjustments and at first I had done this. However this creates a "0" column vector for each load, whether it was uniform, triangular or trapezoidal. I was trying to avoid these extra '0' loads by stacking and defining the matrix as "nothing". Similar to how Martin initializes a matrix E=matrix(0,5) and then stacks it will other matrices. I attached another worksheet for reference but it appears the problem is the 'nothing' matrix.


File Attachment(s):
Beam FEA - partial load cases.sm (34kb) downloaded 48 time(s).
Offline Davide Carpi  
#9 Posted : 09 February 2015 17:55:00(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,192
Man
Italy
Location: Italy

Was thanked: 1105 time(s) in 726 post(s)
You're welcome Good

Excuse me, but as an engineer your approach seems to me unnecessarily complicated Oh my

Why you don't use something like in the attachment? [you may also extend it with a 2nd if statement to check if the load is triangular]

Edited by user 09 February 2015 20:44:19(UTC)  | Reason: wrong hint deleted

File Attachment(s):
Beam FEA - partial load cases.sm (36kb) downloaded 37 time(s).
Davide Carpi attached the following image(s):
2015-02-09 15_58_53-SMath Studio Desktop - [Beam FEA - partial load cases.sm].png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline RFreund  
#10 Posted : 10 February 2015 05:13:28(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Ahh!Wallbash

I had thought the number of columns needed to match for the augment() function. Thanks again. I will probably add one for the triangular load case, just to avoid the 0 load matrix column.

Side question - what do you typically use for your engineering calculations? I mean for a substitute to hand calcs, not FEA packages? I've started to learn python as I'd like to see what that has to offer. I like the potential of SMath, in that I'd like something that you can create a calc package that reads like a report (that's my problem with excel) and that is easy to print and navigate. The main problem right now is handling large data tables and speed. Anyway, thanks again.

Offline RFreund  
#11 Posted : 15 February 2015 18:42:29(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Davide, Hopefully my question did not offend you..., sorry if I did.

I receive another odd error using cases.
First error - see attached, BEAM FEA - partial load cases_2
cases error

Second Error see attached, BEAM FEA - partial load cases_3
cases error 2

I suspect they are related but not sure how.


Side question -> is there a way for my image to show when using dropbox? Rather than having to click on the 'broken link' image?




File Attachment(s):
Beam FEA - partial load cases_2.sm (11kb) downloaded 45 time(s).
Beam FEA - partial load cases_3.sm (30kb) downloaded 41 time(s).
Offline Davide Carpi  
#12 Posted : 16 February 2015 01:32:24(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,192
Man
Italy
Location: Italy

Was thanked: 1105 time(s) in 726 post(s)
I'm not offended, I've just postponed the answer and... forgot about it Biggrin

Excluding (commercial) FEA packages, there are useful free tools here and there, some excel spreadsheet, and there is also some good free FEA program (like OpenSees).

IMHO the main issue of self-made programs is that if you don't have feedbacks from a community, you spend a lot of time and energy for something that might contain a lot of hidden bugs and probably will be set aside in favor of something else when you will have to modify or expand it to some particular case (because the complexity, the time available, ...)


About the latest issues, the key is again the optimization. You have to set it to numeric (using eval() where you can't do it for some reason)

cases() is nothing else that an interface to a nested if/else structure. Because if/else is not supported by SMath's integrals, I've extended cases with a mathematical/boolean version of that nested structure; this is triggered when you choose the symbolic optimization. Thus If cases() with symbolic optimization contains elements that cannot be summable (matrices with different sizes, strings, etc), the summation fails and an error is returned.


About dropbox, the reason because we can't see the images is probably because the link is the link to a page that contains an image, and not to the image itself; to have a link to the image, replace ?dl=0 with ?raw=1

cases error


Edited by user 16 February 2015 01:55:42(UTC)  | Reason: Not specified

If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline RFreund  
#13 Posted : 16 February 2015 05:28:41(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Excellent! thank you again Davide!
Offline RFreund  
#14 Posted : 21 March 2015 19:32:28(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
What is the best way to implement this. For some reason I can't seem grasp the best way to insert or remove rows from matrices (which is a big problem for most programs!)...

If I understand correctly the FEM beam function... to create a "Fixed" support I need to have a t.cw and a t.cphi at the same position. Therefore I need to create a new matrix with an extra support "type" at the same position. What is the best way to do this? See attached for portion of the routine that I am referring to.

Thanks!
File Attachment(s):
Beam FEA - Support inserting into matrix.sm (9kb) downloaded 48 time(s).
Offline mkraska  
#15 Posted : 22 March 2015 11:30:01(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,495
Germany

Was thanked: 796 time(s) in 509 post(s)
Don't know if it is the best way to do it, but specifying the complete matrix rows in the cases statement works.
File Attachment(s):
mkraska attached the following image(s):
beamfea.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline RFreund  
#16 Posted : 22 March 2015 19:48:39(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Thank you Martin!
Offline RFreund  
#17 Posted : 23 March 2015 16:36:17(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
Well here it is. Not sure how stable it is as I have only limited testing. I wish the graph was easier to move around.
My next effort with be to allow multiple E, I inputs, but for now I will use this mostly for simple span beams.
I also want to create a "steel beam size optimization routine". The problem though is importing the steel beam sizes and properties. The matrix is just so large that it really slows the calculation down.

File Attachment(s):
BeamFEA Functions.sm (189kb) downloaded 53 time(s).
BeamFEA_1 Input-Result.sm (40kb) downloaded 52 time(s).
Offline Ernesto  
#18 Posted : 28 March 2015 23:59:39(UTC)
Ernesto


Rank: Advanced Member

Groups: Registered
Joined: 03/02/2014(UTC)
Posts: 67
Nicaragua

Was thanked: 13 time(s) in 11 post(s)
RFreund, any instructions on how to use those files? I just get errors without changing any parameters, seems something is missing.
Offline RFreund  
#19 Posted : 29 March 2015 15:30:33(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 285
United States
Location: IL

Was thanked: 18 time(s) in 16 post(s)
I will work on some instructions, sorry about this.

They need to be used in the same work sheet. I've attached them in the same sheet. The idea is that the input and result can be used multiple times on a page, for multiple beams. In order to get the graph to work you must click on it, then right click, select template "T", right click again, select predefined layout "P". I actually don't use the graph, and am working on trying to track the reactions at the reactions (more on this later).
I seam to have left out the input graph (included in the attached)

Things still to impliment:
1. There are variables used in the functions which are still "dangerous" because they can be used outside of the function and cause errors. Namely I have found "l" (lower case "L"Wink to be an issue.

2. Allow input for a change in E and I for different spans. I'm not sure the best way to setup input for this. Right now I really wanted something for simple beams.
File Attachment(s):
BeamFEA Functions - Input and Result.sm (239kb) downloaded 78 time(s).
Offline Ernesto  
#20 Posted : 31 March 2015 00:53:05(UTC)
Ernesto


Rank: Advanced Member

Groups: Registered
Joined: 03/02/2014(UTC)
Posts: 67
Nicaragua

Was thanked: 13 time(s) in 11 post(s)
Wierd that it's not working for me. When I combine the 2 files from your previous post, it won't work, and when I try the last file you posted, it crashes on me. Confusion Maybe it's my laptop.
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.