elastics1.mws

FINITE ELEMENTS

SYMBOLIC PROGRAMMING IN MAPLE

by Artur Portela

Elastics Example 1: Traction of a Square Plate

> restart;

> interface(verboseproc=3):printlevel:=3:

> libname := "C:/mylib/fem", libname;

libname :=

> 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.

>

Traction of a Square Plate

As the first problem, consider the case of a square plate, with 2 m of length and 0.01 m thick, under the action of a load of 20 kN/ m^2 , uniformly distributed on the sides perpendicular to the y direction. Since the problem is symmetric, a quarter of the plate, the first quadrant, will be analysed, with the symmetry boundary conditions. The material properties are E= 210* 10^6 kN/ m^2 and nu = .28 .

Since the state of stress of the plate is constant, as is the stress field of the triangular finite element, the finite element analysis will lead to the exact solution. Hence, the discretization of the plate needs to consider only 2 finite elements, which correctly describe the plate geometry. Note that, in the finite element mesh, the distributed load is replaced by the equivalent nodal loads.

> read_save_data();

read data from a file (y/n) ? y;

file name: "dat_test4.txt";

save data into a file (y/n) ? y;

file name: "check.txt";

This is the finite element data just red :

> tcase;plane_case;control;nods;mat_props;elems;forces;bdr_conds;

[

[[1, 1], [0, 1], [1, 0], [0, 0]]

[[210000000000., .28, -77000., .1e-1]]

[[1, 2, 4, 1], [4, 3, 1, 1]]

[[1, 0, 10], [2, 0, 10]]

[[4, x, 0], [4, y, 0], [3, 90, 0], [2, 0, 0]]

The first thing to do is to check data

> plot_problem_data();

[Maple Plot]

> plot_mesh();

[Maple Plot]

After checking data, run the finite element procedure

> cst_fem("anything here will print intermediate results");

Plane*stress*analysis

`Initializing global matrices:`

matrix([[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0...

`Assembling element`*[1, 2, 4, 1]*`:`

matrix([[1139322916., 0, -1139322916., 319010416.5,...

`Assembling element`*[4, 3, 1, 1]*`:`

matrix([[1549479166., 0, -1139322916., 319010416.5,...

`Assembling point forces:`

vector([0, 10, 0, 10, 0, 0, 0, 0])

`Forcing exact boundary conditions:`

matrix([[1549479166., 0, 0, 319010416.5, 0, 4101562...

vector([0., 10., 0, 10., 0, 0., 0, 0])

`Nodal displacements (disp):`*[u[x], u[y]]

[-.2666666666e-8, .9523809524e-8], vector([0., .952...

`Reactions (reacts):`*[node, direction, [reaction]]...

[4, x, [-.1000000000e-8]], [4, y, [-9.999999996]], ...

`Equilibrium:  `*Sigma*F[x]*`= -.3000000000e-8`, ` ...

`Element stresses (e_sigma): `*[[sigma[x], sigma[y]...

[vector([.1000000000e-6, 1999.999998, 0.]), [1999.9...
[vector([.1000000000e-6, 1999.999998, 0.]), [1999.9...

`Nodal stresses (n_sigma): `*[sigma[I], sigma[II], ...

[1999.999998, .2000000000e-6, 90.00000000, .9523809...
[1999.999998, .2000000000e-6, 90.00000000, .9523809...

`Total strain energy:  `

.9523809510e-7

`Cpu time:  1.321 seconds`

The results obtained are in the following variables, which have the structure:

`Nodal displacements (disp):`*[u[x], u[y]]

`Element stresses (e_sigma): `*[[sigma[x], sigma[y]...

`Nodal stresses (n_sigma): `*[sigma[I], sigma[II], ...

`Reactions (reacts):`*[node, direction, [reaction]]...

`Total strain energy (total_strain_energy):`

> #disp;e_sigma;n_sigma;

> plot_displacements();

[Maple Plot]

It is simple to zoom in any window: ([lower left corner coordinates of the window],[upper right corner coordinates of the window])

> plot_displacements([0.8,-0.1],[1.1,0.1]);

[Maple Plot]

> animate_displacements();

[Maple Plot]

Plot element principal stresses

> [seq(e_sigma[i][2],i=1..nops(e_sigma))];

[[1999.999999, .3000000000e-6, 90.00000000], [1999....

> plot_stresses(%);

plot title: "Element Principal Stresses";

[Maple Plot]

Plot nodal principal stresses

> [seq(n_sigma[i][1..3],i=1..nops(n_sigma))];

[[1999.999998, .2000000000e-6, 90.00000000], [1999....
[[1999.999998, .2000000000e-6, 90.00000000], [1999....

> plot_stresses(%);

plot title: "Nodal Principal Stresses";

[Maple Plot]

Zoom in

> plot_stresses([seq(n_sigma[i][1..3],i=1..nops(n_sigma))],[0.9,0.8],[1.1,1.15]);

plot title: "Nodal Principal Stresses";

[Maple Plot]

>