Tag Info

New answers tagged

4

Using ImplicitRegion rgn = ImplicitRegion[-1 <= y <= 1 && 0 <= x <= Sqrt[1 - y^2] && x^2 + y^2 <= z <= Sqrt[x^2 + y^2], {x, y, z}]; RegionPlot3D[rgn, PlotPoints -> 150, Axes -> True, AxesLabel -> (Style[#, Bold, 14] & /@ {"x", "y", "z"})] The volume is vol = Volume[rgn] Pi/12 or ...


7

To get the region, you can use region plot, you should take the limits of the integral exactly as they are written and supply them to the function, separating the region corresponding to each integral by the And function(&&). The edge is a little jagged, but you can play with the number of plot points to get a better or worse picture. RegionPlot3D[ ...


0

The analogous 1D problem, NDSolveValue[{D[u[x], x] == -u[x], D[v[x], x] == -v[x], u[0] == 1, v[1] == u[1]}, {u, v}, {x, 0, 2}] integrates across x == 1 without difficult. Therefore, I expected that NDSolveValue[{D[u[x, t], t] + D[u[x, t], x] == -u[x, t], D[v[x, t], t] + D[v[x, t], x] == -v[x, t], u[x, 0] == E^-x, v[x, 0] == E^(1 - x), ...


2

The error message is very descriptive: you haven't specified a boundary condition, but a condition on the middle of the region. If you amend the {x, 0, 2} to {x, 0, 1} it works correctly (but points out that your conditions are inconsistent, which they are). You should be able to impose conditions on the inside of the region by splitting the region in two, ...


4

edit I have corrected omission of absolute value determinant. I am not currently able to access Mathematica but will correct image accordingly but till then just noted sign difference. Apologies. Just another way (including @belisarius region) change of variable (for this case can use affine transform to plot): mat = {{2, 1}, {1, -1}}; rect = Rectangle[{1, ...


3

Not the simplest solution, but a clever one: eqs1 = {2 x + y == 1, 2 x + y == 4}; eqs2 = {x - y == -1, x - y == 1}; cornerPts = Flatten[({x, y} /. Outer[Solve[#1 && #2, {x, y}] &, eqs1, eqs2]), 2]; or cornerPts = Flatten[({x, y} /. Outer[Solve[2 x + y == #1 && x - y == #2, {x, y}] &, {1, 4}, {-1, 1}]), 2]; ...


9

RegionPlot[1 < 2 x + y < 4 && -1 < x - y < 1, {x, -1, 2}, {y, -1, 3}]


9

Not so fancy as transforming an image, but I like how the mesh in ParametricPlot shows the deformation. {chvar} = Simplify[ Solve[u == x y && v == y - x && y > 0 && x > 0, {x, y}, Reals], 1 <= u <= 4 && 0 <= v <= 2] (* {{x -> (2 u)/(v + Sqrt[4 u + v^2]), y -> 1/2 (v + Sqrt[4 u + v^2])}} *) ...


4

I am using all your definitions, except for bores, which I modified to use Disk instead of Circle: bores = Disk[#, 1] & /@ {center1, center2}; RegionDifference[ DiscretizeRegion@RegionUnion[ Disk[center1, radius1], Disk[center2, radius2], Polygon[tangent[[1]]~Join~Reverse[tangent[[2]]]] ], DiscretizeRegion@RegionUnion[bores] ]


0

I have found a simple solution which is to compute the outer circular arcs and use the arcs instead of the circles: angle1 = ArcTan[tangent[[1, 1, 2]]/tangent[[1, 1, 1]]]; angle2 = ArcTan[tangent[[2, 1, 2]]/tangent[[2, 1, 1]]]; arc1 = Circle[center1, radius1, { -1 angle1, 2 \[Pi] + angle1}]; arc2 = Circle[center2, radius2, { -1 angle2, angle2}];


4

ConvexHullMesh[ Flatten[Table[{4 (a = {Cos[t], Sin[t]}), {8, 0} + 3 a}, {t, 0, 2 \[Pi], 0.1}], 1]]


4

I would suggest using Disk instead of Circle as a start; the following generates a Region object that should generate what you are looking for: center1 = {0, 0}; center2 = {8, 0}; radius1 = 4; radius2 = 3; circle1 = Disk[center1, radius1]; circle2 = Disk[center2, radius2]; endpoint1 = {x1, y1}; endpoint2 = {x2, y2}; tangent = {endpoint1, endpoint2} /. ...


3

One way to do it is to specify an ExtralopationHandler (see section on extrapolation) and have it return 0. for queries outside the domain. For example: nds1 = NDSolveValue[{Inactive[Div][ Inactive[Grad][u[x, y], {x, y}], {x, y}] == 0, DirichletCondition[u[x, y] == 0, y == 0], DirichletCondition[u[x, y] == 1, y == 1]}, ...


6

Reverting to the old strategy of using Boole seems efficient on the test case: SeedRandom[0]; (* to give a reproducible result *) m1 = mesh[0.05, 10]; m1["Wireframe"] Clear[x, y, u]; nds1 = NDSolveValue[{Inactive[Div][Inactive[Grad][u[x, y], {x, y}], {x, y}] == 0, DirichletCondition[u[x, y] == 0, y == 0], DirichletCondition[u[x, y] == 1, ...


0

FYI, the random points being generated will serve as coordinate centers for randomly oriented molecules. We can generate the molecules onto the random points in region1. We want each molecule to have a random orientation so we need to do rotational transformations before we translate the molecule to its new point teosPEO := Table[ ...


0

Seems like this is an issue, thanks for looking into this @bbgodfrey. I went ahead and created four regions and got rid of the upper/lower z-bounds by increasing to -20<=z<=20. region1 is what I want, region2 through region4 are for testing. region1 is the original region that I want bounded by equation1, x, y, and two planes 6<=x-y+2*z<=7 ...



Top 50 recent answers are included