{'fraction_non_alphanumeric': 0.0249798549556809, 'fraction_numerical': 0.009669621273166801, 'mean_word_length': 4.396521739130435, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Numerical Algorithm Development for Optimizing the Engine Stroke of Linear Generators

This paper presents the results of a numerical algorithm development to optimize the engine strokes in a linear engine incorporating combustion and kickback. Due to the free piston reciprocal movement occurring in linear engines, the stroke of linear engines cannot be determined by using of fixed position. The reciprocating motion is namely the result of pressure acting on the piston and kickback. Kickback bore size is the main parameter that can influence the velocity of the motion. A numerical algorithm of a variational principle has been developed to optimize the kickback bore size. The resulting function of velocity is important to control the compression ratio and improve of engine thermal efficiency.


Introduction
Linear internal combustion engines may find application in the generation of electrical power without the need linear to rotary motion. The elimination of the connecting rod and crankshaft can improve the efficiency of the engine significantly and reduced weight and cost are added advantages. The operation of this engine is distinct from that of a conventional slider-crank mechanism engine, insofar as the motion of the two horizontally opposed pistons is not externally constrained [1]. This technology is advantageous because it is mechanically simpler and allows for a great deal more freedom in defining a piston motion profile, enabling the use of novel combustion regimes [2].
Many researchers have been designing various linear engines. Most of them have been developing linear engine using combustion at each cylinder end. Sandia National Laboratories has been investigating a new, integrated approach to generating electricity with ultra low emissions and very high efficiency for low power applications such as hybrid vehicles and portable generators. Their approach utilizes a free piston in a doubleended cylinder. Combustion occurs alternately at each cylinder end, with intake/exhaust processes accomplished through a two-stroke cycle [3].
The mean piston speed is and indicator of how well an engine handles load such as friction, inertia, and gas flow resistance. The mean piston speed is essentially a physical limitation and the operating speed depends upon the stroke. In a free piston configuration, the relationship between engine speed, operating conditions, and design parameters is much more complicated [4].
In the case that the combustion occurs only in one side of the linear engine, the problem is to manage the velocity of piston such that the maximum displacement does not exceed the maximum position. This paper is to present the results of numerical experiments using variational principle to get the optimal velocity and maximum position of piston.

Problem design
Consider a two stroke linear engine model as depicted in Fig. 1. To derive the governing equation, a priori, the following independent variables are specified. The left and right cylinder bore are b l and b r respectively. The maximum theoretical half-stroke length is xm. The piston on a left to right stroke traverses from -x s to +x s . The friction force required to move the slider is F f . The quantity of heat added to one cylinder during a cycle is Qin.

Fig. 1. Simplified View of the Linear Engine
Now let us consider a force balance for a left-to-right stroke, with x positive in the left-toright direction. The force balance can be written as where P l and P r are the instantaneous pressure in the left and right cylinder, respectively. By using an assumption of adiabatic compression and expansion behavior, the equation (Eq. 1) can be derived to get the following equation (Eq. 2).
x P where Q in is a quantity of heat added during one cycle. This is a second order ordinary differential equation.
In case that the kickback bore will be determined, assume that the bore of kickback is scaled by the bore of the combustion cylinder. By letting b r = λb l , the Eq. 2 can be written as follows The problem now is to solve the Eq. 3 in (0,T], with the initial conditions , and x max = x s . It is assumed that the bore scale λ as a parameter and satisfies the condition λ max ≥ λ ≥ λ min > 0 (4) where λ max and λ min are given positive constants.
For each value of λ in Eq. 4, we can obtain the numerical solution of the Eq. 3 using numerical integration. But, in this problem, the value of λ is unknown. Therefore variational methods are suitable to control the values of λ.

Variational method and numerical algorithm
The unknown parameter λ is determine by minimizing the functional J defined by ( where p j is a search direction and s j is a search step. According to the definition (Eq. 5), it is possible that among the iteration, λ j either less or more than the appropriate λ. The search direction p j is obtained by Therefore, by using the Eqs. 7 and 8, the sequence of the values of λ j+1 will tend to a limit.

Results and Discussion
In this section, a numerical experiment about our algorithm has been done using the following values of parameters: P1 l = 225000 Pa, P1 r = 120000 Pa, Q in = 18 Joule, x s = 0.0225 m, b l = 0.05 m, F f = 0, n = 1.33. The maximum of positions for each value of λ have been computed using numerical integration of the Eq. 3. By using the procedure above the initial bore scales of 1 and 2 have been chosen by assuming that the kickback bore must be larger than the combustion one. The iteration results are figured in Figs. 2 (a) and (b), respectively. The bore scale tends to 1.461, as the max x tends to x s . It means that the optimal piston velocity is achieved as we used a cylinder on the kickback side with bore size of 0.073 m. The function of optimal velocity and position are shown in Fig. 3.

Concluding Remarks
A numerical algorithm for the problem of bore scale identification of the cycle of linear two-stroke internal combustion engine has been presented. The direct variational method has been used to identify the unknown bore scale function. The numerical algorithm is based on minimizing the functional. The method used here converged fast after its values in one step across the required maximum displacement.