platform: Unix synopsis: ttrr is a software package to do topology optimization of a truss with respect to robustness and redundancy.
TrussTopologyRobustRedundant
Contents
ttrr is a software package to do topology optimization of a truss with respect to robustness and redundancy — see literatur.
There are 2 parts of ttrr:
you can use ttrr_tools.py as a command line tool. for detail:
ttrr_tools.py -h
is a matrix to represent all nodal points with:
is a vector to represent all trusses:
are the load forces.
loads(:,k) are the forces for the k-th load case
choose the optimization routine: (optional)
forces_disturbed = compute_disturbed_forces(loads,dim,p,art=0)
calculates perturbed forces from loads and returns them forces_disturbed. For nl load cases in loads you get in forces_disturbed (2^dim)*nl load cases.
chooses the kind of the perturbation: (optional)
waehlt die Art die gestoerrten Kraefte zu erstellen (optional)
Author: Daniel Mohr.
Date: 2012-01-23, 2012-01-28, 2012-02-27 (last change)
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
kk = nodenumberfromcoordinates(nodes,x,y,z=0,eps=_epsilon) calculates the number of a node from the coordinates.
Author: Daniel Mohr Date: 2012-01-23, 2012-01-28 (last change) License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007
Copyright (C) 2012 Daniel Mohr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
[nodes,bars]=barsnodesongrid2d(gx0,gx1,gy0,gy1,nelx,nely,mounting=0)
creates all bars and nodes which make sense. gx0, gx1, gy0 and gy1 describes the edges (gx0,gy0), (gx0,gy1), (gx1,gy0) and (gx1,gy1) of the rectangular design space. In this rectangle it will be nelx*nely nodes calculated. With the assumption of an equidistant grid all meaningful bars are calculated. Bars which can be represent of others are ignored. For example a bar from (0,0) to (0,1) is ignored, if bars from (0,0) to (0,0.5) and from (0,0.5) to (0,1) exist.
is a matrix to represent all nodal points with:
is a vector to represent all trusses:
copyright + license
Author: Daniel Mohr.
Date: 2010-09-09, 2011-06-24, 2012-01-24 (last change)
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
[nodes,bars]=barsnodesongrid3d(gx0,gx1,gy0,gy1,gz0,gz1,nelx, nely,nelz,mounting=0,areawithoutnode=0,maxstablaenge=-1) [nodes,bars,mounting]=barsnodesongrid3d(gx0,gx1,gy0,gy1,gz0,gz1,nelx,
nely,nelz,areawithoutnode=0,mountingarea=0, maxstablaenge=-1)
creates all bars and nodes which make sense. If mountingarea is denoted the fixed nodes are also calculated and returned. gx0, gx1, gy0, gy1, gz0 and gz1 describes the edges (gx0,gy0,gz0), (gx0,gy0,gz1), (gx0,gy1,gz0), (gx0,gy1,gz1) (gx1,gy0,gz0), (gx1,gy0,gz1), (gx1,gy1,gz0) and (gx1,gy1,gz1) of the cuboid-shaped design space. In this cuboid it will be nelx*nely*nelz nodes calculated. With the assumption of an equidistant grid all meaningful bars are calculated. Bars which can be represent of others are ignored. For example a bar from (0,0,0) to (0,0,2) is ignored, if bars from (0,0,0) to (0,0,1) and from (0,0,1) to (0,0,2) exist.
is a matrix to represent all nodal points with:
is a vector to represent all trusses:
copyright + license
Author: Daniel Mohr.
Date: 2011-06-24, 2012-01-24, 2012-01-25 (last change)
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
[s,w,lengths] = ttrr(dim,nodes,bars,mounting,loads,smax,name=’test’, sigmamin=-1e8,sigmamax=1e8,density=2.7e3,redundancy=0,
opt=0,undisturbed_forces=0,sort=0,zlb=0,zub=0, scale_sigma=-1,scale_forces=-1)Parameters:
- dim : integer
- dimension 2 or 3 of the design space
- nodes : numpy.array
is a matrix to represent all nodal points with:
nodes(k,:) are the nodal points.
nodes(:,1) are the x-coordinates of the nodal points.
nodes(:,2) are the y-coordinates of the nodal points.
- nodes(:,3) are the z-coordinates of the nodal points.
(optional for dim = 2)
- bars : numpy.array
is a vector to represent all trusses:
- bars(s,:) are numbers of the trusses.
- bars(:,1) is the number of the first nodal point.
- bars(:,2) is the number of the second nodal point.
- mounting : numpy.array
- are the numbers of the nodal points as for the coordinate direction which are fixed.
- loads : scipy.sparse.lil_matrix
are the load forces.
loads(:,k) are the forces for the k-th load case
- smax : float
- is the maximal allowed cross section of a bar. If you do not need it, set it to a huge value — e. g. 1.
- name : string
- is a name for the problem. The result is saved in name.tar.bz2 in the current working directory.
- sigmamin : float
- lower limit for the allowed stress, e.g. compressive strength (e.g. -1e8 Pa for aluminium or -4e8 Pa for some steel)
- sigmamax : float
- upper limit for the allowed stress, e.g. tensile strength (e.g. 1e8 Pa for aluminium or 4e8 Pa for some steel)
- density : float
- density (e.g. 2.7e3 kg/m^3 for aluminium or 7e3 kg/m^3 for some steel)
- redundancy : integer
- describes the redundancy. If redundancy != 0 this function is not the right one. ttrr_redundant() will be called.
- opt : integer
choose the optimization routine: (optional)
0 glp_simplex (default, iff redundancy == 0)
1 glp_interior (only for redundancy == 0)
- 2-6 glp_mip (only for redundancy != 0, therefore not in this
function) see ttrr_redundant()
- undisturbed_forces : numpy.array
- is not used. It will be saved to the problem data.
- sort : integer
describes a feature: (optional)
0 not used (default)
- 1 additional constraints will be added to the optimization
problem. This is only useful for redundancy != 0. see ttrr_redundant()
- zlb : float
- is a lower bound for the objective function. As we are minimizing the result must not the best solution. Only values greater zero are considered. (optional)
- zub : float
- is a upper bound for the objective function. As we are minimizing the optimization problem may be not solvable. Only values greater zero are considered. (optional)
- scale_sigma : float
- scales sigmamin and sigmamax for the calculation. (optional)
- < 0.0 no scaling will be done (default)
- = 0.0 autoscaling will be done
- > 0.0 scaling will be done with this value
- scale_forces : float
- scales loads for the calculation. (optional)
- < 0.0 no scaling will be done (default)
- = 0.0 autoscaling will be done
- > 0.0 scaling will be done with this value
copyright + license
Author: Daniel Mohr.
Date: 2012-02-19 (last change)
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
[s,w,exitflag,zeit,lengths] = ttrr_redundant(dim,nodes,bars,mounting, loads,smax,name=’test’,sigmamin=-1e8,
sigmamax=1e8,density=2.7e3,redundancy=0, opt=2,undisturbed_forces=0,sort=0, zlb=0,zub=0, scale_sigma=-1,scale_forces=-1)Parameters:
- dim : integer
- dimension 2 or 3 of the design space
- nodes : numpy.array
is a matrix to represent all nodal points with:
nodes(k,:) are the nodal points.
nodes(:,1) are the x-coordinates of the nodal points.
nodes(:,2) are the y-coordinates of the nodal points.
- nodes(:,3) are the z-coordinates of the nodal points.
(optional for dim = 2)
- bars : numpy.array
is a vector to represent all trusses:
- bars(s,:) are numbers of the trusses.
- bars(:,1) is the number of the first nodal point.
- bars(:,2) is the number of the second nodal point.
- mounting : numpy.array
- are the numbers of the nodal points as for the coordinate direction which are fixed.
- loads : scipy.sparse.lil_matrix
are the load forces.
loads(:,k) are the forces for the k-th load case
- smax : float
- is the maximal allowed cross section of a bar. If you do not need it, set it to a huge value — e. g. 1. It is nessecary for the interaction of the integer values and the cross section values (for redundancy != 0).
- name : string
- is a name for the problem. The result is saved in name.tar.bz2 in the current working directory.
- sigmamin : float
- lower limit for the allowed stress, e.g. compressive strength (e.g. -1e8 Pa for aluminium or -4e8 Pa for some steel)
- sigmamax : float
- upper limit for the allowed stress, e.g. tensile strength (e.g. 1e8 Pa for aluminium or 4e8 Pa for some steel)
- density : float
- density (e.g. 2.7e3 kg/m^3 for aluminium or 7e3 kg/m^3 for some steel)
- redundancy : integer
- describes the redundancy. If redundancy == 0 this function is not the right one. ttrr() will be called. A value greater 0 describes a 1/redundancy redundancy — therefore redundancy >= 2 makes sense. A value lower 0 descirbes a 1-1/redundancy redundancy — therefore redundancy <= 2 makes sense. Obviosly 1/2 = 1-1/2 are the same redundancy. But the problem and the calculation are different. If there is no error the results are equal.
- opt : integer
choose the optimization routine: (optional)
0 glp_simplex (only for redundancy == 0)
1 glp_interior (only for redundancy == 0)
2-6 glp_mip (for redundancy != 0)
2 do not search greedy-solution (default)
3 search greedy-solution and go on
4 search greedy-solution, write greedy solution and go on
5 search greedy-solution and stop
- 6 search in parallel with 2 and 3 and stop
after solution is found with one method
- undisturbed_forces : numpy.array
- is not used. It will be saved to the problem data.
- sort : integer
describes a feature: (optional)
0 not used (default)
- 1 additional constraints will be added to the optimization
problem. This is only useful for redundancy != 0. If s_i describes a vector of the cross section of the i-th part structure the constraints are l^T s_i <= l^T s_{i+1} for adequate i with l the vector of the lengths of all bars.
- zlb : float
- is a lower bound for the objective function. As we are minimizing the result must not the best solution. Only values greater zero are considered.
- zub : float
- is a upper bound for the objective function. As we are minimizing the optimization problem may be not solvable. Only values greater zero are considered.
- scale_sigma : float
- scales sigmamin and sigmamax for the calculation. (optional)
- < 0.0 no scaling will be done (default)
- = 0.0 autoscaling will be done
- > 0.0 scaling will be done with this value
- scale_forces : float
- scales loads for the calculation. (optional)
- < 0.0 no scaling will be done (default)
- = 0.0 autoscaling will be done
- > 0.0 scaling will be done with this value
copyright + license
Author: Daniel Mohr.
Date: 2013-08-30 (last change)
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
[s,w,exitflag,zeit,lengths] = ttrr_robust(dim,nodes,bars,mounting, loads,smax,name=’test’,sigmamin=-1e8,
sigmamax=1e8,density=2.7e3,redundancy=0, opt=0,undisturbed_forces=0,p=0.1,art=0, sort=0,zlb=0,zub=0, scale_sigma=-1,scale_forces=-1)Parameters:
- dim : integer
- dimension 2 or 3 of the design space
- nodes : numpy.array
is a matrix to represent all nodal points with:
nodes(k,:) are the nodal points.
nodes(:,1) are the x-coordinates of the nodal points.
nodes(:,2) are the y-coordinates of the nodal points.
- nodes(:,3) are the z-coordinates of the nodal points.
(optional for dim = 2)
- bars : numpy.array
is a vector to represent all trusses:
- bars(s,:) are numbers of the trusses.
- bars(:,1) is the number of the first nodal point.
- bars(:,2) is the number of the second nodal point.
- mounting : numpy.array
- are the numbers of the nodal points as for the coordinate direction which are fixed.
- loads : scipy.sparse.lil_matrix
are the load forces.
loads(:,k) are the forces for the k-th load case
- smax : float
- is the maximal allowed cross section of a bar. If you do not need it, set it to a huge value — e. g. 1. It is nessecary for the interaction of the integer values and the cross section values (for redundancy != 0).
- name : string
- is a name for the problem. The result is saved in name.tar.bz2 in the current working directory.
- sigmamin : float
- lower limit for the allowed stress, e.g. compressive strength (e.g. -1e8 Pa for aluminium or -4e8 Pa for some steel)
- sigmamax : float
- upper limit for the allowed stress, e.g. tensile strength (e.g. 1e8 Pa for aluminium or 4e8 Pa for some steel)
- density : float
- density (e.g. 2.7e3 kg/m^3 for aluminium or 7e3 kg/m^3 for some steel)
- redundancy : integer
- describes the redundancy. After evaluating the special parameter the other functions are called. If redundancy == 0 the function ttrr() will be called and if redundancy != 0 the function ttrr_redundant() will be called.
- opt : integer
choose the optimization routine: (optional)
0 glp_simplex (for redundancy == 0) (default)
1 glp_interior (for redundancy == 0)
2-6 glp_mip (for redundancy != 0)
2 do not search greedy-solution
3 search greedy-solution and go on
4 search greedy-solution, write greedy solution and go on
5 search greedy-solution and stop
- 6 search in parallel with 2 and 3 and stop
after solution is found with one method
- undisturbed_forces : numpy.array
- If it is a scalar the perturbed forces are calculated with compute_disturbed_forces(). Otherwise loads are assumed to be the perturbed forces. The content of undisturbed_forces is not used. It will be saved to the problem data.
- p : float
- is a parameter for the calculation of perturbed forces. (optional) see compute_disturbed_forces()
- art : integer
- chooses the kind of the perturbation: (optional) see compute_disturbed_forces()
- sort : integer
describes a feature: (optional)
0 not used (default)
- 1 additional constraints will be added to the optimization
problem. see ttrr_redundant()
- zlb : float
- is a lower bound for the objective function. As we are minimizing the result must not the best solution. Only values greater zero are considered.
- zub : float
- is a upper bound for the objective function. As we are minimizing the optimization problem may be not solvable. Only values greater zero are considered.
- scale_sigma : float
- scales sigmamin and sigmamax for the calculation. (optional)
- < 0.0 no scaling will be done (default)
- = 0.0 autoscaling will be done
- > 0.0 scaling will be done with this value
- scale_forces : float
- scales loads for the calculation. (optional)
- < 0.0 no scaling will be done (default)
- = 0.0 autoscaling will be done
- > 0.0 scaling will be done with this value
copyright + license
Author: Daniel Mohr.
Date: 2012-02-19 (last change)
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/
Dependencies for ttrr and ttrr.cc, respectively:
Runtime dependencies for ttrr_tools.py to get graphical output (picture, movie, animation) you need some of the following programs:
- gnuplot http://www.gnuplot.info/
- POV-Ray http://www.povray.org/
- png2yuv from MJPEG http://mjpeg.sourceforge.net/
- ffmpeg2theora http://www.v2v.cc/~j/ffmpeg2theora/
- png2theora from libtheora http://www.theora.org
- FFmpeg http://ffmpeg.org/
- APNG Assembler http://sourceforge.net/projects/apngasm/
- convert from ImageMagick http://www.imagemagick.org/
At least for pictures you need gnuplot and/or POV-Ray. The frames for all movie and animation output are rendered with POV-Ray.
Author: Daniel Mohr.
Date: 2013-11-09 (last change).
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/