How to set custom boundary conditions in the PDE Toolbox?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a temperature image (defined by a matrix of pixels) that I wish to use for my initial conditions in a PDE simulation.
I have generated a mesh, and have previously solved the PDE for the case when the initial conditions are constant temperature across the surface. I can also generate a surface plot of the desired initial condition from this image matrix, but how (if I can) do I set it as the initial condition for my PDE to evolve from?
Many thanks.
0 Kommentare
Antworten (1)
Philip Caplan
am 29 Sep. 2014
It is my understanding that you would like to specify image data as the initial condition to a time-dependent PDE.
You can do so by interpolating the image data to the coordinates of the vertices in your mesh and then pass those interpolated values as an initial condition.
Suppose your image data, defined at background vertices "xb" and "yb", is stored in the variable "ub0". We now want to get the values, "u0", of this initial condition at your mesh vertices with coordinates "x" and "y". The interp2 function will interpolate the background image data to the mesh vertices:
>> u0 = interp2(xb,yb,ub0,x,y);
You can then pass "u0" as an initial condition to a PDE solver since it is defined at the mesh vertices. For more information on interp2, please refer to:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!