Wave- and heat-equation on surfaces

Wave equation

Let M be a surface and f:R×MR a function. The wave equation is given by:
f¨=Δf.
After the space discretization we have f:R×VR, p:=(f1fn)Rn and ΔRn×n, where n:=|V| denotes the number of vertices. Therefore, the wave equation becomes a linear system of second order ODE’s. In the last lecture we saw that the Verlet method works well for second order ODE’s. Using this for the Wave equation we get:pk12pk+pk+1δ2=Δpk,
where δ is the time step.
For initial data p0,p1, the hope is that the energy of the system neither grows exponentially nor that the system comes to a halt. A classical example for the 1dimensional wave equation is an oscillating string. This leads in analogy to music instruments to two kinds of initial data:

  1. Cembalo initial data: p0=p1, here the string gets plucked, i.e. at time t=0 the oscillation is po and the speed is zero.
  2. Piano initial data: p0=0, here the string gets struck i.e.  at time t=0 the oscillation is zero but the speed is not.

A different way to find solutions of the wave equations is to calculate the eigenfunctions of the laplace operator, g:MR:
Δg=ω2g.
Since the laplace operator is symmetric and negative definite, Δ is diagonalizable and there exist eigenvalues λi:=ωi2 with corresponding eigenfunctions gi such that such that:
0=wo2<w12<w22.
Note that 0 zero is an eigenvalue, because the kernel of Δ consists of the constant functions. If we computed the eigenfunctions, solutions of the wave equation can be constructed in the following way:
f(t,p):=i=1n(aicos(ωit)+bisin(ωit))gi(p),ai,biR.
The coefficients ai, bi have to be chosen in a way such that the initial conditions are satisfied. Note that for different surfaces the spectrum of eigenvalues is different. A sphere “sounds” different then the bunny.  The disadvantage of this method is, that finding the eigenfunctions of the surface and computing the coefficients for the initial conditions can be very expensive, especially if the surface has many vertices.

Heat equation

For f:R×MR, the heat equation is given by:
f˙=Δf.
We will start our investigation by considering the case M=S1. There we can describe a function f~:S1R by an periodic function f:RR, with  f(x+2π)=f(x).

func on s1

Our aim is it to use the Euler forward method to solve the heat equation on S1, therefore we discretize the space, i.e. the interval [0,2π], as follows:
xk=2πkn,xk+1=xk+h,with h=2πn.
In an earlier lecture we discussed discrete periodic functions and defined a canonical basis for them, such that we can write the components of pj=(u1u2n1) as
uk=12πm=nnamei2πkmnamC.
Since we are considering real valued functions there has to hold am=a¯m for all m{n,,0,,n}.
If we now use the Euler forward method we get:
pj+1=pj+δΔpk,
where δ denotes the time step size. The discrete laplacian on S1 can be considered as an approximation of the second spatial derivative and is defined as:
(Δu)k=uk12uk+uk+1h2.
By linearity it is enough to consider the case uk=ei2πkmn:

u~k=uk+(Δu)k=ei2πkmn+δei2π(k1)mn2ei2πkmn+ei2π(k+1)mnh2=(1+δei2πmn+ei2πmn+2h2)ei2πkmn=(1+2δh2(cos(2πmn)1))uk.
The system will blow up after a certain time if there is an m such that:
|1+2δh2(cos(2πmn)1)|>12δh2(cos(2πmn)1)<2.
The left hand side reaches its minimum if m=n2 i.e cos(2πmn)=1 and we get:
2δh2>1δ>h22.

This gives us a connection between the space and time discretization that is not wanted. If we use the Euler forward method to solve the heat equation on S1 and we refine the time step by the factor of 10, we have to refine the space discretization by the factor of 50, to avoid the solution to blow up. Therefore it makes more sense to use the Euler backward method for this problem.

Posted in Lecture | Comments Off on Wave- and heat-equation on surfaces

Partial differential equations involving time

Let ΩRn be a domain, we will consider Ω to be the “space” and functions:
f:R×ΩR,(t,x)f(t,x),
will be view as time dependent functions
ft:ΩR,ft(x):=f(t,x).

We want to investigate partial differential equations  (PDE’s) for f, that involve the Laplace operator. Here the Laplace operator is defined just for the space coordinates x:
(Δf)(t,x):=(Δft)(x):=i=1n2ft(x)xi2.
Typical examples for such PDE’s from physics are:

  1. Wave equation: 2ft2=c2Δf,cR.
  2. Heat equations: ft=cΔf,cR.

We will investigate these PDS’s on closed triangulated surfaces  Ω=M=(V,E,F), where we only have finitely many function values i.e. :
f:RRV,f(t)=(f1(t)fN(t)).
On M we have the usual Laplace operator Δ:RVRV and for the above PDE’s we obtain ordinary differential equations (ODE’s):

  1. Wave equation: f¨(t)=c2Δf(t).
  2.  Heat equations: f˙(t)=cΔf(t).

This is a big improvement since it is fare more complicated to solve PDE’s then ODE’s.
Before we will present some methods to solve ODE’S numerically consider the Pendulum equation as example:
φ¨=sin(φ).

pendulum

The standard procedure to solve a second order ODE is to transfer it in a system of two ODE’s of first order. Therefore consider:
f:RR2,f(t)=(φ(t)φ˙(t)).
Then φ solves the pendulum equation if and only if f solves
(uv)=(vsin(u)).
The energy of the above system is given by E(t):=12φ˙2cos(φ). E is a constant of motion since:
E˙=φ˙φ¨+φ˙sin(φ)=o,

