0

I am currently writing a Thesis on a FEM-method in order to simulate flexible multibody systems. I'd like to visualize sample Deformations of a plate in Latex. I am trying to input a vector r = [rx, ry, rz] which contains polynomes in all 3 directions describing the state of the body. I am trying to have it look like a 3D mesh. I tried to use Matlab to evaluate rx, ry, rz on a mesh in the x/y plane, but I don't know how to use it with latex.. I am trying to archieve something as in the attached image. Any idea how?,,

Any help is appreciated!

  • 4
    Wlecome, have a look at pgfplots surf capabilities. https://www.ctan.org/pkg/pgfplots – BambOo Apr 11 '20 at 10:45
  • Welcome to TeX - LaTeX! Hi [user] and welcome to TeX.SX. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require some effort on your part in terms of attempting a solution (you already have a suggestion!). If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. – Alessandro Cuttin Apr 17 '20 at 08:20

1 Answers1

2

Something like this?

\documentclass[border=15pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}[hide axis,
      colormap/hot,
      view={25}{20},
      declare function={gauss(\x,\y)=exp(-\x*\x-\y*\y);}] 
  \addplot3[surf,domain=-2:3,domain y=0:3,point meta={-sqrt(z*z+x*x+y*y)},
  samples=26,samples y=16,point meta min=-1.5] {-gauss(x,y)};
  \addplot3[surf,domain=-2:3,domain y=0:2,samples y=11,
  point meta={-sqrt(z*z+x*x)},point meta min=-1.5
  ] 
  (x,0,{-y-gauss(x,y)});
  \addplot3[surf,domain=0:3,domain y=0:2,samples=16,samples y=11,
  point meta={-sqrt(z*z+x*x)},point meta min=-1.5
  ]   (3,x,-y);
  \addplot3[samples=6,samples y=18,domain=0:0.8,domain
  y=0:360,surf,shader=flat,point meta=-1,colormap/blackwhite,fill=white] 
  ({x*cos(y)},{x*sin(y)},{x*x-0.64});     

\end{axis}
\end{tikzpicture}
\end{document}

enter image description here