Closed Sadia328 closed 4 years ago
Which frame example are you talking about?
##################################################################
##################################################################
from openseespy.postprocessing.Get_Rendering import from openseespy.opensees import
import numpy as np
from math import asin, sqrt import matplotlib.pyplot as pl from mpl_toolkits.mplot3d import Axes3D
wipe()
model('Basic', '-ndm', 3, '-ndf', 6)
numBayX = 2 numBayY = 2 numFloor = 7
bayWidthX = 120.0 bayWidthY = 120.0 storyHeights = [162.0, 162.0, 156.0, 156.0, 156.0, 156.0, 156.0, 156.0, 156.0, 156.0, 156.0]
E = 29500.0 massX = 0.49 M = 0. coordTransf = "Linear" # Linear, PDelta, Corotational massType = "-lMass" # -lMass, -cMass
nodeTag = 1
zLoc = 0. for k in range(0, numFloor + 1): xLoc = 0. for i in range(0, numBayX + 1): yLoc = 0. for j in range(0, numBayY + 1): node(nodeTag, xLoc, yLoc, zLoc) mass(nodeTag, massX, massX, 0.01, 1.0e-10, 1.0e-10, 1.0e-10) if k == 0: fix(nodeTag, 1, 1, 1, 1, 1, 1)
yLoc += bayWidthY
nodeTag += 1
xLoc += bayWidthX
if k < numFloor:
storyHeight = storyHeights[k]
zLoc += storyHeight
geomTransf(coordTransf, 1, 1, 0, 0) geomTransf(coordTransf, 2, 0, 0, 1)
eleTag = 1 nodeTag1 = 1
for k in range(0, numFloor): for i in range(0, numBayX+1): for j in range(0, numBayY+1): nodeTag2 = nodeTag1 + (numBayX+1)*(numBayY+1) iNode = nodeCoord(nodeTag1) jNode = nodeCoord(nodeTag2) element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 1, '-mass', M, massType) eleTag += 1 nodeTag1 += 1
nodeTag1 = 1+ (numBayX+1)*(numBayY+1)
for j in range(1, numFloor + 1): for i in range(0, numBayX): for k in range(0, numBayY+1): nodeTag2 = nodeTag1 + (numBayY+1) iNode = nodeCoord(nodeTag1) jNode = nodeCoord(nodeTag2) element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 2, '-mass', M, massType) eleTag += 1 nodeTag1 += 1
nodeTag1 += (numBayY+1)
nodeTag1 = 1+ (numBayX+1)*(numBayY+1)
for j in range(1, numFloor + 1): for i in range(0, numBayY+1): for k in range(0, numBayX): nodeTag2 = nodeTag1 + 1 iNode = nodeCoord(nodeTag1) jNode = nodeCoord(nodeTag2) element('elasticBeamColumn', eleTag, nodeTag1, nodeTag2, 50., E, 1000., 1000., 2150., 2150., 2, '-mass', M, massType) eleTag += 1 nodeTag1 += 1 nodeTag1 += 1
numEigen = 7 eigenValues = eigen(numEigen) PI = 2 * asin(1.0)
#
plot_model()
plot_modeshape(5)
timeSeries('Linear', 1) pattern('Plain', 1, 1) load(72, 1, 0, 0, 0, 0, 0) analysis('Static')
fname = 'nodeDisp.txt' recordNodeDisp(fname)
analyze(10)
plot_deformedshape(fname, tstep = 10, scale = 200)
Did you try to close the plotting window showing the 3D Frame structure? Once you close the first window, the program will plot the mode shape.
Yes followed your advice and got the result in Python shell, but its giving error in spyder. Why is it so?
It should work equally well in Spyder. What is the error in Spyder?
This is the error.
It works without any error for me. Make sure you have installed the Spyder in the same virtual environment as OpenSeesPy. I ran the example script as it is.
Now it's working actually the problem was with graphics, So from preference>ipython console>graphics> I assigned graphics backend as automatic. Then it started working fine
On Wed, Sep 16, 2020, 6:38 PM Anurag Upadhyay notifications@github.com wrote:
It works without any error for me. Make sure you have installed the Spyder in the same virtual environment as OpenSeesPy. I ran the example script as it is.
[image: image] https://user-images.githubusercontent.com/35711550/93344870-6ad7e680-f7ef-11ea-80fd-c8a9ecb366f8.png
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/zhuminjie/OpenSeesPyDoc/issues/202#issuecomment-693410896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5EZPEXVMRJNIFWLWUAT4LSGC5TVANCNFSM4RERLFOQ .
I am new to this language and trying to run the folowing Frame example in Python Shell. But Unfortunately I am not able to get Figure of mode shape of Frame and figure showing nodes IDs. Rather I am just getting a 3D Frame structure. Could anyone guide me.
https://openseespydoc.readthedocs.io/en/latest/src/ModelRendering.html