The level-sets of the energy of the pendulum. The yellow dots correspond to E=1, the green curves to 1<E<1, the blue ones to E=1 and the red ones to E>1.

if φ is a solution of the pendulum equation. In the phase space the solutions of the ODE are implicitly given by the level-sets of E :

By the theorem of Picard-Lindelöf there is for every (u0v0)R2 a  unique solution of the initial value problem (IVP) :
(uv)=X(u,v)=(vsin(u))(uv)(0)=(u0v0).
These solutions lie on the level-sets of E.
Now we want to approximate the solution of the IVP by a sequence
,(u1v1),(u0v0),(u1v1),R2
such that for the real solution (u(t)v(t)) we have (ukvk)pk(uv)(kδ),
where δ is the time step.
timedisc

There are several methods to get such a sequence:

1. Forward Euler method:

Let X:R2R2 be the vectorfiled representing the ODE , i.e. (uv)(kδ)=X(u(kδ),v(kδ))=X(pk).

euler

Then with the forward Euler method we get from pk to pk+1 by walking for the time δ in the direction of X(pk).

pk+1=pk+δX(pk).

The big advantage of this method is, that it is very fast. The disadvantage is illustrated in the following example: For the harmonic oscillator the ODE is given by the vectorfield:
X(u,v)=(vu).
Its analytic solution is:
(uv)(t)=(cos(t)sin(t)sin(t)cos(t))(uov0)

The vector field and the corresponding integralcurves of the harmonic oscillator.

The energy is a again a constant of motion: E(t):=12(u2+v2) and the level-sets of E are circles. If we apply the forward Euler method the solution is a spiral and not a circle. Therefore, the energy gets bigger and bigger and the solution blows up.

The rela integralcurve (blue) and the one obtain with the eulerforward method for $\delta = 0.5 (red)$, together with the corresponding vectorfield (grey).

The real integralcurve (blue) and the one obtain with the Euler forward method for δ=0.5  (red), together with the corresponding vectorfield (grey).

2. Backward Euler method:

The backward Euler method works in the following way: Find pk+1 such that one Euler forward step with respect to the vectorfield X gives you pk. i.e
pk=pk+1δX(pk+1).
That means we have to solve the following non linear system of equations to get from pk to pk+1:
pk+1=pk+δX(pk+1).

This can for example be done with the classical Newton method. The advantage of the backward Euler method is that the energy does not increase and therefore the solution does not blow up. The disadvantage is that solving a non linear system of equations can be hard and expensive.

The idea behind both Euler methods, that guaranties the convergence to the real solution for δ0 is given by the mean value theorem: For fC1(R,Rn), pR and δ>0 there exist τ(p,p+δ) such that”
f(τ)=f(p)f(p+δ)δ.

3. Verlet method:

The Verlet method works for equations of the form f¨(t)=F(f(t)),fC2(R,Rn).

In order to approximate f(kδ) by pk we use the mean value theorem twice:

f¨(t)f˙(t+δ2)f˙(tδ2)δf(t+δ)f(t)δf(t)f(tδ)δδ=f(t+δ)2f(t)+f(tδ)δ2.

This gives us the following recursion formula for the pk’s:
F(pk)=pk12pk+pk+1δ2pk+1=2pkpk1+δ2F(pk).

To solve this recursion formula, we start with the initial data (p0p1):=(u0v1):=(f(0)f(δ))
with the approximation:
p0+p12f(δ2),p1p0δf˙(δ2),

this corresponds to the usual initial data of an IVP for a  for a second order ODE. Afterwords we use:

(pkpk+1)=(ukvk)=(vk12vk1uk1+δ2F(vk1)).

If we consider that as a two dimensional system with qk:=(ukvk), we have:
qk+1=X(qk),
with:
X:R2R2,X(u,v)=(v2vu+δ2F(u)).

This is a very good choice of discretization, because the  vectorfield X is area preserving:
X(u,v)=(0112+δ2F(u))detX(u,v)=1.
This gives us for UR2:
area(X(U))=X(U)1=U|detX(u,v)|=U1=area(U).

There is a huge theory about area preserving maps and their higher dimensional analog symplectic maps. This maps lead to so called symplectic integrators, that do an excellent job solving ODE’s.

Lets get back to the pendulum equation: φ¨=sin(φ). If we use a clever method for the discretization of F(φ)=sin(φ), the Verlet method gives us a good solution of the pendulum equation.discretiz F Where the clever discretization of F is the following: F(φ)=1karg(1+keiφ).

Posted in Lecture | Comments Off on Partial differential equations involving time

Tutorial 11 – Electric fields on surfaces

As described in the lecture a charge distribution ρ:MR in a uniformly conducting surface M induces an electric field E, which satisfies Gauss’s and Faraday’s lawdivE=ρ,curlE=0.In particular, on a simply connected surface there is an electric potential u:MR such thatE=gradu.If we then apply the divergence operator on both sides we find that u solves the following Poisson problemΔu=ρ.The potential is determined up to an additive constant thus the field is completely determined by the equation above. Since we have a discrete Laplace operator on a triangulated surface we can easily compute the electric field of a given charge:

  1. Compute Δ and solve for the electric potential u.
  2. Compute its gradient and set E=gradu.

