Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline RFreund  
#1 Posted : 02 April 2015 18:45:37(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Attached is a long calc, but I you will see a section toward the middle where I have pulled a function out of a line. I have a trace error on the input parameter H.T# which assigns itself to itself and thus causes an error message. Can anyone help explain. If the file if clouding my problem I can try to reduce this later.

Thanks in advance!!
File Attachment(s):
ER - Braced Excavation test_3.sm (155kb) downloaded 18 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline RFreund  
#2 Posted : 06 April 2015 04:34:47(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Attached is the function removed from the rest of the calculation. I just can't seem to figure this out. When the function is in a "line" it returns that H.T# is not defined. If you take the function out of the line it seems to operate fine. This is driving me nuts Wallbash
File Attachment(s):
Function Error.sm (15kb) downloaded 15 time(s).
Offline RFreund  
#3 Posted : 06 April 2015 19:58:08(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Ioan -> thanks for your response!

I used to do as you describe. However, I noticed Martin had used the function parameters for input and output. See here for his explanation.

However it seems to be causing me problems for some reason I don't understand. Attache is another example.

Is it possible for me to edit the name of this thread? It should really be function input/output parameter error or something along those lines.
File Attachment(s):
Function with output parameter.sm (44kb) downloaded 13 time(s).
Offline RFreund  
#4 Posted : 06 April 2015 22:35:47(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Very odd that I still get a result when I put the function back into a "Line".
See attached
File Attachment(s):
Function in line error.sm (45kb) downloaded 14 time(s).
Offline RFreund  
#5 Posted : 07 April 2015 00:34:38(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Back to my original problem.. I just can't seem to get this one.
File Attachment(s):
ER - Braced Excavation_1.sm (854kb) downloaded 14 time(s).
Offline RFreund  
#6 Posted : 07 April 2015 17:37:08(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Ioan -> I really appreciate you taking a look at this. thank you.

Regarding my "in-line" problem:
Quote:
The second one has errors in its body. ---> for 2,...

The only time that function should run is if there is 2 or more rows. Due to the d.brc = 1 if statement check. However disregarding this. I don't understand why the functions when separated work fine. However when put on the same "line" they do not work. See attached.


Quote:
I propose you to operate, by your self, a full program refactoring, keeping it simply, readable, to test each function individually and to assembly them after.

Yes this is very true, I do need to get a function started, working, then keep it working. I do though normally start with the program as not a function, such as this one and it was working. Then when I assembled it, I started having issues.

Quote:
use of illicit matrix definition: MK.a#:matrix(0,6)

How else do you build functions? I adapted this technique from Martins FEA Beam Prepocessor. It is a way to "build" matrices. I had thought it was good practice to define a Matrix of zero size then fill it with the necessary information, no?

Quote:
unnecessarily (only cosmetic) programming lines; for me it is not very clear the work of unnecessarily "programming lines"

Could you elaborate on this? I do want to improve this.

I will try to re-write this. I don't mean to be risky...Help
File Attachment(s):
Functionerror bis - in-line error.sm (31kb) downloaded 12 time(s).
Offline RFreund  
#7 Posted : 08 April 2015 01:27:42(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Thanks ioan.

I have retooled and now it seems to be working. Although there are nested functions. Is this ok?
I still think I like the idea of 0 matrix, but if there is a better way to build matrices securely, I'm all ears.

Edited by user 08 April 2015 03:12:08(UTC)  | Reason: Revised Attachment

File Attachment(s):
ER - Braced Excavation.sm (146kb) downloaded 16 time(s).
Offline RFreund  
#8 Posted : 09 April 2015 17:01:03(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Ioan -> No, not intrusive at all, you have great advice.

I like the idea of initializing a "zero matrix" because it ensures that the variable is empty and now I can add to it. Although maybe this is poor thinking. I like the idea of functions because I can keep calculations all one page in a condensed format and not have to worry too much about global vs local variables.

I still am not sure what you are referring to as cosmetic treatment.

thanks again!
Offline RFreund  
#9 Posted : 10 April 2015 16:12:42(UTC)
RFreund


Rank: Advanced Member

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

Was thanked: 19 time(s) in 17 post(s)
Thanks Ioan, I understand now. The term "cosmetics" does make sense. However, those lines help me keep my mind organized Good

I
Users browsing this topic
Guest
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.