1 Introduction and background

The development of computer methods for solution of scientific and engineering geometrical problems governed by physical laws, began in the last quarter of the previous century. Most of the methods presented were concerned with the interaction between theory and application, especially for industrial purposes. Although, many of them were based on numerical analyses, there were some powerful techniques which made use of optimal control theory (Mohammadi and Pironneaun 2002; Pironneau 1983). In line with this theory, some methods were established for calculating the differentials of the objective function over the boundary of the given domain [as in the mapping method in Pironneau (1983)]. Of course, these methods required the solution of a numerical algorithm as well. As a matter of fact, the idea of applying optimal control techniques for solving optimal shape design problems is old; nevertheless by offering new methods, optimal control theory plays a key role in the improvement of this branch.

In general, most of solving optimal shape design problems are dependent on the method used to solve differential equation existing in the problem. However, sometimes among the studies conducted, we find methods dependent on the type of optimization method used in the problem. Among there methods, we could refer to the minimax method, which does the calculations by a minimax problem under the basis of a suitable vector field, or the least-square method (Belegun and Rajan 1988).

Obtaining optimization conditions and also the need for finding an acceptable numerical solution for the problem necessitate the use of numerical methods in some problems. Such methods, in general, are capable of algorithmic implementation; three well-known methods in this regard are finite element method, finite difference and boundary elements which have their own specific used based on the type of the problem (Hicks and Hanne 1977).

One of the important points which needs to be considered in optimization is the extent to which the information related to the objective function gradient and conditions accessible. The finite difference method may calculate the gradients approximately but the calculation is not that accurate (Park et al. 1983).

One of the other methods for solving optimal shape design problems is the level set method. This method was presented by Osher and Sethian in 1911 which is a method for examining the movement of levels in dimensions 2 and 3 (Osher and Sethian 1988).

The sensitivity analysis of the basis of another method which could be called the sensitivity shape. This method is often used for problems which are related to the tension or have a elastic structure. This method is often based on the changes of the system and the objective function in relation to partial changes in geometric variables; mechanical engineers often benefit from this method in their related problems. In the control theory, basic methods have been invented to calculate objective function differentials which are dependent on the boundary of the respective domain. Therefore, in this vein, optimization and control theories could present methods for solving optimal shape design problems. Provided that the defined control function is related to the domain shape, embedding and characteristic function methods are in this category (Pironneau 1983).

These methods naturally directed the problem to a numerical algorithm. Among these categories, it could be said that the embedding method is the most efficient one. In this method, first, the differential equation solution space of the optimal shape design problem is transferred to a fixed domain. Then, the problem is changed into an optimal control problem whose controls appear in the coefficients of differential equation. Then, using control theory methods, one can solve the new problem.

One of the methods for solving optimal control problem which has recently been used in the embedding method. This method has been designed on the basis of Young’s idea which uses measure space (Fakharzadeh and Alimorad 2019).

In 1986, by complementing Young’s idea, Rubio introduced a new embedding process for solving optimal control problems (Rubio 1986). Its remarkable advantages encouraged some researchers in the optimal shape area to apply it. The method was based on embedding the solution space of the optimal control problem into an appropriate measure space. Therefore, one can employ the strong linearity property of measures to obtain the optimal solution. The automatic existence theorem, globality of the solution, linear treatment even for extremely nonlinear problems and an easy algorithmic path for determining the optimal control, can be stated as its advantages.

On this basis, we presented the first work in Fakharzadeh and Rubio (1999) to introduce a technique for obtaining the most suitable simple closed curve in polar coordinates. The manner of determining by use of measures the optimal domain in polar and Cartesian planes for different partial differential systems are also discussed in Fakharzadeh (2003), Fakharzadeh and Rubio (2009), Farahi et al. (2006), Farhadinia and Farahi (2007) and Nazemi and Farahi (2009). Additionally, applications of the method in designing the optimal shapes for engineering purposes can be found in Farhadinia and Farahi (2005), Mehneh et al. (2005), Nazemi et al. (2008) and Nazemi et al. (2009).

The reader can see (Fakharzadeh and Alimorad 2019) for knowing more about the history and applications of this method.

Regarding Mehneh et al. (2005), in this, we would like to introduce a general technique for generating optimal rotated objects using Rubio’s method. In this manner, we would be able to obtain the general physical properties of the desired optimal shape. We inclined this simple and linear method to be independent from the induced relation of the system involved (compare with Farhadinia and Farahi 2005; Mehneh et al. 2005; Mohammadi and Pironneaun 2002; Pironneau 1983) and also to produce the optimal shape numerically. To determine the efficacy of this method in numerical Examples 1 and 3, we have compared this method with the level set method.

2 The conversion of the classical problem to an optimal control problem

We are interested in designing a smooth and simple generator curve \(\Gamma (x)\) for \(x\in X\), so that \(\Gamma (0)=a\), \(\Gamma (L)=b\), and by rotating \(\Gamma (x)\) around the x-axis, we obtain the generated surface or shape has the desired physical properties (fixed volume, given area, center of mass, total mass, etc.) and also minimizes a given functional \(\mathcal{I}\) which is dependent on the geometrical element \(\Gamma (x)\).