Here the resulting field for a distribution of positive and negative charge on the sphere:

electricfieldsphere_

Though there are some issues. First, we need first paint the density ρ onto M. Therefore we can just use a paint node – it has an override color flag where one can specify which attribute to write to.

paint_density

A bit more serious problem is that not every density distribution leads to a solvable Poisson problem. Let us look a bit closer at this. We know thatΔ=A1L,where A is the mass matrix containing vertex areas and L contains the cotangent weights – as described in a previous post. We know that kerΔ={f:VRf=const}and that Δ is self-adjoint with respect to the inner product induced by A on RV, f,g=ftAg. In this situation we know from linear algebra thatRV=imΔkerΔ.Hence the Poisson equation Δu=ρ is solvable if and only if ρ is perpendicular to the constant functions, in other wordsρ,1=iVρiAi=0.This is easily achieved by subtracting the mean value of ρ (orthogonal projection):ρiρikVρkAkkVAk.Then the Poisson equation Δu=ρ is solvable and defines an electric field.

Actually symmetric systems are also better for the numerics. Thus we solve insteadLu=Aρ.Since the matrix L is symmetric we can use the cg-solver which is quite fast and even provides a solution if L has a non-zero kernel – provided that Aρ lies in the image of L.

Below the electric potential on the buddy bear where we have placed a positive charge on its left upper paw and a negative charge under its right lower paw.

electricpotentialbear_

Actually the bear on the picture does not consist of triangles – we used a divide node to visualize the dual cells the piecewise constant functions live on.

The graph of the function u (which is stored as a point attribute @u) can then be visualized by a polyextrude node. Therefore one selects Individual Elements in the Divide Into field and specifies the attribute u in the Z scale field.

The dual surface also provides a way to visualize the electric field: Once one has computed the gradient (on the primitives of the triangle mesh) the divide node turns it into an attribute at the points of the dual surface (corresponding to the actual triangles). This can then be used to set up attributes @pscale (length of gradient) and @orient (quaternion that rotates say (1,0,0) to the direction of the gradient) and use them in a copy node to place arrows. Reading out the gradient at the vertices of the dual mesh needs a bit care:

Here how the end of the network might look like:

network

And here the resulting image:

electricfieldbear_

Since the potential varies quite smoothly the coloring from blue (minimum) to red (maximum) does not reveal much of the function. Another way to visualize u is by a periodic texture. This we can do using the method hsvtorgb, where we can stick in a scaled version of u in the first slot (hue).

electricpotentialbear2_

Homework (due 19/21 July). Build a network that allows to specify the charge on a given geometry and computes the corresponding electric field and potential.

Posted in Tutorial | Comments Off on Tutorial 11 – Electric fields on surfaces

Laplace operator 2

Let M=(V,E,F) be an oriented triangulated surface without boundary and p:VR3 a realization. In earlier lectures we considered the space of piecewise linear functions on M:
WPL:={f~:MR|f~|σ is affine for all σF}.
A basis of WPL is given by : ϕiWPL defined by ϕi(pj)=δij, an  interpolation map is defined by:
intPL:RVWPL,ff~=iVfiϕi.

graph phi

The graph of ϕi

For some purposes piecewise constant function are more convenient then piecewise linear ones, therefore, we introduce a new function space on M that consists of piecewise constant functions. In order to do that we assign a domain to each vertex:
For every edge eijE the center is given by Sij=12(pi+pj) analog  for every triangle σ={i,j,k}F the center of mass is defined as Sijk=13(pi+pj+pk).

trianglemasscenter

If we connect the center of the edges with the center of mass the triangle is divided into three parts with equal area. Now we can assign to each vertex pi the parts of the adjacent triangles that contain pi and denote it with Di.

pointarea

The domain Di (gray colored) associated to the vertex pi

For the area of Di we obtain:
Ai:=13σ={i,j,k}FAσ.

The space of piecewise constant functions is defined in the following way:
WPC:={f^:MR|f^|Di is constant for all iV}.
Also on WPC we have a canonical basis ΨiWPC defined by Ψi(pj)=δij and an interpolation map:
intPC:RVWPC,ff^=iVfiΨi.

graph psi

Graph of Ψi

There is a similar construction that assigns to each vertex an face and works purely combinatorial: For a triangulated M surface one can define its discrete dual surface M=(V,E,F). The faces of M correspond to the vertices of M and the vertices of M to the faces of M. The set of edges stays the same. Two vertices in M are connected by  an edge if the corresponding faces in M are adjacent. For more informations see here.

dualsurface

A piece of an triangulated surface M and its dual M. The red vertices and edges belong to M and the blues ones to M.

Since in general it is not easy to compute the area of the dual faces with the metric of the original one, we used the above construction of the Di’s to define WPC. On WPL we defined the usual scalar product f~,g~PL:=Mf~g~ and computed the matrix B representing it with respect to the basis {ϕ1,ϕN}, i.e. bij:=ϕi,ϕjPL. This gave us a scalar product on RV:

f,gPL=ftBg=i,jVfigjbij.

