New answers tagged

2

Update: It turns out we can use a simple modifications of the option setting in OP for MeshFunctions to get the desired result: 1. Boole: RegionPlot[{a, regions}, {p, 0, 10}, {q, 0, 10}, FrameLabel -> {p, q}, MaxRecursion -> 3, MeshFunctions -> {Boole[# + #2 >= 15] (#1 + #2) &, Boole[# + #2 >= 15] #1 &}, Mesh -> {30, 20}, ...


1

You could set more initial points: RegionPlot[region[h4in[g[x + I y]]], {x, 0, 1}, {y, -0.5, 0.5}, PlotPoints -> 30]


9

Update: Generalizing the ideas behind methods 1 and 2 to round the corners of arbitrary convex polygons: ClearAll[inSphere, rndCorners] inSphere[{p1_, p2_, p3_}, rad_] := Module[{rl = Min[ArcLength[Line[{p1, p2}]], ArcLength[Line[{p2, p3}]], rad + rad/Sin[VectorAngle[p1 - p2, p2 - p3]/2]]}, MeshCoordinates @ DiscretizeRegion @ Insphere[{p2, p2 + ...


6

Update 3 This is my final update except for typo corrections. I hope it provides a useful answer to the OP's question. I don't believe the OP's problem can be solved by fooling around with RoundingRadius. I think one needs to write a function that will generate a polygon that Graphics will render as a NURC (Non-Uniform-Rounded-Corners) rectangle and which ...


0

Here's a compact routine for generating the (row-wise) Gershgorin disks: gerschgorin[mat_?SquareMatrixQ] := Module[{diag, mt}, mt = mat - DiagonalMatrix[diag = Diagonal[mat]]; Apply[RegionUnion, MapThread[Disk, {ReIm[diag], Total[Abs[mt], {2}]}]]] Note that I use Apply[] on the list of Disk[] objects generated. I'll leave the extension to the column-...


6

Transform your conditions to cylindrical coordinates cond = x^2 + (y - 1)^2 < 1 &&0 < z < x^2 + y^2 /. {x -> r Cos[φ], y -> r Sin[φ]} // FullSimplify[#, {r > 0, -Pi < φ < Pi}] & (*r < 2 Sin[φ] && 0 < z < r^2*) to get the integration limits! The first condition (remember r > 0) implies 0 < ...


4

You can visualize the region of integration as follows if specified in rectangular / Cartesian coordinates. I am looking for a way to specify in cylindrical to the plot directly and will update when I find it. With[{ Δ=0.1 }, RegionPlot3D[And[ x^2+(y-1)^2<=1, z<=x^2+y^2, z>=0 ], {x,-1-Δ,1+Δ}, {y,0-...


1

You can use BoundaryDiscretizeRegion with the method "Semialgebraic": BoundaryDiscretizeRegion[ ImplicitRegion[Abs[x] + Abs[y] + Abs[z] <= 1, {x, y, z}], Method -> "Semialgebraic"]


2

Yet another way to discretize the Steinmetz solid is to directly derive the required inequalities using RegionMember[]: ineq = Simplify[RegionMember[RegionIntersection[Cylinder[{{0, 0, -2}, {0, 0, 2}}], Cylinder[{{0, -2, 0}, {0, 2, 0}}], Cylinder[{{-2, 0, 0}, {...


2

Monge patches like the one in the OP, when expressed as a ParametricRegion[], are often troublesome to discretize without special treatment like what kglr does. Instead, one could reformulate the surface as an ImplicitRegion[], like so: reg = ImplicitRegion[z == 1.5 E^(-5.5 (Sqrt[x^2 + y^2] - 5)^2), {{x, -6, 6}, {y, -6, 6}, {z, -1, 7}}]...


0

Change vy=.. to a pure function j[x_?NumericQ, y_?NumericQ] := Evaluate[-Derivative[1, 0][psi][x, y]] NMaximize gives the complete solution maxi = NMaximize[j[x, y], {x, y} \[Element] regPl] (*{0.418163, {x -> -0.91878, y -> 0.881249}}*) Unfortunaely this maximum isn't very accurate. workaround The solution NDSolveValue uses FiniteElement, ...


6

ri = RegionIntersection[Cylinder[{{0, 0, -2}, {0, 0, 2}}], Cylinder[{{0, -2, 0}, {0, 2, 0}}], Cylinder[{{-2, 0, 0}, {2, 0, 0}}]]; You can use PlotPoints as a suboption for Method options: DiscretizeRegion[ri, Method -> {"DualMarchingCubes", PlotPoints -> 150}]


3

Using the second argument to specify explicit bounds (as suggested by Henrik in comments) helps remove the empty regions: DiscretizeRegion[ℛ, {{-6, 6}, {-6, 6}, {-1, 2}}, AccuracyGoal -> 3] We can not use the option PlotPoints in DiscretizeRegion directly. However, we can use the option Method and control mesh quality by injecting PlotPoints as a ...


Top 50 recent answers are included