Comments (1)
I forgot to add a support:
Now, the code is working without error.
import numpy as np
import calfem.core as cfc
# Topology matrix Edof
Edof = np.array([
[1,2,3,4,5,6], # Element 1
[1,2,3,7,8,9], # Element 2
[1,2,3,10,11,12], # Element 3
])
K = np.matrix(np.zeros((12,12)))
f = np.matrix(np.zeros((12,1)))
# Area and E-Modulus
E = 1000000.0 # E-Modulus kN/m²
A = 0.001 # Area m²
ep = [E,A]
#Element coordinates
ex1 = np.array([0., 0.]) # Element 1
ex2 = np.array([0., -4.]) # Element 2
ex3 = np.array([0., -4.]) # Element 3
ey1 = np.array([0., 0.]) # Element 1
ey2 = np.array([0., 0.]) # Element 2
ey3 = np.array([0., 0.]) # Element 3
ez1 = np.array([3., 0.]) # Element 1
ez2 = np.array([3., 3.]) # Element 2
ez3 = np.array([3., 6.]) # Element 3
# Element stiffness matrices
Ke1 = cfc.bar3e(ex1,ey1,ez1,ep)
Ke2 = cfc.bar3e(ex2,ey2,ez2,ep)
Ke3 = cfc.bar3e(ex3,ey3,ez3,ep)
# Assemble Ke into K
cfc.assem(Edof[0,:],K,Ke1)
cfc.assem(Edof[1,:],K,Ke2)
cfc.assem(Edof[2,:],K,Ke3)
# prescribed displacements in bc
bc = np.array([2, # has also a support
4,5,6,7,8,9,10,11,12])
f[1] = 100 # kN
f[2] = -100 # kN
a, r = cfc.solveq(K,f,bc)
from calfem-python.
Related Issues (20)
- Error : Unknown mesh format `msh22', using `msh' instead HOT 1
- Error in beam2ts() HOT 1
- Convert VTK file to OBJ with Meshio HOT 1
- Redesigning tutorial/code examples HOT 1
- Feature request: `calfem.__version__` HOT 2
- Problem with combinaison of blocks HOT 4
- Error in beam2ts() HOT 1
- [Question] Can spatial trusses also be calculated? HOT 1
- [Question] Can you use this library for Python 3.10? HOT 2
- Question regarding Licence & commercial usage HOT 2
- [Question] Is the direct stiffness method being utilized for the calculation of trusses? HOT 1
- The result is different when using `bar2e` and `bar3e` with the same truss system. HOT 2
- Creating optional dependencies HOT 2
- Inconsistent comments in the documentation HOT 2
- Documentation Inconsistency HOT 2
- Annoying info logs HOT 2
- Inquiry about the Development Status of CALFEM HOT 4
- Exporting data
- Exception: 'C:\Users\OZY~1.OZK\AppData\Local\Temp\tmp3_8p2440\tempGeometry.geo', line 0: syntax error (}) error when using mesh.create() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calfem-python.