On the same way we define an scalarproduct on WPC:
,PC:WPC×WPCR,f^,g^PC:=Mf^g^.
The matrix A representing it with respect to the basis  {Ψ1,ΨN} is a diagonal matrix since:
aij:=Ψi,ΨjPC =MΨiΨj=Aiδij.
This gives us a new  scalar product on RV:
f,gPC:=ftAg=iVfigiaii.
Note that the basis {Ψ1,ΨN} is orthogonal with respect to ,PC, while the same is not true for {ϕ1,ϕN} with respect to ,PL.
Now we have two scalar products on RV one represented by a symmetric positive definite matrix B and one by a positive definite diagonal one A.
Our aim is to define a discrete laplace operator Δ:RVRV analog to the smooth laplacian we discussed earlier. We will see that the discrtelaplacian depends on the choice of scalarproduct.
On a smooth surface M we have:
Δf,g=MΔfg=Mgradf,gradg.
This identity should also be true in the discrete case and will serve us as definition for the discrete laplacian. We already defined the bilinear operator
L:RV×RVR,f,gMgradf,gradg,

and discussed the relation between  quadratic forms, symmetric bilinear maps and maps between dual spaces ( lecture: dirichlet energy 2 ).
WPLEDWPLinterpol.interpol.RVLRV
In the finite case the quadratic form, bilinear form and map between the dual spaces can all be represented by the same matrix L .

