Solving bending of a plate with a hole I came up with the problem of plotting empty matrix elements.
I got results of deflection in matrix m
(here is simplified code where m
contains results of previous calculations, dx and dy are size of element in finite difference method used to calculate deflections):
dx = 20;
dy = 20;
m = {{-0.529905, -0.439313, -0.351192, -0.309829, -0.277381, \
-0.279626, -0.305599, -0.310473, -0.333545, -0.414396, -0.500825}, \
{-0.504563, -0.366099, -0.234522, -0.213233, -0.158445, -0.169855, \
-0.230793, -0.203875, -0.195498, -0.316359, -0.445873}, {-0.449676, \
-0.271052, 0, 0, 0, 0, 0, 0,
0, -0.180155, -0.336509}, {-0.386551, -0.22993, 0, 0, 0, 0, 0, 0,
0, -0.0506295, -0.164954}, {-0.247702, -0.0424227, 0, 0, 0, 0, 0,
0, 0, 0.450029, 0.191015}, {-0.0460756, 0.254853, 0, 0, 0, 0, 0,
0, 0, 1.11752, 0.648574}, {0.16454, 0.598028, 0, 0, 0, 0, 0, 0, 0,
1.79007, 1.07852}, {0.284961, 0.848659, 0, 0, 0, 0, 0, 0, 0,
2.21468, 1.30024}, {0.182955, 0.637385, 0, 0, 0, 0, 0, 0, 0,
1.76687, 1.10412}, {-0.00309753, 0.348789, 0.751991, 1.14756,
1.11667, 1.73377, 1.72763, 2.34391, 1.83049, 1.29127,
0.792653}, {-0.193837, 0.0610459, 0.354048, 0.623964, 0.766462,
1.0777, 1.20698, 1.41556, 1.17983, 0.823121, 0.467826}};
I gave x and y positions to each value in matrix dataPoints and used ListPlot3D to plot results
dataPoints =
Table[{i*dx, j*dy, m[[i + 1, j + 1]]}, {i, 0, 9}, {j, 0, 9}];
ListPlot3D[Flatten[dataPoints, 1],
AxesLabel -> {Style[x, Medium, Blue], Style[y, Medium, Blue],
Style[u, Medium, Blue]},
ColorFunction -> Function[{x, y, z}, Hue[z]], PlotRange -> All]
and when i use ListPlot3D i get this plot:
My goal is to print plot where should be hole in place where now zeros are but not defining plot depending on U value rather x and y. So basicly solutions should depend on x and y not u variable.
I have tried searching for similar problems but I don't know how i could implement exclusions in my problem.
Can this be done and how to solve this problem? Please help.
I have tried using RegionFunction but I am stuck and I don't know how to define region function so that middle area get removed. One answer suggested I use
RegionFunction -> Function[{x, y, z}, z != 0
But this is not satisfying as I need to exclude a surface inside but some edges or some other points can also have value 0.