Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #245

Open
MunsakaPKM opened this issue Feb 8, 2024 · 0 comments
Open

Error #245

MunsakaPKM opened this issue Feb 8, 2024 · 0 comments
Labels

Comments

@MunsakaPKM
Copy link

MunsakaPKM commented Feb 8, 2024

i am getting an error when i try to run the example about creating a truss in the Load cases in the documentation:

error message : C:\ProgramData\miniconda3\python.exe "C:\Users\Bukkale\PycharmProjects\pythonProject12\Environment(Urban, Rural, and Natural).py"
Traceback (most recent call last):
File "C:\Users\Bukkale\PycharmProjects\pythonProject12\Environment(Urban, Rural, and Natural).py", line 17, in
ss.add_element_grid(x[1:-1][::2], np.ones(x.shape) * y.max(), element_type=element_type)
File "C:\Users\Bukkale\AppData\Roaming\Python\Python311\site-packages\anastruct\fem\system.py", line 298, in add_element_grid
raise FEMException(
anastruct.basic.FEMException: ('Wrong parameters', 'x and y should have the same length.')

Process finished with exit code 1

code :

 from anastruct import SystemElements
import matplotlib.pyplot as plt
import numpy as np
ss = SystemElements()
element_type = 'truss'
# create triangles
x = np.arange(1, 10) * np.pi
y = np.cos(x)
y -= y.min()
ss.add_element_grid(x, y, element_type=element_type)
# add top girder
ss.add_element_grid(x[1:-1][::2], np.ones(x.shape) * y.max(), element_type=element_type)
# add bottom girder
ss.add_element_grid(x[::2], np.ones(x.shape) * y.min(), element_type=element_type)
# supports
ss.add_support_hinged(1)
ss.add_support_roll(-1, 2)
# loads
ss.point_load(node_id=np.arange(2, 9, 2), Fy=-100)
ss.solve()
ss.show_structure()
@smith120bh smith120bh added the bug label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants