strange problem!

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
endryus
Posts: 47
Joined: Wed Apr 13, 2005 5:59 am
Location: freelance
Contact:

strange problem!

Post by endryus » Fri Jul 01, 2005 4:48 am

I have a cable 100 m long analyzed using 60 elements. All the elements have the same length.
If I set the element length as dx=100/60 I obtain wrong frequencies, while if i write dx=1.666667 I obtain exact results. In the first case in fact dx is calculated as 1.0 !!!
Any idea? (Please, don't tell "simply use the second way" as i have to perform many analyses and the dx must be automatically calculated) :)

endryus

lvy
Posts: 26
Joined: Tue Dec 14, 2004 8:22 pm
Location: Shanghai, China

Post by lvy » Fri Jul 01, 2005 7:01 am

you should use dx=100.0/60.0. When you use dx=100/60, program would round-off number.

endryus
Posts: 47
Joined: Wed Apr 13, 2005 5:59 am
Location: freelance
Contact:

Post by endryus » Fri Jul 01, 2005 7:35 am

it works. thanks!

endryus

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk » Fri Jul 01, 2005 8:35 am

if you leave off a .0 it assumes integer .. you were getting results of integer division .. if a real number always put the .0 to bbe safe.

silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Fri Jul 01, 2005 9:37 am

or even just .
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

endryus
Posts: 47
Joined: Wed Apr 13, 2005 5:59 am
Location: freelance
Contact:

Post by endryus » Sun Jul 03, 2005 11:16 pm

could be useful to write it in the documentation (if not already done)

endryus

silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia » Mon Jul 04, 2005 2:44 pm

i'll try to find a place for it in the introduction to Tcl.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

Post Reply