For f,gRV we have:
ftLg=Mgradf,gradg=!MΔfg=Δf,g.
This gives us one laplace operator for each scalarproduct on RV:
ftLg={(ΔPLf)tBg,(ΔPCf)tAg,{ΔPL=(LB1)t=B1L,ΔPC=(LA1)t=A1L.

In general it is complicated and expensive to compute B1, such that it is much easier to use ΔPC instead of ΔPL. Witch of the laplacians one has to choose depends on the nature of the problem.

One famous problem form physics and geometry is the Poisson problem:
Given ρRV find uRV such that:
Δu=ρ.
For Poisson problems both laplacians can be used since:

ΔPLu=(LB1)tu=ρLu=Bρ.

Example: Suppose M consists of an uniform conducting material and ρ:MR is a charge density. For the electric field E on M there holds:
divE=ρ,
and for the potential u:MR we have
E=gradu.Taking this together we have to solve:
Δu=ρ,
in order to determine the potential for a given density.
In this setting piecewise constant functions are much more convenient to describe the charge density then piecewise linear ones. Therefore we use ΔPL to solve this problem.

Posted in Lecture | Comments Off on Laplace operator 2

Triangulated surfaces with metric and the Plateau problem

Let Σ=(V,E,F) be a triangulated surface (with boundary). A realization of the surface in R3 is given by a map p:VR3 such that pi,pj,pk form a non degenerated triangle in R3 for all {i,j,k}Σ, (i.e. pi,pj,pk do not lie on a line). Some problems, like the plateau problem do not depend on the position of the vertices in the space, but only on the length of the edges:
lij=lji=|eji|i,jE.
If we have a realization of the surface in R3 there holds: lij=lji=|pipj| and the edge length’s satisfy the triangle inequalities:
For {i,j,k}F{lij<ljk+lki,lki<lij+ljk,ljk<lki+lij.

Definition: A metric on a triangulated surface assigns  a length to each oriented edge such that the triangle inequalities are satisfied.

triangle_lengthNote that every realization p:VR3 induces a metric on the underlying triangulated surface. On the other hand a triangulated surface with metric has several realization in R3, such that the metrics coincide. On a triangulated surface with metric every triangle has the structure of an euclidean triangle in R2, that allows us to interpolate f:VR to a piecewise affine function f~:C(Σ)R and define the Dirichlet energy ED(f) as in the last lectures.

 In particular, we can define angles and area using the cosine theorem:
cos(αi)=ljk2lji2lki22lkilij
By the triangle inequalities we obtain that 0<γ<π and the angles are well defined. With sin(αi)=1cos(αi)2 we can define the cotangents weights and the area of the triangle σ={i,j,k} :
Aσ=12sin(αi)lijlki.
For a realization p of Σ with vertex positions pi,pj,pk and edges eij=pjpi, we obtain for σ={i,j,k}F:
Aσ(p)=12|(pjpi)×(pkpi)|=12|eij×eik|=12sin(αi)|eij|=lij|eki|=lki,
and the total area is give by:
A(p)=σFAσ(p).

Definition: The following problem is the Plateau problem: Let Σ be a triangulated surface with boundary and q:VR3 a prescribed function. We are looking for a realization p:VR3 of Σ such that:

1.  p|V=q,
2.  p has the smallest area among all realizations p~ of Σ, with p~|V=q.

In order to be able to solve the  Plateau problem we have to consider variations of p:

Definition: A variation of p with constant boundary assigns to each vertex  iV a curve tpi(t), t(ϵ,ϵ), such that:

1. pi(0)=pi for all iV.
2. pj(t)=qj for all t(ϵ,ϵ) if jV.

Definition: p is called a minimal surface if it is a critical point of the area functional, i.e. :
t|t=0A(p(t))=0,
for all variations of p with constant boundary.

Lemma: p is a minimal surface if and only if For each iV and each curve tpi(t), t(ϵ,ϵ) we have:
t|t=0A(pi(t))=t|t=0σF|iσAσ(pi(t))=0.

I.e. p is a critical point of the area functional with respect to all variations with constant boundary, if and only if it is a critical point for all those variations that only move one interior vertex.

Proof: : clear.
⇐: Similar to the following fact from analysis:
All directional derivatives of a function f:UR,URn vanish at pU if and only if all partial derivatives of f vanish at p.

◻

Theorem: p is a minimal surface if and only if all tree components of p are discrete harmonic functions with respect to the metric induced on Σ by p.

Proof: piramid p_iFix iV and let  tpi(t), t(ϵ,ϵ) be a variation, that only moves pi and Y:=pi(o). Further we define F^:={{i,j,k}F| positive oriented} to be the set of positive oriented triangles that contain the vertex i. We have to show that there holds:
0=t|t=0A(pi(t))=t|t=0{i,j,k}F^|(pjpi(t))×(pkpi(t))|=t|t=0{i,j,k}F^|eij(t)×eik(t)|.

Before we start with the proof remember these identities from analysislinear algebra

1.  For a function tv(t)R3 there holds:
|v|=v,v|v|
2. For a,b,c,dR3 we have:
a×b,c×d=det(a,ca,db,c b,d )=a,cb,da,db,c.
With ei,j=pjpi we get eij˙=Y and can compute now the variation of the area functional:
t|t=0A(pi(t))=12{i,j,k}F^eij×eik,Y×eikeij×Y|eij×ejk|={i,j,k}F^eij,Y|eik|2+eik,Yeij,eikeik,Y|eij|2+eij,Yeij,eik2|eij×ejk|=Y,{i,j,k}F^eij|eik|2eik|eij|2+eij,eik(eij+eik)2|eij×ejk|=Y,{i,j,k}F^(eik,eik+eij,eik)eij+(eij,eij+eij,eik)eik2|eij×ejk|.
With eik,eik+eij,eik=eik,eijeik=eik,ekj,
and
eij,eij+eij,eik=eij,eikeij=eij,ejk,
We have:
t|t=0A(pi(t))=Y,{i,j,k}F^(eik,ekjeij2|eij×ejk|)+{i,j,k}F^(eij,ejkeik2|eij×ejk|).

2trianglesijkl

In an earlier lecture  we showed that: cot(βik)=eij,ejk|eij×ejk| and cot(αik)=eil,ekl|eik×eil|.

With an index shift in the first sum (i,j,k)(i,k,l) we have now : t|t=0A(pi(t))=Y,{i,j,k}F^12(cot(βik)+cot(αik))eik=Y,{i,k}E^12(cot(βik)+cot(αik))(pkpi).

Since this has to hold for all variations Y of pi and for all iVwe finally get:
t|t=0A(p(t))=0{i,k}E^12(cot(βik)+cot(αik))(pkpi)=0iV.

This means p is an minimal surface if and only if all components of p are harmonic with respect to the metric on Σ induced by p.

◻

Posted in Lecture | Comments Off on Triangulated surfaces with metric and the Plateau problem

Dirichlet energy 2

Let M=(V,E,F)  be a triangulated domain in the plane where V denotes the set of vertices, E the set of edges and F the set of triangles.  We consider the set of functions on the vertices  :
RV:={f:VRifi}.
By interpolation to a piecewise linear function we get:  f^:MR.
RVinterpol.WPL:={f^:MR|f^|σ is affine for all σF}.
In the last lecture the Dirichlet energy of  f^WPL was defined as:
ED(f^)=12M|gradf~|2=14(i,j)E^(cot(αij)+cotβij)(fifj)2.
ED:WPLR is a quadratic form, which can be represented by matrix ARV×V:
ED(f)=(f1,,fN)(a11a1NaN1aNN)(f1fN),
where N:=|V| and
aij:={14(cot(αij)+cotβij)forij,{i,j}E,14(i,k)E^(cot(αik)+cotβik)fori=j,0else.
One can easily check that: A(11)=0 and even further there holds: ker A=R(11).

In order to get a better understanding of the Dirichlet energy we recap some facts on quadratic forms.
There is a natural relation between symmetric bilinear forms and quadratic forms:

Proposition: Let W be a vectorspace and b:W×WR a bilinear symmetric form then
q:WR,q(w):=b(w,w),
is the corresponding quadratic form. b is completely determined by q.

Proof: q(w1+w2)=b(w1+w2,w1+w2)=q(w1)+2b(w1,w2)+q(w2),b(w1,w2)=12(q(w1+w2)q(w1)q(w2).)

◻

For a vectorspace W the dualspace is defined as W:={w:WR|w is linear }. For a basis of W {w1,,wn} the corresponding dual basis of W {w1,,wn} is defined by:
wi(wj)=δij.
Note that there is a natural identification of W and W, i.e. the dual space of the dual space is the original space.
For a linear map A:WV between vectorspaces W,V the adjoint map is defined as:
A:VW(Av)(w):=v(Aw)vV and wW.

If b:W×WR  is a bilinear form, we can define a map A:WW by:
(Aw1)(w2):=b(w1,w2).
Conversely a  map A:WW defines a bilinear form on W. If the bilinear form b is non degenerated A is an isomorphism. In this case b gives us an identification of elements of W and W. A typical example is given by an euclidean vectorspace (W,,). There we can identify an element wW with wW by:
w=w,.

Proposition: With the identification above we have: b:W×WR is symmetric if and only if A:WW is self-adjoint.

Proof: First note that for A:WW we have A:W=WW.
b(w1,w2)=(Aw1)(w2)=w2W(Aw1)=(Aw2)(w1)
Therefore we get: b(w1,w2)=b(w2,w1)A=A.

◻

Now lets get back to the Dirichlet energy. The quadratic form ED on WPL can be identified with a symmetric bilinear map ED~:WPL×WPLR, which again corresponds to linear map ED^:WPLWPL. Together with the interpolation map we obtain the following diagram:
WPLED^WPLinterpol.interpol.RVARV

If V denotes the set of interior vertices and V the one of boundary vertices we can give a discrete analog of the Dirichlet boundary problem in the following way:

Theorem: Given g:VR there is a unique f:VR such that:
{(Af)i=0iV,f|V=g.

A function f:VR that solves the above Dirichlet problem is called harmonic.

Posted in Lecture | Comments Off on Dirichlet energy 2

Gradient and Dirichlet energy on triangulated domains.

Let M be a triangulated domain with the functionspace:
WPL:={f:MR|f|Tσ is affine for all σΣ2}.
On the interior of each triangle Tσ in M the gradient of a function gW is well defined and constant. We will derive a nice formula to compute gradg|Tσ.

Theorem 1: Let TR2 be a non degenerated triangle with vertices pi,pj,pk and edges ei:=pkpj, ej:=pipk, ek:=pjpi. For an affine function g:TR we define gi:=g(pi), gj:=g(pj)gk:=g(pk). Then there holds:
gradg=12AJ(giei+gjej+gkek),
where A:=12det(ei,ej)=12Jei,ej=12Jej,ek=12Jek,ei, denotes the area of T and J the usual 90 degree rotation in the plan.

Proof: In order to compute gradg consider the curvepath6075-9
γ:[0,1]R2,γ(t):=pj+tei.
The composition of g and γ is given by: (gγ)(t)=gj+t(gkgj). Taking the derivative direct and with respect to the product rule we get:
gkgj=(gγ)(t)=g(γ(t))γ(t)=gradg,γ(t)=gradg,ei.
On the other hand we have:
12AJ(giei+gjej+gkek),ei=12A(giJei,ei=0+gjJej,ei=2A+gkJek,ei=2A)=gkgj.
And therfore:
12AJ(giei+gjej+gkek),ei=gradg,ei.
A cyclic permutation of i,j,k  gives us:
12AJ(giei+gjej+gkek),ej=gradg,ej,
and we obtain the desired result gradg=12AJ(giei+gjej+gkek).

◻

Definition: For gWPL the Dirichlet energy is defined as:
ED(g):=12M|gradg|2.

Theorem 2: We use the same notation as in theorem 1. Additionally let αi,αj,αk denote the angles of the triangle at the vertices pi,pj,pk respectively. Then there holds:
T|gradg|2=12(cot(αi)(gjgk)2+cot(αj)(gkgi)2+cot(αk)(gigj)2).

Proof: T|gradg|2=T12AJ(giei+gjej+gkek),12AJ(giei+gjej+gkek)=A4A2(gi2|ei|2+gj2|ej|2+gk2|ek|2+2gigjei,ej+2gjgjej,ek+2gkgiek,ei).
On the other hand we have:
14A((gigj)2ei,ej+(gjgk)2ej,ek+(gkgi)2ek,ei)=14A(gi2ei,ej+ek=ei2gigjei,ej+gj2ej,ei+ek=ej2gkgjek,ej+gk2ek,ej+ei=ek2gigkei,ek)=14A(gi2|ei|2+gj2|ej|2+gk2|ek|2+2gigjei,ej+2gjgjej,ek+2gkgiek,ei)=T|gradg|2.
With ei,ej=cos(αk)|ei||ej|,2A=12det(ei,ej)=12Jei,ej=sin(αk)|ei||ej|.
We have:
cot(αk)=ei,ej2A.
And therefore we obtain for the Dirichlet energy of g on T:
T|gradg|2=12(cot(αi)(gjgk)2+cot(αj)(gkgi)2+cot(αk)(gigj)2).

◻

Corollary: The Dirichlet energy of gWPL is given by :
ED(g)=14σ={i,j,k}Σ2cot(αi)(gjgk)2+cot(αj)(gkgi)2+cot(αk)(gigj)2.

 2triangles

If E:={{i,j}Σ} denotes the set of edges and E~:={(i,j)V×V|{i,j}Σ} the set of oriented edges, we choose E^E~ such that:

1)  E={{i,j}V|(i,j)E^},
2)  (i,j)E^(j,i)E^.

I.e. for every edges we choose oneoriented one. For every (i,j)E^ let αij denote the angle of the opposite vertex to the left and βij the one the opposite vertex to the right. Then we can write the Derichlet energy in the following form:
ED(g)=14(i,j)E^(cot(αij)+cotβij)(gigj)2,
where we set the cotangent weights zero if the corresponding vertex does not exist because (i,j) is an boundary edge.

Posted in Lecture | Comments Off on Gradient and Dirichlet energy on triangulated domains.

Triangulated surfaces and domains

We want to derive a discrete version of the laplace operator defined on triangulated surfaces. At first we will define what a triangulated surface with and without  boundary is,  and consider triangulated domains of R2 as an important example.

Let Σ be a two dimensional simplicial complex and let V denote its set of vertices. For iV the “vertex-star” around i is defined as:
Si:={jV|ji,{i,j}Σ}.The link of a vertex iV is a graph Gi given by:
Gi:={{j,k}Si|jk,{i,j,k}Σ}.

Definition: A triangulated surface with boundary is a two dimensional simplicial complex Σ with the following properties:
1) Each edge is contained in exactly one or two triangles.
2) For each vertex iV the corresponding link Gi is connected.

A vertex of a link Gi has either one or two edges. In a triangulated surface with boundary all links Gi are  connected  thus they are either a discrete interval or a discrete circle. In the first case the corresponding vertex i is called a boundary vertex in the second case it is called an interior vertex. Also the edges of an triangulated surface split in two groups. The one that are contained in only one triangle are the boundary edges, the one that lie in two triangles are interior edges. The set of all boundary vertices and edges of an triangulated surface with boundary is a graph, called the boundary of Σ and will be denoted with Σ.
The boundary is either empty or the union of discrete circles. If the boundary is empty Σ is called a triangulated surface.

Definition: A triangulated domain M in R2 is a triangulated surface with boundary Σ together with an assignment p:VR2 such that its piecewise linear extension p~:C(Σ)R2 is injective. Then M is given by the following disjoint union:
M=SΣp~(C(S)).

Here p~(C(S)) denotes the interior of the affine realization of the simplex S. For a triangle this is the triangle minus its edges, for an edge it is the edge minus its vertices and the interior of a point is just the point it self.

For σΣ2 let Tσ:=p~(C(σ)) denote the corresponding triangle in MR2  and for iV, pi:=p~(δ(i))   the corresponding point .

On a triangulated domain  MR2 we consider the following set of functions:
W:={f:MR|f|Tσ is affine for all σΣ2,f|M=0}
We can equip W with the usual scalar-product:
,:W×WR,f,g:=Mfg.
On the interior of each triangle Tσ, fW is a differentiable function with constant derivative. Therefore, for all σΣ2 there exist XσR2 such that gradf(p)=Xσ for all pTσ. More general we define the set of vector fields on M:
VF(M):={X:Tσ,σΣ2R2|X|Tσ=Xσ=constant, for all σΣ2}
Also on VF(M) we can define a scalar product:
,:VF(M)×VF(M)R,X,Y:=σΣ2Xσ,YσAσ,
where Aσ denotes the area of Tσ.

Let V denote the set of interior vertices of Σ and N:=|V| the number of interior vertices. A function fW is completely determined by its values fi:=f(pi) at the interior vertices of the triangulation. In deed, W is a N dimensional vectorspace with basis {ϕi}, where ϕiW is defined by ϕi(pj):=δij. The ϕi are often called “hat-function” and there holds:
f=iVfiϕi.
Thus in order to compute the scalar product of arbitrary functions f,gW we just need to know the values:
bij:=ϕi,ϕj.
For {i,j}Σ  we have bij:=ϕi,ϕj=0.

In order to compute the non zero elements consider the domain D:={(s,t)R2|0s,t,s+t1},
and for each triangle Tσ with vertices pi,pj,pk and edges ek:=pjpi, ei:=pkpj, ej:=pipk the following parametrization:
Φ:DTσR2,Φ(s,t):=pi+teksej.
Φ is bijective and we have:
det(Φ)=det(ek,ej)=2Aσ.
Now we can compute ϕi,ϕi:
Tσϕi2=D(ϕiΦ)2|det(Φ)|=D(1st)22Aσdsdt=2Aσ0101t(1st)2dsdt=2Aσ0113(1st)3|01tdt=2Aσ0113(1t)3dt=Aσ6.
Summation over all triangles that contain the vertex i gives us the result:

bii=ϕi,ϕi=Mϕi2=σ|iσTσϕi2=16σ|iσAσ.
To every vertex iV we can assign an area
Ai:=13σ|iσAσ, and obtain  ϕi,ϕi=12Ai. Using (ϕjΦ)(s,t)=s and (ϕkΦ)(s,t)=t we obtain the analog result for ϕj,ϕk:
Tσϕjϕk=D(ϕjΦ)(ϕkΦ)|det(Φ)|=2AσDstdsdt=2Aσ0101tstdsdt=Aσ01ts2|01tdt=Aσ01t32t2+tdt=Aσ12.
And again we get the result by summation over the two triangles that contain j and k:
bjk=ϕj,ϕk=112σ|k,jσAσ.
The scalar product of two functions f=iVfiϕi,g=iVgiϕi can now be computed in the following way:
f,g=i,jVfigjϕi,ϕj=i,jVfigjbij.

Posted in Lecture | Comments Off on Triangulated surfaces and domains

Laplace operator 1

Let MR2 be a domain with smooth boundary M and outpointing normal vector field N. For a smooth function fC(M,R) the gradient vector field gradf:MR2 is defined as :
gradf:=(fxfy)=(f)t.
For a vector field v:MR2 the divergence is given by:
divv:=v1x+v2y.
Taking this together we can define the laplace operator Δ:C(M,R)C(M,R):
Δf:=divgradf=2fx2+2fy2.
The laplace operator plays an important role in physics and geometry. A typical problem from physics is the following called Dirichlet boundary problem: Given gC(M,R) find fC(M,R) such that:
{Δf=0f|M=g.
If f is a temperature distribution on M and g is the prescribed temperature on the boundary, then f has to solve the heat equation: f˙=Δf. For a stationary temperature distribution there holds f˙=0 and we obtain the above Dirichlet boundary problem.

Theorem:
1) Given gC(M,R) and dC(M,R), then there is a unique fC(M,R) such that: {Δf=df|M=g.
2) If d=0 and f is a solution of the corresponding Dirichlet boundary problem, then f minimizes the Dirichlet energy ED(f):=12M|gradf|2, among all the functions hC(M,R) with h|M=g.

Proof:
1) The proof of the existence of f is hard and can be found in some good books about PDE’s. We only proof the uniqueness of f.
Suppose there exists f,f~C(M,R) with: Δf=Δf~=0 and f|M=f~|M=g, then u:=f~f solves:
{Δu=0u|M=0.Now we consider the vector field X:=ugradu. For the divergence of X we get:
divX=div(ugradu)=gradu,gradu +udivgradu=gradu,gradu +uΔu.
Using the fact that X vanishes on the boundary and applying the divergence theorem we obtain:
0=MX,N=MdivX=Mgradu,gradu +uΔu=M|gradu|2.
Therefore, we have  gradu=0 on the whole of M and u is locally constant. Due to the fact that, u|M=0 u is identically zero and therefore f is unique.

2)Let f be the unique solution of the Dirichlet boundary problem Δf=0,f|M=g and h an arbitrary smooth function with  h|M=g. For u:=hf there holds u|M=0 and we get:
M|grad,h|2=M|gradf+u|2=M|gradf|2+2Mgradf,gradu+M|gradu|2.
Using the usual product rule:
div(ugradf)=gradf,gradu+uΔf, and the divergence theorem we obtain:
2ED(h)=M|gradh|2=M|gradf|2+2Mdiv(ugradf)uΔf=0+M|gradu|20M|gradf|2+Mugradf,N=0=M|gradf|2=2ED(f).