Let \(L\in {\textbf{R}}^+\), \(X=[0,L]\), \(X^0=(0,L)\), \(\Upsilon =[a,b]\), \(\Omega =X\times \Upsilon \times U\) and \({\tilde{\Omega }} =X\times \Upsilon \) where \(U\subseteq R\) is a compact and bounded set. The aim is to find a boundary which minimizes the following functional

$$\begin{aligned} \mathcal{I}(\Gamma ,\vartheta )=\int \int _A f_0(x,\Gamma ,\vartheta )d\Gamma \textrm{d}x+ \int _{\partial A}\frac{h_0(x,\Gamma )}{\sqrt{1+\vartheta ^2}}\textrm{d}x, \end{aligned}$$
(2.1)

where \(f_0\in C(\Omega )\) and \(h_0\in C({\tilde{\Omega }}).\) Suppose A is a region bounded on the plane by the known boundaries \(\Gamma _{1}, \Gamma _{2}\) and \(\Gamma _{3}\) and the unknown boundary \( \Gamma (x),\) such that first, \( \Gamma (x) \) Crosses the fixed points (0, a) and (Lb) as its two ends, and second, the boundary of A forms a simple smooth closed curve (see Fig. ). It is clear that changing \( \Gamma (x) \) also changes the area of A, which means that A is in fact a function of \( \Gamma \); thus with a given \( \Gamma (x)\), we take every pair \((A, \partial A)\) satisfying these conditions as an acceptable geometric element. Hence, the classical problem of optimal shape design is basically equal to minimizing function \(\mathcal{I} (A, \partial A).\)

Fig. 1
figure 1

Region A and its boundary \(\partial A\)

Assume now that the optimal shape has such physical properties that it occupies a fixed volume and its center of mass is the desired point \(({\bar{x}},{\bar{y}},{\bar{z}})\) in space. Thus, to find the center of the shape, the following relations may be used (Rudin 1987):

$$\begin{aligned} {\bar{x}}=\frac{\int \int \int _D x\delta dv}{M},~~ \bar{y}=\frac{\int \int \int _D y\delta dv}{M},~~ \bar{z}=\frac{\int \int \int _D z\delta dv}{M}, \end{aligned}$$
(2.2)

where \(\delta (x,y,z)\) is the density of the shape that occupies such a region as D in space and M is the mass of shape D. Now, we consider the boundary \( \Gamma (x) \) as a control function and then convert the OSD problem to an optimal control problem where the task is to minimize (2.1) subject to the variational constraints (2.2). For smoothness of the unknown boundary \(\Gamma (x)\), we define the artificial control \(\vartheta :X\rightarrow U\) such that

$$\begin{aligned} \vartheta (x)=\dot{\Gamma }(x)=\frac{\textrm{d}\Gamma (x)}{\textrm{d}x}\equiv g(x,\Gamma ,\vartheta ),~~\forall x\in X, \end{aligned}$$
(2.3)

where \(\Gamma : X\rightarrow \Upsilon \) is the trajectory and (2.3) the state equation in optimal control theory view.

Definition 2.1

We shall say that a pair \(p=(\Gamma ,\vartheta )\) is admissible if the following conditions hold:

(i) \(\vartheta (x)\) is a control function and takes its value in a set U.

(ii) \(\Gamma (x)\) is a differentiable function, \(\Gamma (0) = a, \Gamma (L) = b\) and also satisfies (2.3).

We assume that the set of all admissible pairs is non-empty and denote it by \(\mathcal P\).

Generally, it is not always an easy task to find the solution to such classical problems and problems may arise in the solution process. For instance, set \(\mathcal{P}\) may be empty; even if \(\mathcal{P}\) is non-empty, its solution may not be obtainable. It is also likely that writing the necessary general conditions for the existence of a solution is difficult or even impossible. Considering such difficulties, we seek to propose a method which does not involve those difficulties as far as possible.

3 Metamorphosis

In this section, we try to change the solution space in an appropriate way. We transfer the problem of minimization of (2.1) over \(\mathcal P\), into another, nonclassical problem which appears to have some better properties in some aspects.

In the following, we use a transformation to enlarge the set \(\mathcal P\). For each admissible pair p, we can define a linear functional \(\Lambda _A: C(\Omega )\rightarrow {\textbf{R}}\) defined by \(h\longmapsto \int _0^L h(x,\Gamma ,\vartheta ) \textrm{d}x\). Some aspects of the mapping \(\Lambda _A\) are useful; it is well defined, it is linear, it is positive, i.e., \(\Lambda _A (F) \ge 0\) if \(F \ge 0\), and this mapping is continuous.

By Riesz representation theorem, an admissible pair \(p=(\Gamma ,\vartheta )\) defines a positive Radon measure \(\mu \) on \(\Omega \), so that \(\mu _A(h)=\Lambda _A(h)=\int _0^L h\textrm{d}x\) and \(h\in C(\Omega )\). Also we need to convert (2.1), \(\Gamma (0)=a\) and \(\Gamma (L)=b\) to its integral form. For this purpose, let B be an open disc in \({\textbf{R}}^2\) containing \({\tilde{\Omega }}\), and let \(C'(B)\) denote the space of real-valued continuous functions on B whose first derivatives are bounded. Suppose \(\phi ^g(x,\Gamma ,\vartheta )=\phi _\Gamma (x,\Gamma )\vartheta (x)+\phi _x(x,\Gamma )={\dot{\phi }} (x,\Gamma )\), for all \(\phi \in C^{'}(B)\); then, integrating over X, we have:

