Closed pxcandeias closed 2 years ago
Thanks! Choose whichever option you like.
-- Michael H. Scott, Ph.D. Professor, Structural Engineering Oregon State University cce.oregonstate.edu/scotthttps://exmail.oregonstate.edu/owa/redir.aspx?C=_F2i-PfJ4o6PTa3_ZQo4PE-QjaGSDCPQO_2ZTY0wP-CV6RK6qknXCA..&URL=https%3a%2f%2fcce.oregonstate.edu%2fscott o: 1-541-737-6996 OpenSees blog: www.portwooddigital.comhttps://outlook.office.com/mail/options/mail/messageContent/www.portwooddigital.com
From: Paulo Candeias @.> Sent: Sunday, May 9, 2021 3:06 PM To: zhuminjie/OpenSeesPyDoc @.> Cc: Subscribed @.***> Subject: [zhuminjie/OpenSeesPyDoc] TypeError due to operand mismatch in line 71 of Example 14.2.1. Cantilever 2D EQ ground motion with gravity Analysis (#233)
[This email originated from outside of OSU. Use caution with links and attachments.]
First time user of OpenSeesPy, first issue I am reporting.
After successfully installing openseespy on a conda environment in Linux Mint 20.1 64 bits, I downloaded the first example from the Earthquake exampleshttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fopenseespydoc.readthedocs.io%2Fen%2Flatest%2Fsrc%2FCanti2DEQ.html&data=04%7C01%7C%7C125e11aa010744a17fcc08d91336c04b%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C637561948141396808%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=VEEFHavDNVjzJYFmmkrmpv8%2B8Y7vevzk1S4qUDdxem0%3D&reserved=0.
I get a TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'float' from the code in line 71:
freq = eigen('-fullGenLapack', 1)**0.5
which is perfectly natural since, according to the documentationhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fopenseespydoc.readthedocs.io%2Fen%2Flatest%2Fsrc%2Feigen.html%3Fhighlight%3Deigen&data=04%7C01%7C%7C125e11aa010744a17fcc08d91336c04b%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C637561948141406807%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UGUsXux5VTJaGNvGsG9sv6knAtcEc5CYq5MrXif7J8Y%3D&reserved=0, the eigen command returns a list, which is not compatible with the Python exponentiation operationhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.python.org%2F3%2Flibrary%2Foperator.html%23mapping-operators-to-functions&data=04%7C01%7C%7C125e11aa010744a17fcc08d91336c04b%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C637561948141406807%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tiiFCBeIdstQVnstjCQCELj8TGjQPO79p33RCcgPf%2FY%3D&reserved=0 (**).
Apart from the obvious need to correct the example, in order to run without errors, what do you think (remember that I am newbie!) will be the best option?
freq = eigen('-fullGenLapack', 1)[0]**0.5
freq = [v**0.5 for v in eigen('-fullGenLapack', 1)]
freq = np.asarray(eigen('-fullGenLapack', 1))**0.5
Looking forward for a solution.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzhuminjie%2FOpenSeesPyDoc%2Fissues%2F233&data=04%7C01%7C%7C125e11aa010744a17fcc08d91336c04b%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C637561948141416800%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BkrnySly39%2FSb%2BLmQXPscjTDjOb4akq6w6At24CImbo%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADEIU7B47UMYRP2WZNT2J7TTM4BPXANCNFSM44PWRJ5Q&data=04%7C01%7C%7C125e11aa010744a17fcc08d91336c04b%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C637561948141416800%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2FXgu02W7wIjOTGEeHBbGoNlxgFKwTq3MKAoVkea29l8%3D&reserved=0.
Being so, I will go with option 1 above. It makes more sense to me since two lines below (line 73)
rayleigh(0., 0., 0., 2*dampRatio/freq)
variable freq
is required to be a single value.
First time user of OpenSeesPy, first issue I am reporting.
After successfully installing openseespy on a conda environment in Linux Mint 20.1 64 bits, I downloaded the first example from the Earthquake examples.
I get a
TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'float'
from the code in line 71:which is perfectly natural since, according to the documentation, the
eigen
command returns a list, which is not compatible with the Python exponentiation operation (**
).Apart from the obvious need to correct the example, in order to run without errors, what do you think (remember that I am newbie!) will be the best option?
Looking forward to see a solution.