◻

Let us now consider the space of smooth functions on M that vanish at the boundary: V:={fC(M,R)|f|M=0}
We can equip  V with two  scalar products ,,,D:V×VR,
f,g:=Mfg,f,gD:=Mgradf,gradg.
To see that ,D  is really a scalar product on V one has to check that it is positive definite (symmetry and bi-linearity are obvious).
0=f,fD=M|gradf|2|gradf|=0
Therefore, f is locally constant. With f|M=0 one has f=0.

Propositon: On V the laplace operator is self adjoint, i.e. Δf,g=f,Δg and  there holds: Δf,g=f,gD.

Proof: Δf,g=Mgdivgradf=Mdiv(ggradf)gradf,gradg=Mfgradg,N=0Mgradf,gradg=f,gD=g,fD=f,Δg.

◻

Posted in Lecture | Comments Off on Laplace operator 1

Tutorial 10 – Discrete minimal surfaces

In the lecture we have defined what we mean by a discrete minimal surface. The goal of this tutorial is to visualize such minimal surfaces.

Let M be a discrete surface with boundary and let V,E,F denote the set of vertices, (unoriented) edges and faces. Once we have a discrete metric, i.e. a map :E(0,) such that the triangle inequalities hold,ijik+kj,jkji+ik,kikj+ji, for each σ={i,j,k},we can define the corresponding discrete Dirichlet energy ED:ED(f)=ijE~ωij(fjfi)2,ωij=12(cotαij+cotβij).Here E~ denote the positively oriented edges. Certainly the angles and thus the cotangent weights depend on the metric .