$$\begin{aligned} \begin{array}{l} \int _0^L\phi ^g(x,\Gamma ,\vartheta )\textrm{d}x=\int _0^L\dot{\phi }(x,\Gamma )\textrm{d}x=\phi (L,\Gamma (L))-\phi (0,\Gamma (0)) \equiv \delta \phi , ~~\forall \phi \in C^{'}(B). \end{array}\nonumber \\ \end{aligned}$$
(3.4)

Therefore, conditions \(\Gamma (0)=a\) and \(\Gamma (b)=L\) are satisfied using this set of constraints.

Let \(D(X^0)\) be the space of infinitely differentiable real-valued functions with compact support in \(X^0\); from (3.4) and by considering \(\phi (x, \Gamma )=\Gamma (x) \psi (x),\) we conclude:

$$\begin{aligned} \int _0^L\psi ^g(x,\Gamma ,\vartheta )\textrm{d}x=\Gamma (x) \psi (x)|_0^L=0~~~,\forall \psi \in D(X^0). \end{aligned}$$
(3.5)

Since each differentiable function with finite derivatives satisfies the Lipschitz condition and is absolutely continuous, function \(\psi (x)\) is absolutely continuous; if \(\Gamma (x)\) is absolutely continuous, then, function \(\Gamma (x) \psi (x)\) is also absolutely continuous. Therefore, its derivative has some elementary functions (see Rudin 1987). It is also important to derive a special case of (3.4); this case will be necessary when we wish to consider the approximation scheme. Denote \(C_1(\Omega )\subseteq C(\Omega )\) as the set of all functions which depend only on the variable x; thus:

$$\begin{aligned} \int _0^L t(x,\Gamma ,\vartheta )\textrm{d}x=a_t, ~~~~\forall t\in C_1(\Omega ), \end{aligned}$$
(3.6)

where \(a_t\) is the integral of t over [0, L].

At this stage, we consider the desired physical properties of the optimal shape. Let V and \((\bar{x}_A,{\bar{y}}_A,{\bar{z}}_A)\) be the favorable volume and center of mass for the optimal shape, respectively. By Pappus’s theorem (Leopold 1976), we should have \(V=2\pi {\bar{y}} {\bar{A}}\), where \(\bar{A}=\int _0^L\int ^{\Gamma (x)}_{0} \textrm{d}y\textrm{d}x\) is the area and \(({\bar{x}},{\bar{y}})\) is the center of mass of region A. Thus, we have:

$$\begin{aligned} \int _0^L\int _0^{\Gamma (x)}\textrm{d}y\textrm{d}x = \int _0^L\Gamma (x)\textrm{d}x= \frac{V}{2\pi {\bar{y}}}. \end{aligned}$$
(3.7)

If the curve \(\Gamma (x)\) revolves about the x-axis, due to the fact that all cross sections perpendicular to the x-axis are circles, the surface resulting from such revolution can be expressed by the relation \(z^2+y^2={\Gamma (x)}^2\). Thus, Moreover, we know that the equation of the surface is \(z^2+y^2={\Gamma (x)}^2\); hence, by considering the symmetry property of the shape, we have:

$$\begin{aligned} {\bar{x}}_A=\frac{\int \int \int _DxdV}{\int \int \int _D dV} = \frac{\int ^L _0 x\Gamma ^2(x)\textrm{d}x}{\frac{1}{2}\int ^L _0 \Gamma ^2(x)\textrm{d}x}; \end{aligned}$$

thus,

$$\begin{aligned} \int _0^L\left( \frac{{\bar{x}}_A}{2}-x\right) \Gamma ^2(x)\textrm{d}x=0. \end{aligned}$$
(3.8)

We remind that, \((\frac{{\bar{x}}_A}{2}-x)\Gamma ^2(x)\in C^1(\Omega )\) and \({\bar{y}}_A={\bar{z}}_A=0\), since the x-axis is the axis of rotation. Now, the set of Eqs. (3.4)–(3.8) explain the properties of an admissible pair in \(\mathcal P\). So, the problem is defined as follow:

$$\begin{aligned} \begin{array}{lll} \min : &{} \mathcal{I}(\Gamma ,\vartheta )= \mu (f),\\ S. \ to: &{} \mu _{A} (\phi ^g)=\delta _\phi , &{} \forall \phi ^g \in C^{'}( B);\\ &{} \mu _{A}(\psi ^g)=0 , &{} \forall \psi ^g \in D(X);\\ &{} \mu _{A}(f) = a_t , &{} \forall t\in C_1(\Omega );\\ &{} \mu _{A}(\Gamma (x)) =\frac{v}{2\pi {\bar{y}} {\bar{A}}}; &{} \\ &{} \mu _{A}(\frac{{\bar{x}}_A}{2} - x )\Gamma ^2(x)=0. &{} \end{array}\nonumber \\ \end{aligned}$$
(3.9)

This transfer is one-to-one (see Rubio 1986) and hence all the difficulties mentioned still exist. For this reason, we enlarged the underlying space; (instead the defined set of measures by the Riesz representation theorem) among those positive Radon measures in \(M^+(\Omega )\), we seek in the set of all those positive linear functionals on \(C(\Omega )\) which satisfy (3.9). In this new problem, we shall simply consider all linear functional \(\mu \) on \(C(\Omega )\) satisfy (3.9) and seek to minimize functional \(\mu \rightarrow \mu (f)\) over this new and larger set of functionals. So, one can define problem (3.9) as follows:

$$\begin{aligned} \begin{array}{lll} \min : &{} \mathcal{I}(\Gamma ,\vartheta )= \mu (f),\\ S. \ to: &{} \mu (\phi ^g)=\delta _\phi , &{} \forall \phi ^g \in C^{'}( B);\\ &{} \mu (\psi ^g)=0 , &{} \forall \psi ^g \in D(X);\\ &{} \mu (f) = a_t , &{} \forall t\in C_1(\Omega );\\ &{} \mu (\Gamma (x)) =\frac{v}{2\pi {\bar{y}} {\bar{A}}}; &{} \\ &{} \mu (\frac{{\bar{x}}_A}{2} - x )\Gamma ^2(x)=0. &{} \end{array}\nonumber \\ \end{aligned}$$
(3.10)

4 Existence and approximation

Let Q be the solution set of problem (3.10). In the sense of weak\(^*\) topology, Q is compact; moreover, the function \(\mu \longmapsto \mu (f)\) is continuous and hence, it attains its minimum, say \(\mu ^*\) in the compact set Q (see Rubio 1986 Proposition II.3 and Theorem II.1). Despite the fact that problem (3.10) is linear with respect to the unknown measures \(\mu \), the dimension of the underlying space and the number of equations are infinite. To attain the optimal control, we applied two stages of approximation to find the solution via the results of a finite linear programming. It is possible to approximate the solution of the problem (3.10) by the solution of a finite dimensional linear program of sufficiently large dimension. Besides, by increasing the dimension of the problem, the accuracy of the approximation can be increased. First, we consider the minimization of (3.10) not only over set Q, but also over its subset called \(Q(M_{1}, M_{2},M_{3})\) and defined by only a finite number of constraints to be satisfied. Consider the equalities (3.10). Let the sets \(\{\phi _{i}, i \in N \}\), \( \{\psi _{j}, j \in N\}\) and \(\{ t_{s}, s \in N\}\) are the sets of total functions, respectively, in \(C'(B)\), \(D(X^{0})\) and \(C_{1}(\Omega )\). Now, we select a finite subset of each set. In this manner, for the first set of equations in (3.10), let set \(\phi _{i}\) be such that the linear combinations of these functions are uniformly dense (i. e. they are dense in the topology of uniform convergence) in space \(C'(B),\) these functions can be taken to be monomials in the components of variables x and \(\Gamma \). For the next two sets of equations, we select: \( \psi _l=\sin (\frac{2\pi lx}{L}),~ l=1,2,...,M_{21};~~ \psi _{l'}=1-\cos (\frac{2\pi l'x}{L}),~l'=1,2,...,M_{22}\) these functions are useful as bases for Fourier series, which are usually utilized in analyzing physics and engineering problems. On the other hand, because of the density of the linear combinations of this set of functions in different mathematical spaces, it is possible to approximate the functions in these spaces using a linear combination of these triangular functions. Also, we consider the third set of Eq. (3.10) as follows:

$$\begin{aligned} t_s(x) = \left\{ \begin{array}{l l} 1 &{}~~~x\in J_s\\ 0 &{}~~~x\notin J_s, \end{array} \right. \end{aligned}$$

where \(J_s=[\frac{L(s-1)}{S},\frac{sL}{S}),s=1,2,...,S\in {\textbf{N}}\). Although the functions in the last set are not continuous, the linear combinations of them can efficiently and properly approximate any functions in \(C(\Omega )\) properly. For fixed numbers \(M_{1}, M_{2}\) and \(M_{3}\), we select \(M_{1}\) number of \(\phi _{i}\), \(M_{2}\) of \(\psi _{j}\), where \(M_{2}=M_{21}+M_{22}\), and \(M_{3}\) of \(t_s\) functions, respectively. Now, the following proposition is satisfied whose proof is similar to proposition III.1 in Rubio (1986).

Proposition 4.1

Let \(M_{1},M_{2}\) and \(M_{3}\) be positive integers. Consider the problem of minimizing the function \(\mu \,\longrightarrow \, \mu (f)\) over the set of measures \(Q(M_{1},M_{2},M_{3})\) in \(\mathcal{M}^{+}(\Omega )\) which satisfies the following conditions:

$$\begin{aligned} \begin{array}{ll} \mu (\phi ^g_i)=\delta \phi _i, &{}i=1,2,...,M_1;\\ \mu (\psi ^g_i)= 0,&{}i=1,2,...,M_2;\\ \mu (t_s)= a_s ,&{}s=1,2,...,M_3;\\ \mu (\Gamma (x)) =\frac{v}{2\pi {\bar{y}} {\bar{A}}} ;&{} \\ \mu (\frac{{\bar{x}}_A}{2} - x )\Gamma ^2(x)=0; &{} \end{array} \end{aligned}$$
(4.11)

then, \(\inf _{_{Q(M_{1},M_{2},M_{3})}} \mu (f)\) tends to \( \inf _{_{Q}}\,\mu (f)\) when \(M_{1},M_{2},M_{3} \longrightarrow \infty \).

As a matter of fact, (4.11) is a semi-infinite linear programming problem and there are some methods for solving it (see, for example, Glashoff and Gustafson 1983). However, favoring the simpler way, we carried out the second stage of approximation. Rosenbloom in Rosenbloom (1956) showed that the measure \(\mu ^*\) in \(Q(M_1,M_2,M_3)\) has the form \(\mu ^*=\sum ^{M_1+M_2+M_3+2}_{j=1} \alpha ^*_j\delta (z^*_j)\) with the triples \(z_j^*\) belonging to a dense subset of \(\Omega \) and the coefficients \(\alpha ^*_j\ge 0 \) for \( j=1,2,\ldots , M_1+M_2+M_3+2\). Now, a discretization by nodes on a dense subset of \(\Omega \) can reduce the number of unknowns to only the coefficients \({\alpha _j^*}^,\)s. Thus, problem (3.7) can be approximated by the following finite linear programming problem. The same theorem as Theorem III.1 in Rubio (1986) can show that when the number of nods and constraints tends to infinity, the solution of the problem tends to the optimal solution of the classical problem.

$$\begin{aligned} \begin{array}{lll} \min : &{} \sum _{j=1}^M \alpha _j f(z_j)\\ S.\ to: &{}\sum _{j=1}^M \alpha _j(\phi _k ^g)(z_j)=\delta _{\phi _k}, &{}k=1,2,...,M_1;\\ &{} \sum _{j=1}^M \alpha _j(\psi _h^g)(z_j)=0 , &{} h=1,2,...,M_2;\\ &{} \sum _{j=1}^M \alpha _jt_s(z_j) = a_s, &{} s=1,2,...,M_3 ;\\ &{} \sum _{j=1}^M \alpha _j\Gamma _j =\frac{v}{2\pi {\bar{y}} {\bar{A}}};\\ &{} \sum _{j=1}^M \alpha _j(\frac{{\bar{x}}_A}{2} - x )\Gamma ^2_j=0; &{} \\ &{}\alpha _j\ge 0 ,~~j=1,2,...,N; \end{array} \end{aligned}$$
(4.12)

where \(a_s=\int _{J_s}\textrm{d}x=\frac{L}{M_3}\) that \(J_s=[\frac{L(s-1)}{M_3},\frac{Ls}{M_3})\) and \(\bigcup {J_s}=[0,L]\).

The method suggested based on measures has two approximation steps. This approximated solution will get more and more accurate once the conditions are increased and the discretization (the number of variables) is made more exact.

In seeking to assess the potentialities of our approach as a computational method, the increase of the number M of variables with the dimensionality of the problem—the number of states and controls—is most important. Of course, the number M of equations also increases with the number of dimensions, but not very fast, and the numbers involved are, anyway, comparatively small. The large size of the linear programming problem, due to the large size of the number of variables, gives rise to two main difficulties. The first, the large amount of computer memory necessary to store the matrix of coefficients, can be taken care of by computing the entries of this matrix every time they are needed; this only exacerbates the second difficulty, increasing the time needed to actually solve the linear programming problem. Of course, an assessment can be seriously carried out only after much work in optimizing every aspect of the computation, using, for instance, a professionally written modified simplex program; we can mention here, however, an aspect that gives reason for optimism: the high accuracy that can be obtained with very coarse meshes. Also, it should be noted that there do not seem to be other methods guaranteed to work under general conditions, even for low-order problems; our method does not take any special notice of whether the differential equations are linear, or the performance criterion quadratic. A possible way to proceed with the development of this method is to use in a first run of a problem a very coarse mesh—which implies a small value of M—and then replace in a subsequent run the set \(\Omega \) by a smaller subset containing the solution obtained in the first run; in this way, we obtain high resolution with a comparatively small value of M.

5 Algorithm (solution procedure)

To apply the mentioned method, here, we present an algorithmic path for the solution procedure:

Step 1) Statement of the classical problem according to integral equations: Using relationship \(\Lambda _{A}\), all conditions as well as the objective function of problem are expressed in the form of integral relationships over region A.

Step 2) representation in a space of measures: According to the Riesz representation theorem, specific functionals defined on the basis of path and control functions introduce unique measures such that there will be one-to-one correspondence between the pair of path and control functions and a subset of positive Radon measures. In this step, problem (3.9) was obtained.

Then, instead of the measure introduced based on Riesz Representation theorem, we consider all positive Radon measures which just satisfy Eq. (3.9) and we obtain problem (3.10).

Step 3) Choosing the number of constraints: By considering a finite number of constraints in (3.10), we change the problem into a new one, namely a semi-infinite linear programming problem (4.11). Therefore, for given fixed numbers \(M_{1}, M_{2}\) and \(M_{3}\), we select \(M_{1}\) number of \(\phi _{i}\), \(M_{2}\) of \(\psi _{h}\), and \(M_{3}\) number of \(t_{s}\) functions from the mentioned total sets.

Step 4) Approximating with a finite linear programming problem:

