FINITE ELEMENTS
SYMBOLIC PROGRAMMING IN MAPLE
Artur Portela
Elastics Example 3: Symbolic Variables
> restart:
> libname := "C:/mylib/fem", libname:
> interface(verboseproc=3):printlevel:=3:
> with(Plotter):
> with(Cst_fem): with(G_cst_fem):
Data Preparation
The best way to input data for Cst_fem is to use the procedure read_save_data , which reads a file with the following structure:
*elements* [element, node1, node2, node3, material] 1 1 2 4 1 2 4 3 1 1
*nodes* [node, x, y] 1 1 1 2 0 1 3 1 0 4 0 0
*materials* [material, Young modulus, Poisson coef, specific weight, thickness] 1 210000000000. .28 -77000. 0.01
*forces* [node, fx, fy] 1 0 10 2 0 10
*constraints* [node, direction(x, y or angle measured from x), displacement] 4 x 0 4 y 0 3 90 0 2 0 0
*control* [title, plane stress/strain, point forces, self weight] title Plate Under Uniaxial Traction plane stress point forces
*end*
The data blocks, with the respective keyword on the top, can be given in any order.
Alternatively, data can be given manually through the definition of the variables: title , plane_case , control , nods , mat_props , elems , forces and bdr_conds . See bellow the structure of these variables.
>
Symbolic Variables
For the sake of simplicity, start reading the data of example 1
> read_save_data();
read data from a file (y/n) ? y;
file name: "dat_test4.txt";
save data into a file (y/n) ? n;
> tcase;plane_case;control;nods;mat_props;elems;forces;bdr_conds;
Redefine this data with symbolic variables :
> nods:=[[l,l],[0,l],[l,0],[0,0]]:mat_props:=[[E,nu,b,1]]:forces:=[[1,0,P],[2,0,P]]:
> cst_fem(yes);
Print displacements :
> disp;
Print element stresses :
> e_sigma;
Print nodal stresses :
> n_sigma;
Print reactions :
> reacts;
Print total strain energy:
> total_strain_energy;
In order to display graphics, it is necessary to substitute symbolic variables by numeric values.