Questions tagged [discretization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
44 views

How to solve the nonlinear Schrödinger equation using 4-order Runge Kutta method? [closed]

I want to solve numerically the nonlinear Schrödinger equation (in Matlab) $$ \frac{\partial\psi}{\partial t}=-\Delta\psi - |\psi|^2\psi $$ using RK4 but i don't know how to do this.
0
votes
1answer
59 views

Are there commands other than ListPlot3D for plotting 3D points, where one coordinate ls either 0 or 1, and the other two lie in [0,1]?

I have a set of 3D points, the first coordinate of which, say, is confined to the values 0 and 1, while the other two can assume values within the unit interval [0,1]. ListPlot3D shows a continuous ...
3
votes
2answers
144 views

Calculate surface normals at the boundary of a Graphics3D object

How do I go about calculating and plotting the surface normals at the boundary of a Graphics3D object? For example, consider this custom-defined ...
0
votes
0answers
23 views

How to set PDE coefficient as a list of discrete data

How to set a pde time-dependent coefficient, not as an analytic function in time, but as a discrete data vector or list, each element of that list represents the coefficient value on a specific time ...
7
votes
1answer
157 views

MeshRefinementFunction on 2D surfaces embedded in 3D

DiscretizeRegion doesn't seem to run the supplied MeshRefinementFunction when meshing a 2D surface in 3D. For example: ...
1
vote
0answers
36 views

Discretization of the following integral: an optimal way

Consider an integral $$ I[f_{n},T]=\int \limits_{0}^{\infty} dE_{n}F(f_{n}(E_{n}),E_{n},T)+\int\limits_{0}^{\infty} dE_{n}\int_{\mathcal{F}(E_{n})}dE_{n}^{'}G(f_{n}(E_{n}),f_{n}(E_{n}^{'}),E_{n},E_{n}^...
4
votes
1answer
104 views

How to improve the solution of the following differential equation?

Consider a PDE $$ \tag 1 \frac{\partial f_{n}}{\partial t}- \frac{1}{2t}E\frac{\partial f_{n}}{\partial E} = 0 $$ I choose the initial condition $f_{n}(E, t_{0}) = e^{-E/T_{0}}$, where $T_{0}$ is some ...
2
votes
1answer
154 views

Create graded mesh

I want to create graded mesh inside a cube, with finer mesh in the left half and a coarser mesh in the right half. My plan was to partition the cube with a 2D plane and then generate boundary mesh ...
1
vote
1answer
93 views

How do I properly define and work with region unions?

Suppose I have two regions defined by two hexahedrons (slightly adapted from this question): ...
2
votes
2answers
95 views

How to discretize the boundary of two regions?

Problem How to discretize a surface constructed with multiple components? Unsuccessful attempts include combining the objects top and ...
1
vote
1answer
53 views

Unable to affect mesh regions with DiscretizeGraphics

Problem On the sphere, it is easy to control the resolution of the mesh in DiscretizeGraphics using the MaxCellMeasure ...
0
votes
1answer
70 views

Mesh Refinement for interpolation of f[x,y] fails for all but the simplest f

I would like to interpolate a function, f[x,y,z], on a mesh of the unit cube, starting with a coarse tetrahedral mesh and refining tetrahedra as needed to reduce the interpolation error below a ...
7
votes
2answers
277 views

Computing volume of intersection of two regions

I am trying to compute the volume of intersection of the following two regions: ...
6
votes
4answers
420 views

What is the best way to parse differential equations and boundary conditions to a custom function?

I have written a method to turn systems of linear differential equations into matrix equations (discretisation). This handles boundary conditions using the row replacement method. At the moment, I ...
4
votes
2answers
228 views

Why can't an annulus be mapped as a rectangle

The following code is used to map an annulus to a rectangle: ...
3
votes
1answer
138 views

Discretizing a (kinked) line and showing how the points were determined [closed]

Suppose I have a (kinked) line, for example 2-x==y && x< 1 3-2x == y && 1.5>=x>= 1 I want to take this kinked line and represent ...
0
votes
1answer
62 views