(i) Determining region \(\Omega \): The problem should specify the constituting regions of \(\Omega \) In this problem, \(\Omega =X\times \Upsilon \times U\), where X is the interval for x, \(\Upsilon \) the interval for \(\Gamma (x)\) and U the interval for \(\vartheta (x)\). Choosing a number N, region \(\Omega \) is divided into N equal parts, so that we obtain a partitioning for region \(\Omega \) which includes N cells. Next, the constituting intervals of \(\Omega \), are divided into \(n_{1}\), \(n_{2}\) and \(n_{3}\) equal parts, respectively; in this manner, region \(\Omega \) will have \(N= n_{1} \times n_{2} \times n_{3}\) cells.

(ii) Choosing \(Z_{i}^{,}\)s: From each of the cells obtained in step 1, we arbitrarily choose a representative point \(z_{i}= (x_{i}, \Gamma _{i}, \vartheta _{i})\), and number these points from 1 to N.

In this way, all the necessary elements are available for solving the linear programming problem.

Step 5) Identifying the optimal shape: Following the above choices, a linear programming problem with \(M= M_{1}+M_{2}+M_{3}+2\) constraints and N variables is obtained whose positive answers are called \(\alpha ^*_1, \alpha ^*_2,..., \alpha ^*_m\), \((m \le M)\).