In particular, each map f:MR3, which maps thecombinatoric triangles to a non-degenerate triangles in R3, yields an induced discrete metric,ij=|pjpi|.We have seen in the lecture that a surface is minimal, i.e. a critical point of the area functional under all variations fixing the boundary, if and only if it solves the Dirichlet problem (with respect to its induced metric): For each interior vertex iV˚ we have12{i,j}Eωijfi+12{i,j}Eωijfj=0,where denotes the metric induced by f.

Unfortunately, unlike the Dirichlet problem, this is a non-linear problem – the cotangent weights depend on in a complicated way. Though, fortunately, we can solve it in many cases by iteratively solving a Dirichlet problem (here a paper that describes this). Since we know how to solve the Dirichlet problem we can implement this method without any effort.

network_plateauproblem

The network above visualizes Plateau’s problem: Given a space curve γ compute a minimal disk with boundary γ. Actually this corresponds to a soap film spanned into a wire.

In the discrete setup we start with some discrete space, say generated by a curve node (probably followed by a resample node), which we then stick into a remesh node to get a reasonably triangulated disk spanned in. Then we can apply the iteration to this input. Below one possible result:

plateau2_

For rendering we used here the following texture in the mantra surface material. To generate texture coordinates one can use the nodes uvunwrap or uvtexture.

The algorithm is not restricted to disks. We can stick in any surface we want. Another nice example is e.g. obtained by starting with a cylinder of revolution. Here the minimal surface becomes a part of a catenoid or, if the cylinder’s height becomes to large, it degenerates to a pair of flat disks (connected by a straight line). In the picture below the last two circles are already too far apart – the surface starts to splits into two parts.

cylinders

As a last example we can start with the unit sphere into which we cut several holes. If we want nice symmetries we could use a platonic solid node to copy smaller spheres to the vertex positions of e.g. an octahedron. The area enclosed by the smaller spheres we then subtract from the unit sphere with help of a cookie node. If we run then the algorithm on this input we end up with nice symmetric minimal surface. For a certain radius of the holes the surface is close to the Schwarz P surface.

schwarzP_

Again one can observe the same effect as for the cylinder – if the holes get to small the minimal surface degenerates to several spheres connected to the origin.

Homework (due 12/14 July). Build a network that computes from a given discrete surface with boundary a minimal surface with the same boundary. Use this network to solve Plateau’s problem and to compute symmetric minimal surface from a sphere with holes as described above.

Posted in Tutorial | Comments Off on Tutorial 10 – Discrete minimal surfaces