How to discritize a function domain (break xy-plane to a grid/mesh of squares with vertex values for evaluation)? [closed]

I wrote a code using MATLAB to discritize a function's 2D domain into squares/rectangles, whose vertex data (x,y) I can use to evaluate the function at. Then I sum these values over all vertices to ...
7
votes
3answers
183 views

Discretisation of region intersection in 3D

If I try to discretise the intersection (BoundaryDiscretizeRegion), of a shell in a cuboid, some of the regions (that are found with RegionIntersection) are lost in the discretising process. I tried ...
1
vote
1answer
80 views

Errors from NDSolve [closed]

I'm trying to solve a system of PDEs with periodic boundary conditions using NDSolve. This works if I don't specify an initial condition (but is uninteresting, ...
3
votes
1answer
91 views

Is there a way to automatically use triangular elements in ToElementMesh [closed]

I have some simple code to generate a mesh over a rectangle. ...
2
votes
1answer
64 views

Discretize Graphics3D with Scale and Rotate?

How can I discretize a Graphics3D object that makes use of Scale and Rotate? When I try <...
0
votes
1answer
111 views

(Updated) How do I fix a Discretization error?

I am attempting to model a cross section problem from Calculus II using the general slicing method. Below is the working code to generate the "slices" of the defined problem; however, I would like to ...
4
votes
2answers
223 views

Generating a grid such that the elements in each row add up to one

I'd like to generate a grid such that each element is a dimension $d$ vector ($\vec v$) of non negative components that add up to one. I could use the approach in this post and then choose among the ...
2
votes
1answer
80 views

Perpendicular chord lengths from the boundary points of an arbitary 2D shape

Let's generate an arbitrary convex domain with smooth boundaries: Graphics[BSplineCurve[{{1, 4}, {5, 3}, {9, 4}, {5, 5}, {8, 7}}, SplineClosed -> True]] I'...
5
votes
1answer
128 views

Randomly distributed circles inside an annulus

With the following code: ...
3
votes
1answer
78 views

Creating Voronoi Mesh Region Bounded by Convex Hull (Possible problem with DiscretizeGraphics)

I want to create a MeshRegion that is VoronoiMesh bounded by the associated ConvexHullMesh. I followed the procedure in the answer for this post, but the resulting MeshRegion is very wrong. This is ...
3
votes
1answer
435 views

DiscretizeRegion was unable to discretize the region ImplicitRegion

I'm trying to model a 3D die with ImplicitRegion[] in order to find out its center of mass. However, when I apply ...
5
votes
1answer
202 views

Converting 3D graphics primitives to 3D image data

My goal is to produce a 3D dataset, from a scene of simple transformed shapes. The idea is that this data serves as a ground truth for some tomographic reconstruction problems. (For this, it is ...
3
votes
1answer
295 views

using a custom method to discretize functions with 3 variables to be used in NDSolve

I was using the pdetoode function that @xzczd made: Dynamic Euler–Bernoulli beam equation But it only works for functions with 2 variables, I was wondering if it ...
2
votes
0answers
118 views

DiscretizeGraphics on a RegionDifference not returning a MeshRegion

I want to take region difference of a sub-mesh of a Delaunay Mesh and a discretized ImplicitRegion. However, Mathematica does not recognize the return as a MeshRegion. Moreover, Discretizing the ...
3
votes
1answer
93 views

Unexpected DiscretizeGraphics behaviour

One way to generate an annulus is by using ChartElementData: ...
3
votes
1answer
201 views

Collision between a point and a square

Suppose we have a point of time laws: xP[t_] := 0.40 + 0.51 t; yP[t_] := 0.41 + 0.42 t; and a square with side: L := 2.01 ...
2
votes
1answer
169 views

RegionPlot of DiscretizeRegion of ImplicitRegion

Writing: A = ImplicitRegion[Max[Abs[x - 1 + 2 y], Abs[y - 1 - 2 x]] == 1, {x, y}]; RegionPlot[DiscretizeRegion[A]] I get: while writing: ...
0
votes
1answer
38 views

Loops and guesses

I have to solve a system of equations in the following way: I first guess a value for a variable, let's call it y, calculate another variable ...
3
votes
2answers
306 views

How to discretize parametric curves for FEM analysis

I would like to know if there is anything available in order to discretize a 3D curve given by parametric equations in order to apply FEM analysis, e.g. to solve the wave equation on a thin wire ...
0
votes
1answer
118 views

Discretize a Graphics3D object over a given 3D lattice

Is there a way to discretize a Graphics3D object using a regular lattice with a given lattice spacing. For example: ...
2
votes
1answer
228 views

A simple way to discretize a linear region

I have a few hundred linear regions of dimensions 0, 1, 2 and 3 embedded in $R^3$ that I need to discretise. DiscretizeRegion does a good job with most of them, but ...
9
votes
1answer
180 views

Problem with ToBoundaryMesh

Bug introduced in 11.1.0 and fixed in 11.2.0 I have a problem that occurs in ToBoundaryMesh in Mathematica version 11.1, whereas in 11.0 it worked fine. I defined <...
5
votes
1answer
228 views

How to get a larger triangle when we discretize a sphere?

In order to solve this problem,I want to get larger triangles (Of course less amount). But I don't know how to do this. I have tried MaxCellMeasure and ...
6
votes
3answers
234 views

Traverse “curve” on a grid from a given cell

I've got a binary grid which is mostly zero but contains a bunch of 1-cell wide lines (e.g. obtained from a ridge extraction). You can obtain an example input from the following line: ...
0
votes
0answers
83 views

Problems with sampling

Let $t\ge 0$ and let $f_{s}(t)$ be the sampled version of $f(t)$. If $$f(t)=\begin{cases}\int_{0}^{t}\exp\left(-\frac{1}{1-s^{2}}\right)\,ds,&|s|<1, \\ 0,&\text{otherwise}.\end{cases}$$ I ...
0
votes
1answer
150 views

Issue with discretizing two arbitrary regions

Description This is in relation to this question. I am trying to derive this conical figure yet I seem to get an error with this code. I would be happy if someone could point out how to solve this ...
0
votes
1answer
261 views

Beginner Simulating Gaussian Process with Correlation

I have no little experience with algorithms. I would like to learn how to simulate a real valued Gaussian process with correlation (e.g., exponentially correlated $\Gamma(t)=e^{-\vert t \vert/2}).$ ...
5
votes
4answers
260 views

Discretize chart in a given interval

Using the following code: plot = Plot[Sin[x], {x, -Pi, Pi}]; points = Cases[plot // Normal, Line[{x__}] -> x, Infinity]; ListPlot[points] I get: Question: Is ...
1
vote
1answer
104 views

Unexpected behavior of DiscretizeGraphics

As this code,we can visualize the "Test text" Graphics[Text[Style["Test text",20],{0,0}],Axes->True,AxesOrigin->{0,0}] I try to use <...
2
votes
2answers
416 views

How to apply `DiscretizeGraphics` to a tube? [duplicate]

I want to export the numerical solution of the Chan-Lee oscillator as an STL file so that I could print it out. But when I expanded the curve into a tube, ...
12
votes
3answers
374 views

How to generate grid points on boundary of $[-1,1]^d$ for arbitrary dimension $d$ and specified resolution?

This must be a trivial thing, but I was not able to find a function for it in Mathematica. How do you efficiently create a grid with constant but specific resolution $r$ in all directions on the ...
6
votes
1answer
1k views

Finding NonlinearModelFit of multiple data sets with the same parameters and in two dimensions

I have multiple sets of data (between 3 and 6 depending on the cases) dependent of space, time, and some parameters. The data are the response of a harmonic oscillator under a non-trigonometrical ...
9
votes
1answer
159 views

DiscretizeRegion fails for a triangular region

Bug introduced in 10.2.0 or earlier and fixed in 11.0.0 I define an implicit region like ...
3
votes
1answer
118 views

How to turn a Graphics primitive into a list of data?

I tried something small first, to get a feeling about this. So I defined a Rectangle[], placed it in a corner of ...