Matlab program structure
plas_cal – parameter calculations
neo_drawfield_single – main function
- getting all inputs
- fetch sigma from neo_get_sigma
- tell the drawdafig to draw
- synchronization between drawing coordinates(x,y) and stress half space coodinates(x,y,z)
neo_get_sigma – stress fetching and maxps calculation
- get stress field based on the plane and field type
- call getblister/getboussinesq/getcerruti
- calculate max principal stress and it’s orientation
- 1-only draw maxps field, with orientation vector arrow
- 2-draw sigma11/22/33 and maxps
max principal stress can be calculate by simple using eig
[V, D] = eig(stress_matrix)
D is the principal stress matrix, with only sigma 11/22/33, to find the max one, simply compare the absolute value of them.
V is the orientation vector, or the axis transformation matrix.
x y z
x’ l1 m1 n1
y’ l2 m2 n2
z’ l3 m3 n3
l1 is the cosine of the angle between new x axis and old x axis. et al
draw orientation arrow
if you are plotting the yoz plane, you only need the second and third column of the V vector. If the max principal stress is on new x axis, use m1 and n1 vector (m1,n1) as the projection on the yoz plane.
(if you assume the orientation arrows have the length of 1 in 3d space system, m1 and n1 is the y and z coordinates of projection on yoz plane)
so drawing all arrows every 50 data points(per 0.5 on both axis), is to get all the m and n on all these points.
first try, I used line(x0,x1,y0,y1). and there is no way I can tell the direction.
Download a arrow() function from matlab official site,