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 »

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 »

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 »

it works. thanks!

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

Post by fmk »

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 »

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 »

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 »

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