3
$\begingroup$

A circular arc $R_2$ can be defined parametrically as $R_2 = \langle x(s),y(s) \rangle : s\in[-s_0,s_0]$ (see code below for specific $x,y$ definitions) where $s_0$ is given (I must make the arc this way, for reasons that are beyond this question).

The total domain I want to make is a box with a circular arc as the top lid instead of a flat lid. The base of the box is $R_1 = \langle x(s),-2 \rangle : s\in[-s_0,s_0]$. I plot them both so you can see the shape, but does anyone know how to fill in the total domain from $R_1$ to $R_2$?

Ultimately, I will create a mesh on this box-ish region to solve a PDE, if that's helpful.

\[Alpha] = \[Pi]/3;
s0[\[Alpha]_] = ArcSin[Cos[\[Alpha]]]/Cos[\[Alpha]];
x[s_, \[Alpha]_] = Sin[Cos[\[Alpha]] s]/Cos[\[Alpha]];
y[s_, \[Alpha]_] = (1 - Cos[Cos[\[Alpha]] s])/Cos[\[Alpha]];
\[ScriptCapitalR]1 = 
  ParametricRegion[{x[s, \[Alpha]], -2}, {{s, -s0[\[Alpha]], 
     s0[\[Alpha]]}}];
\[ScriptCapitalR]2 = 
  ParametricRegion[{x[s, \[Alpha]], 
    y[s, \[Alpha]]}, {{s, -s0[\[Alpha]], s0[\[Alpha]]}}];
RegionPlot[{\[ScriptCapitalR]1, \[ScriptCapitalR]2}]

Edit: so I used the approach below by Erlich Neumann, but there is still a major issue: Mathematica is not registering the roof of the parametric region as a true circular arc. It is evident the parametric form $\langle x(s),y(s) \rangle$ is a piece of the circle $x^2+(y-r)^2=r^2$. However, this is not the case, as the code below shows the circle and also the domain created through ParametricRegion, which are not coincident.

\[Alpha] = \[Pi]/3;
r = 1/Cos[\[Alpha]];
s0 = ArcSin[Cos[\[Alpha]]]/Cos[\[Alpha]];
x[s_] := Sin[Cos[\[Alpha]] s]/Cos[\[Alpha]];
y[s_] := (1 - Cos[Cos[\[Alpha]] s])/Cos[\[Alpha]];
Clear[h]
h = Solve[Integrate[(y[s] - h) x'[s], {s, 0, s0}] == 1, h][[All, 1, 
     2]][[1]];
\[CapitalOmega] = 
  ParametricRegion[{x[s], z}, {{s, -s0, s0}, {z, h, y[s]}}];
mesh = DiscretizeRegion[\[CapitalOmega], {{-1, 1}, {h, 1}}];
Show[mesh, 
 ContourPlot[x^2 + (y - r)^2 == r^2, {x, -1, 1}, {y, -0, 1}], 
 Axes -> True]
$\endgroup$
1
$\begingroup$

Sorry I didn't understand your code in detail. But I can present you my version which gives the region you describe:

(*s0=\[Alpha]/Sin[\[Alpha]]*)
(*x=Sin[s Sin[\[Alpha]]]/Sin[\[Alpha]]*)
(*y=(1 - Cos[s Sin[\[Alpha]]])/Sin[\[Alpha]]`)*)

\[Alpha] = Pi/3
R = ParametricRegion[ { Sin[s Sin[\[Alpha]]]/Sin[\[Alpha]],y},  
{{s, -(\[Alpha]/Sin[\[Alpha]]), \[Alpha]/Sin[\[Alpha]]}, 
{y, -2, (1 - Cos[s Sin[\[Alpha]]])/Sin[\[Alpha]]}}]

Show[DiscretizeRegion[R, {{-1, 1}, {-2, 1}}], Axes ->True]

enter image description here

$\endgroup$
  • $\begingroup$ Which version Mathematica are you using? I'm in 11.3. Are you sure you gave the same code? When I clear my Kernel and copy your code my output is a non-uniform mesh (very highly concentrated on the sides) and no points at the outer ends of the arc, so the arc ends about $x = 0.9$. I'd post a picture but don't know how. $\endgroup$ – Josh McCraney Jan 16 at 22:15
  • $\begingroup$ @ Josh McCraney Sorry, my fault: The definitions s0,x,y are only informative. I edited my answer. $\endgroup$ – Ulrich Neumann Jan 17 at 7:33
  • $\begingroup$ Below is the picture I get when using Ulrich Neumann's code. ![enter image description here](i.stack.imgur.com/GkgqH.png) $\endgroup$ – Josh McCraney Jan 17 at 14:50
  • $\begingroup$ The definitions were fine. But see the picture I posted; it's nothing like yours. $\endgroup$ – Josh McCraney Jan 17 at 14:51
  • 1
    $\begingroup$ Can confirm: 11.3 is buggy, and will produce picture I've shown. I contacted Wolfram about the issue. $\endgroup$ – Josh McCraney Jan 17 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.