Step 6) Calculating the control function and the path: Upon finding \(\alpha ^*_1, \alpha ^*_2,\ldots , \alpha ^*_m\), we obtain the control function and the optimal path in this manner:

a) Assuming \(x_{0}=0\) we set \(x_{i}=x_{i-1}+\alpha ^*_i\) \(i=1,2,\ldots ,m\).

b) For \(x \in [x_{i-1}, x_{i})\) we set \(\vartheta (x)=\vartheta _{i}\), where \(\vartheta _{i}\) is a component of \(z_{i}\) (which is related to \(\alpha ^*_i\))

c) Assuming \(\Gamma _{0}=a\) and \(\Gamma _{L}=b\) and using the differential equation \(\vartheta (x)={\dot{\Gamma }}(x)\), gives the following difference equation which yields the value of \(\Gamma _{i}\) for each i as

$$\begin{aligned} \Gamma _{i}=\Gamma _{i-1}+(x_{i}-x_{i-1})\vartheta _{i},\ \ \ \ \ i=1,2,\ldots ,m. \end{aligned}$$

Step 7) Drawing the control function and the optimal path diagrams: with the data obtained from the previous step, points \((x_{i}, \Gamma _{i}, \vartheta _{i})\) are determined. With intervals more finely discretized by \(\vartheta _{i}\) and by the use of software, the nearly optimal control function is found to be a piecewise constant function and the nearly optimal shape to be a set of broken lines.

One of the current methods of solving shape optimization problems is the level set method; to compare this method with the shape-size method in terms of efficiency, a brief review of the level set method will follow in the next section. In addition, two numerical examples will be solved and comparison will be made of the results obtained by the two methods.

6 Level set method

The level set approach was introduced by Osher and Sethian (1988). We can use the level set method to represent the unknown curve \(\partial A\), i.e., we try to find a function \(\varphi (t,x)\) such that

$$\begin{aligned} \Gamma (t)=\{x|\varphi (t,x)=0\}. \end{aligned}$$

In the above, \(\Gamma (0)\) is the initial curve and \(\Gamma (t)\) converges to the unknown true boundary, when \(t\rightarrow \infty \). One of the essential ingredients of the level set method is to find the velocity field \(V_{n}(t,x)\) in the normal direction of \(\Gamma (t)\), which is the used to move the level set function \(\varphi (t,x)\) by solving

$$\begin{aligned} \varphi _{t}-V_{n}|\nabla \varphi |=0,\ \ \ \ \ \ \varphi (0,x)=\varphi _{0}(x). \end{aligned}$$

We shall use the following gradient method to find a function \(\varphi \), which approximates the minimizer of (2.1) with respect to (3.8):

$$\begin{aligned} \varphi ^{n+1}= \varphi ^{n}-\alpha \frac{\partial J_{\varepsilon }}{\partial \varphi }(\varphi ^{n}), \end{aligned}$$
(6.13)

where \(J_{\varepsilon }=\mathcal{I}(\Gamma ,\vartheta )+\frac{1}{\varepsilon }\int _0^L(\frac{\bar{x}_A}{2}-x)\Gamma ^2(x)\textrm{d}x\). The step size \(\alpha \) is fixed and \(\varepsilon =10^{-3}\).

In this paper [0, 3] is divided into \(n=400\) subintervals, and we let \(h=\frac{3}{n-1}\) and \(\alpha =0.5h\).

Because the objective function \(J_{\varepsilon }\) is a function of unknown boundary \(\Gamma (x)\), we assume that \(\Gamma =\varphi \). Thus, by obtaining the unknown function \(\varphi \), the unknown boundary \(\Gamma \) is obtained. In both Examples 1 and 3, we use the penalty function \(J_{\varepsilon }\). Then, we compute the topological derivative associated with \(J_{\varepsilon }\), the notion introduced in Delfour and Zolesio (2001) and put in (6.13).

7 Numerical examples

To test the introduced method in practice and also to show how it is applied, we intend to solve some classical examples. The following classical examples are selected in such a way as to demonstrate the generality and capability of the introduced method in some different cases. In all the examples, their related finite linear programming problems are solved by revised simplex method in subroutine DLRRS from the IMSL library of the software Compaq Visual Fortran 6.5. Then, in the manner explained in Rubio (1986), the nearly optimal control is established. By applying (2.3) to the obtained control, some points on \(\Gamma (x)\) are determined. Afterwards, the optimal generator curve is illustrated by (a removed) curve fitting with spline functions of degree 3, done by the software Maple 9.5. Moreover, for the discretization schemes, in all the examples \(N=12{,}000\) nodes in \(\Omega \) are selected by dividing \(X, \Upsilon \); and U, respectively, into 20, 30, and 20 subdivisions. Also, these examples are solved using the level set method and the results are compared.

Example 1

A simple computation shows that point (9/5, 0, 0) is the center of mass for the rotated shape generated by the curve \(\Gamma (x)= \sqrt{x+1}\), \(0\le x\le 1\) (around the x-axis). In this way, we intend to find the curve \(\Gamma (x)\) with the initial and the final points (0, 1) and (3, 2) so that point (9/5, 0, 0) is its center of mass. By trial and error, we chose \(X=[0,3]\), \(\Upsilon =[1,2]\), \(U=[0.3,0.8]\), \(M_1=2\), \(M_2=6\), \(M_3=10\) and we let the objective function f be a constant. Then, the related LP (like 4.12) with 12,000 variables and 19 constraints was set up. From the results, the nearly optimal control was determined (Fig. ).

After doing the curve fitting, the nearly optimal curve together with the curve \(\sqrt{x+1}\) were plotted in Fig. . A simple comparison shows the ability and accuracy of the method. The nearly optimal shape was also shown in Fig. .

In the level set method, we assumed the initial curve to be a straight line that passes through the points (0, 1) and (3, 2), i.e., \(y=\frac{1}{3}x+1\) and \(\frac{\partial J_{\varepsilon }}{\partial \varphi _{i}}=\sum _{i=1}^{n}(x_{i}-1.9)^{2}\sqrt{\triangle x_{i}^{2}+\triangle \varphi _{i}^{2}}\). In Fig. , the curve obtained with the level set method and the curve obtained with the method presented in this paper are marked in black and red, respectively.

The curve obtained using the level set method, the initial curve and \(y=\sqrt{x+1}\) are drawn in Fig. . It is apparent in these figures that the two curves are quite similar in this example; however, the level set method has a better answer.

Fig. 2
figure 2

The nearly optimal control for Example 1

Fig. 3
figure 3

The generator curve obtained by a spline function for Example 1

Fig. 4
figure 4

The nearly optimal shape for Example 1

Fig. 5
figure 5

The initial and optimal curve obtained by the level set method for Example 1

Fig. 6
figure 6

Comparison of the two curves obtained in Example 1

Example 2

We would like to cut a rectangular metal surface with length \(L=3\) and width \(b=2\) by curve \(\Gamma (x)\) from (0, 1) and (3, 2) (see Fig. 1), so that the lower part has the point \(({\bar{x}},{\bar{y}})=(1.8,0.8)\) as its center of mass; moreover, its rotation generates a shape with minimum volume. Therefore, as mentioned before, the following conditions hold for this problem:

$$\begin{aligned} \int _0^L\left( \frac{\Gamma (x)}{2}-{\bar{y}}\right) {\Gamma (x)}\textrm{d}x=0, \quad \int _0^L(x- {\bar{x}})\Gamma (x)\textrm{d}x=0. \end{aligned}$$

The objective function is \(\int _0^L \pi \Gamma ^2(x)\textrm{d}x\), to solve the problem, we consider \(U=[-0.35,0.85].\) Choosing \(M_1=2\) dense functions of the first kind in the form of \(\phi _1(x, \Gamma )= x\Gamma ^{2},\ \ \phi _2(x, \Gamma )= x\Gamma .\) \(M_2=12\) functions of the kind (3.5) and \(M_3=12\) constraints from the functions of the third kind, gives us the linear optimization problem (4.12) with 28 constraints and 12,000 variables.

$$\begin{aligned} \begin{array}{lll} \min : &{} \sum _{j=1}^{12{,}000} \alpha _j f(z_j)\\ {\text {S. to}}: &{}\sum _{j=1}^{12{,}000} \alpha _j(2x_{j}\Gamma _{j}\vartheta _{j}+\Gamma ^{2}_{j})=12,\\ &{} \sum _{j=1}^{12{,}000} \alpha _j(x_{j}\vartheta _{j}+\Gamma _{j})=6 ,\\ &{} \sum _{j=1}^{12{,}000} \alpha _j \Big [\Gamma _{j}\Big (\frac{2\pi l}{3}\Big )\cos \Big (\frac{2\pi x l}{3}\Big )+ \vartheta _{j} \sin \Big (\frac{2\pi x l}{3}\Big )\Big ]=0,\quad \ l=1,2,\ldots ,6,\\ &{} \sum _{j=1}^{12{,}000} \alpha _j \Big [\Gamma _{j}\Big (\frac{2\pi l'}{3}\Big )\sin \Big (\frac{2\pi x l'}{3}\Big )+ \vartheta _{j} (1-\cos \Big (\frac{2\pi x l'}{3}\Big ))\Big ]=0,\quad l'=1,2,\ldots ,6,\\ &{} \alpha _1+\cdots +\alpha _{1200}=\frac{1}{4},\\ &{} \alpha _{1201}+\cdots +\alpha _{2400}=\frac{1}{4},\\ &{} \alpha _{2401}+\cdots +\alpha _{3600}=\frac{1}{4},\\ &{} \alpha _{3601}+\cdots +\alpha _{4800}=\frac{1}{4},\\ &{} \alpha _{4801}+\cdots +\alpha _{6000}=\frac{1}{4},\\ &{} \alpha _{6001}+\cdots +\alpha _{7200}=\frac{1}{4},\\ &{} \alpha _{7201}+\cdots +\alpha _{8400}=\frac{1}{4},\\ &{} \alpha _{8401}+\cdots +\alpha _{9600}=\frac{1}{4},\\ &{} \alpha _{9601}+\cdots +\alpha _{10{,}800}=\frac{1}{4},\\ &{} \alpha _{10{,}801}+\cdots +\alpha _{12{,}000}=\frac{1}{4},\\ &{} \sum _{j=1}^{12{,}000} \alpha _j[\Gamma _j (\frac{\Gamma _j}{2}-{\bar{y}})]=0,\\ &{} \sum _{j=1}^{12{,}000} \alpha _j [\Gamma _j(x - {\bar{x}})]=0,\\ &{}\alpha _j\ge 0 , \quad j=1,2,\ldots ,12{,}000. \end{array} \end{aligned}$$

To check the accuracy of the results, the center of mass of the area under the fitted curve was calculated as (1.6917311, 0.83297) Moreover, using the least squares approximation, a second-order curve was fitted to the points obtained, for which the point (1.6852, 0.82262) was obtained as the center of mass. These points seem reasonably acceptable compared to the point (1.8, 0.8) The optimal control diagram, the optimal path diagram, and the final three-dimensional shape are represented, respectively, in Figs. ,  and .

Fig. 7
figure 7

The nearly optimal control for Example 2

Fig. 8
figure 8

The curve generator by spline function for Example 2

Fig. 9
figure 9

The nearly optimal shape for Example 2

Example 3

(Catenoid problem, extracted from Smith (1974) page 123) The aim is to find an optimal curve passing through the points (0, 1) and (3, 2), with the center of mass at point (1.9, 0, 0), such that the generated rotated shape has the minimum surface area. Thus, the performance criterion is the minimization of \(\int _0^32\pi \Gamma (x)\sqrt{1+\vartheta ^2(x)} \textrm{d}x\) with the additional condition \(\int _0^3\frac{\Gamma ^2(x)}{2}(x-1.9)\textrm{d}x=0\). The problem was solved by selecting \(U=[-1.047,2.052]\) and with 27 constraints. The optimal value was found to be 25.44468 and the resulted optimal control, optimal generator and optimal shape were plotted in Figs. , and , respectively. In this example, as in Example 1, we assumed that the initial curve is \(y=\frac{1}{3}x+1\). Also, \(\frac{\partial J_{\varepsilon }}{\partial \varphi _{i}}=\sum _{i=1}^{n}(\pi \varphi _{i})(x_{i}-1.9)^{2}\sqrt{\triangle x_{i}^{2}+\triangle \varphi _{i}^{2}}.\)

In Fig. , the curve obtained by the level set method is presented using black and the curve obtained with the method presented in this paper is displayed using red.

The objective function obtained by the level set method is 27.3998. In this example, the method based on measures yields a smaller value of the objective function than what we found. Moreover, our method provides a better curve compared to the level set method. Also, a comparison of the results of the analytical solution from Smith (1974) indicates the advantages of this new method.

Fig. 10
figure 10

The nearly optimal control for Example 3

Fig. 11
figure 11

The generator curve obtained by a spline function for Example 3

Fig. 12
figure 12

The nearly optimal shape for example (3)

Fig. 13
figure 13

The generator curve obtained using new method (red) and level set (black) in Example 3

8 Conclusion

Based on the properties of measures, a method was established for designing optimal rotated shapes. First, the problem was posed into an optimal control frame in a variational representation. Then, the global optimal shape was constructed by the following algorithm: transferring the problem into a measure space, extending the underlying space, two approximation steps, obtaining the optimal generator curve and the optimal rotated shape from the solution of an appropriate finite linear programming problem.

The method has several advantages such as the automatic existence theorem, globality, linearity of the solution method even for extremely nonlinear problems, easily imposing the desired physical properties of the optimal shape and also generality of and simplicity in application to different systems and for different purposes. In addition, this method is independent of the initial shape; thus, this method is a very convenient tool for engineers to design a rotated shape. In comparison with the level set method, it has better a result and a smaller value of the objective function.