Solving equations using the Lagrange method. Conditional optimization

First, let's consider the case of a function of two variables. The conditional extremum of a function $z=f(x,y)$ at the point $M_0(x_0;y_0)$ is the extremum of this function, achieved under the condition that the variables $x$ and $y$ in the vicinity of this point satisfy the connection equation $\ varphi (x,y)=0$.

The name “conditional” extremum is due to the fact that an additional condition $\varphi(x,y)=0$ is imposed on the variables. If one variable can be expressed from the connection equation through another, then the problem of determining the conditional extremum is reduced to the problem of determining the usual extremum of a function of one variable. For example, if the connection equation implies $y=\psi(x)$, then substituting $y=\psi(x)$ into $z=f(x,y)$, we obtain a function of one variable $z=f\left (x,\psi(x)\right)$. In the general case, however, this method is of little use, so the introduction of a new algorithm is required.

Lagrange multiplier method for functions of two variables.

The Lagrange multiplier method consists of constructing a Lagrange function to find a conditional extremum: $F(x,y)=f(x,y)+\lambda\varphi(x,y)$ (the $\lambda$ parameter is called the Lagrange multiplier ). The necessary conditions for the extremum are specified by a system of equations from which the stationary points are determined:

$$ \left \( \begin(aligned) & \frac(\partial F)(\partial x)=0;\\ & \frac(\partial F)(\partial y)=0;\\ & \varphi (x,y)=0. \end(aligned) \right.

A sufficient condition from which one can determine the nature of the extremum is the sign $d^2 F=F_(xx)^("")dx^2+2F_(xy)^("")dxdy+F_(yy)^("" )dy^2$. If at a stationary point $d^2F > 0$, then the function $z=f(x,y)$ has a conditional minimum at this point, but if $d^2F< 0$, то условный максимум.

There is another way to determine the nature of the extremum. From the coupling equation we obtain: $\varphi_(x)^(")dx+\varphi_(y)^(")dy=0$, $dy=-\frac(\varphi_(x)^("))(\varphi_ (y)^("))dx$, therefore at any stationary point we have:

$$d^2 F=F_(xx)^("")dx^2+2F_(xy)^("")dxdy+F_(yy)^("")dy^2=F_(xx)^( "")dx^2+2F_(xy)^("")dx\left(-\frac(\varphi_(x)^("))(\varphi_(y)^("))dx\right)+ F_(yy)^("")\left(-\frac(\varphi_(x)^("))(\varphi_(y)^("))dx\right)^2=\\ =-\frac (dx^2)(\left(\varphi_(y)^(") \right)^2)\cdot\left(-(\varphi_(y)^("))^2 F_(xx)^(" ")+2\varphi_(x)^(")\varphi_(y)^(")F_(xy)^("")-(\varphi_(x)^("))^2 F_(yy)^ ("") \right)$$

The second factor (located in brackets) can be represented in this form:

The elements of the determinant $\left| are highlighted in red. \begin(array) (cc) F_(xx)^("") & F_(xy)^("") \\ F_(xy)^("") & F_(yy)^("") \end (array)\right|$, which is the Hessian of the Lagrange function. If $H > 0$, then $d^2F< 0$, что указывает на условный максимум. Аналогично, при $H < 0$ имеем $d^2F >0$, i.e. we have a conditional minimum of the function $z=f(x,y)$.

A note regarding the notation of the determinant $H$. show\hide

$$ H=-\left|\begin(array) (ccc) 0 & \varphi_(x)^(") & \varphi_(y)^(")\\ \varphi_(x)^(") & F_ (xx)^("") & F_(xy)^("") \\ \varphi_(y)^(") & F_(xy)^("") & F_(yy)^("") \ end(array) \right| $$

In this situation, the rule formulated above will change as follows: if $H > 0$, then the function has a conditional minimum, and if $H< 0$ получим условный максимум функции $z=f(x,y)$. При решении задач следует учитывать такие нюансы.

Algorithm for studying a function of two variables for a conditional extremum

  1. Compose the Lagrange function $F(x,y)=f(x,y)+\lambda\varphi(x,y)$
  2. Solve the system $ \left \( \begin(aligned) & \frac(\partial F)(\partial x)=0;\\ & \frac(\partial F)(\partial y)=0;\\ & \ varphi (x,y)=0. \end(aligned) \right.$
  3. Determine the nature of the extremum at each of the stationary points found in the previous paragraph. To do this, use any of the following methods:
    • Compose the determinant of $H$ and find out its sign
    • Taking into account the coupling equation, calculate the sign of $d^2F$

Lagrange multiplier method for functions of n variables

Let's say we have a function of $n$ variables $z=f(x_1,x_2,\ldots,x_n)$ and $m$ coupling equations ($n > m$):

$$\varphi_1(x_1,x_2,\ldots,x_n)=0; \; \varphi_2(x_1,x_2,\ldots,x_n)=0,\ldots,\varphi_m(x_1,x_2,\ldots,x_n)=0.$$

Denoting the Lagrange multipliers as $\lambda_1,\lambda_2,\ldots,\lambda_m$, we compose the Lagrange function:

$$F(x_1,x_2,\ldots,x_n,\lambda_1,\lambda_2,\ldots,\lambda_m)=f+\lambda_1\varphi_1+\lambda_2\varphi_2+\ldots+\lambda_m\varphi_m$$

The necessary conditions for the presence of a conditional extremum are given by a system of equations from which the coordinates of stationary points and the values ​​of the Lagrange multipliers are found:

$$\left\(\begin(aligned) & \frac(\partial F)(\partial x_i)=0; (i=\overline(1,n))\\ & \varphi_j=0; (j=\ overline(1,m)) \end(aligned) \right.$$

You can find out whether a function has a conditional minimum or a conditional maximum at the found point, as before, using the sign $d^2F$. If at the found point $d^2F > 0$, then the function has a conditional minimum, but if $d^2F< 0$, - то условный максимум. Можно пойти иным путем, рассмотрев следующую матрицу:

Determinant of the matrix $\left| \begin(array) (ccccc) \frac(\partial^2F)(\partial x_(1)^(2)) & \frac(\partial^2F)(\partial x_(1)\partial x_(2) ) & \frac(\partial^2F)(\partial x_(1)\partial x_(3)) &\ldots & \frac(\partial^2F)(\partial x_(1)\partial x_(n)) \\ \frac(\partial^2F)(\partial x_(2)\partial x_1) & \frac(\partial^2F)(\partial x_(2)^(2)) & \frac(\partial^2F )(\partial x_(2)\partial x_(3)) &\ldots & \frac(\partial^2F)(\partial x_(2)\partial x_(n))\\ \frac(\partial^2F )(\partial x_(3) \partial x_(1)) & \frac(\partial^2F)(\partial x_(3)\partial x_(2)) & \frac(\partial^2F)(\partial x_(3)^(2)) &\ldots & \frac(\partial^2F)(\partial x_(3)\partial x_(n))\\ \ldots & \ldots & \ldots &\ldots & \ ldots\\ \frac(\partial^2F)(\partial x_(n)\partial x_(1)) & \frac(\partial^2F)(\partial x_(n)\partial x_(2)) & \ frac(\partial^2F)(\partial x_(n)\partial x_(3)) &\ldots & \frac(\partial^2F)(\partial x_(n)^(2))\\ \end( array) \right|$, highlighted in red in the matrix $L$, is the Hessian of the Lagrange function. We use the following rule:

  • If the signs of the angular minors $H_(2m+1),\; H_(2m+2),\ldots,H_(m+n)$ matrices $L$ coincide with the sign of $(-1)^m$, then the stationary point under study is the conditional minimum point of the function $z=f(x_1,x_2 ,x_3,\ldots,x_n)$.
  • If the signs of the angular minors $H_(2m+1),\; H_(2m+2),\ldots,H_(m+n)$ alternate, and the sign of the minor $H_(2m+1)$ coincides with the sign of the number $(-1)^(m+1)$, then the stationary the point is the conditional maximum point of the function $z=f(x_1,x_2,x_3,\ldots,x_n)$.

Example No. 1

Find the conditional extremum of the function $z(x,y)=x+3y$ under the condition $x^2+y^2=10$.

The geometric interpretation of this problem is as follows: it is required to find the largest and smallest values ​​of the applicate of the plane $z=x+3y$ for the points of its intersection with the cylinder $x^2+y^2=10$.

It is somewhat difficult to express one variable through another from the coupling equation and substitute it into the function $z(x,y)=x+3y$, so we will use the Lagrange method.

Denoting $\varphi(x,y)=x^2+y^2-10$, we compose the Lagrange function:

$$ F(x,y)=z(x,y)+\lambda \varphi(x,y)=x+3y+\lambda(x^2+y^2-10);\\ \frac(\partial F)(\partial x)=1+2\lambda x; \frac(\partial F)(\partial y)=3+2\lambda y. $$

Let us write a system of equations to determine the stationary points of the Lagrange function:

$$ \left \( \begin(aligned) & 1+2\lambda x=0;\\ & 3+2\lambda y=0;\\ & x^2+y^2-10=0. \end (aligned)\right.$$

If we assume $\lambda=0$, then the first equation becomes: $1=0$. The resulting contradiction indicates that $\lambda\neq 0$. Under the condition $\lambda\neq 0$, from the first and second equations we have: $x=-\frac(1)(2\lambda)$, $y=-\frac(3)(2\lambda)$. Substituting the obtained values ​​into the third equation, we get:

$$ \left(-\frac(1)(2\lambda) \right)^2+\left(-\frac(3)(2\lambda) \right)^2-10=0;\\ \frac (1)(4\lambda^2)+\frac(9)(4\lambda^2)=10; \lambda^2=\frac(1)(4); \left[ \begin(aligned) & \lambda_1=-\frac(1)(2);\\ & \lambda_2=\frac(1)(2). \end(aligned) \right.\\ \begin(aligned) & \lambda_1=-\frac(1)(2); \; x_1=-\frac(1)(2\lambda_1)=1; \; y_1=-\frac(3)(2\lambda_1)=3;\\ & \lambda_2=\frac(1)(2); \; x_2=-\frac(1)(2\lambda_2)=-1; \; y_2=-\frac(3)(2\lambda_2)=-3.\end(aligned) $$

So, the system has two solutions: $x_1=1;\; y_1=3;\; \lambda_1=-\frac(1)(2)$ and $x_2=-1;\; y_2=-3;\; \lambda_2=\frac(1)(2)$. Let us find out the nature of the extremum at each stationary point: $M_1(1;3)$ and $M_2(-1;-3)$. To do this, we calculate the determinant of $H$ at each point.

$$ \varphi_(x)^(")=2x;\; \varphi_(y)^(")=2y;\; F_(xx)^("")=2\lambda;\; F_(xy)^("")=0;\; F_(yy)^("")=2\lambda.\\ H=\left| \begin(array) (ccc) 0 & \varphi_(x)^(") & \varphi_(y)^(")\\ \varphi_(x)^(") & F_(xx)^("") & F_(xy)^("") \\ \varphi_(y)^(") & F_(xy)^("") & F_(yy)^("") \end(array) \right|= \left| \begin(array) (ccc) 0 & 2x & 2y\\ 2x & 2\lambda & 0 \\ 2y & 0 & 2\lambda \end(array) \right|= 8\cdot\left| \begin(array) (ccc) 0 & x & y\\ x & \lambda & 0 \\ y & 0 & \lambda \end(array) \right| $$

At point $M_1(1;3)$ we get: $H=8\cdot\left| \begin(array) (ccc) 0 & x & y\\ x & \lambda & 0 \\ y & 0 & \lambda \end(array) \right|= 8\cdot\left| \begin(array) (ccc) 0 & 1 & 3\\ 1 & -1/2 & 0 \\ 3 & 0 & -1/2 \end(array) \right|=40 > 0$, so at the point The $M_1(1;3)$ function $z(x,y)=x+3y$ has a conditional maximum, $z_(\max)=z(1;3)=10$.

Similarly, at point $M_2(-1,-3)$ we find: $H=8\cdot\left| \begin(array) (ccc) 0 & x & y\\ x & \lambda & 0 \\ y & 0 & \lambda \end(array) \right|= 8\cdot\left| \begin(array) (ccc) 0 & -1 & -3\\ -1 & 1/2 & 0 \\ -3 & 0 & 1/2 \end(array) \right|=-40$. Since $H< 0$, то в точке $M_2(-1;-3)$ имеем условный минимум функции $z(x,y)=x+3y$, а именно: $z_{\min}=z(-1;-3)=-10$.

I note that instead of calculating the value of the determinant $H$ at each point, it is much more convenient to expand it in general form. In order not to clutter the text with details, I will hide this method under a note.

Writing the determinant $H$ in general form. show\hide

$$ H=8\cdot\left|\begin(array)(ccc)0&x&y\\x&\lambda&0\\y&0&\lambda\end(array)\right| =8\cdot\left(-\lambda(y^2)-\lambda(x^2)\right) =-8\lambda\cdot\left(y^2+x^2\right). $$

In principle, it is already obvious what sign $H$ has. Since none of the points $M_1$ or $M_2$ coincides with the origin, then $y^2+x^2>0$. Therefore, the sign of $H$ is opposite to the sign of $\lambda$. You can complete the calculations:

$$ \begin(aligned) &H(M_1)=-8\cdot\left(-\frac(1)(2)\right)\cdot\left(3^2+1^2\right)=40;\ \ &H(M_2)=-8\cdot\frac(1)(2)\cdot\left((-3)^2+(-1)^2\right)=-40. \end(aligned) $$

The question about the nature of the extremum at the stationary points $M_1(1;3)$ and $M_2(-1;-3)$ can be solved without using the determinant $H$. Let's find the sign of $d^2F$ at each stationary point:

$$ d^2 F=F_(xx)^("")dx^2+2F_(xy)^("")dxdy+F_(yy)^("")dy^2=2\lambda \left( dx^2+dy^2\right) $$

Let me note that the notation $dx^2$ means exactly $dx$ raised to the second power, i.e. $\left(dx \right)^2$. Hence we have: $dx^2+dy^2>0$, therefore, with $\lambda_1=-\frac(1)(2)$ we get $d^2F< 0$. Следовательно, функция имеет в точке $M_1(1;3)$ условный максимум. Аналогично, в точке $M_2(-1;-3)$ получим условный минимум функции $z(x,y)=x+3y$. Отметим, что для определения знака $d^2F$ не пришлось учитывать связь между $dx$ и $dy$, ибо знак $d^2F$ очевиден без дополнительных преобразований. В следующем примере для определения знака $d^2F$ уже будет необходимо учесть связь между $dx$ и $dy$.

Answer: at point $(-1;-3)$ the function has a conditional minimum, $z_(\min)=-10$. At point $(1;3)$ the function has a conditional maximum, $z_(\max)=10$

Example No. 2

Find the conditional extremum of the function $z(x,y)=3y^3+4x^2-xy$ under the condition $x+y=0$.

First method (Lagrange multiplier method)

Denoting $\varphi(x,y)=x+y$, we compose the Lagrange function: $F(x,y)=z(x,y)+\lambda \varphi(x,y)=3y^3+4x^2 -xy+\lambda(x+y)$.

$$ \frac(\partial F)(\partial x)=8x-y+\lambda; \; \frac(\partial F)(\partial y)=9y^2-x+\lambda.\\ \left \( \begin(aligned) & 8x-y+\lambda=0;\\ & 9y^2-x+\ lambda=0; \\ & x+y=0. \end(aligned) \right.

Having solved the system, we get: $x_1=0$, $y_1=0$, $\lambda_1=0$ and $x_2=\frac(10)(9)$, $y_2=-\frac(10)(9)$ , $\lambda_2=-10$. We have two stationary points: $M_1(0;0)$ and $M_2 \left(\frac(10)(9);-\frac(10)(9) \right)$. Let us find out the nature of the extremum at each stationary point using the determinant $H$.

$$H=\left| \begin(array) (ccc) 0 & \varphi_(x)^(") & \varphi_(y)^(")\\ \varphi_(x)^(") & F_(xx)^("") & F_(xy)^("") \\ \varphi_(y)^(") & F_(xy)^("") & F_(yy)^("") \end(array) \right|= \left| \begin(array) (ccc) 0 & 1 & 1\\ 1 & 8 & -1 \\ 1 & -1 & 18y \end(array) \right|=-10-18y $$

At point $M_1(0;0)$ $H=-10-18\cdot 0=-10< 0$, поэтому $M_1(0;0)$ есть точка условного минимума функции $z(x,y)=3y^3+4x^2-xy$, $z_{\min}=0$. В точке $M_2\left(\frac{10}{9};-\frac{10}{9}\right)$ $H=10 >0$, therefore at this point the function has a conditional maximum, $z_(\max)=\frac(500)(243)$.

We investigate the nature of the extremum at each point using a different method, based on the sign of $d^2F$:

$$ d^2 F=F_(xx)^("")dx^2+2F_(xy)^("")dxdy+F_(yy)^("")dy^2=8dx^2-2dxdy+ 18ydy^2 $$

From the connection equation $x+y=0$ we have: $d(x+y)=0$, $dx+dy=0$, $dy=-dx$.

$$ d^2 F=8dx^2-2dxdy+18ydy^2=8dx^2-2dx(-dx)+18y(-dx)^2=(10+18y)dx^2 $$

Since $ d^2F \Bigr|_(M_1)=10 dx^2 > 0$, then $M_1(0;0)$ is the conditional minimum point of the function $z(x,y)=3y^3+4x^ 2-xy$. Similarly, $d^2F \Bigr|_(M_2)=-10 dx^2< 0$, т.е. $M_2\left(\frac{10}{9}; -\frac{10}{9} \right)$ - точка условного максимума.

Second way

From the connection equation $x+y=0$ we get: $y=-x$. Substituting $y=-x$ into the function $z(x,y)=3y^3+4x^2-xy$, we obtain some function of the variable $x$. Let's denote this function as $u(x)$:

$$ u(x)=z(x,-x)=3\cdot(-x)^3+4x^2-x\cdot(-x)=-3x^3+5x^2. $$

Thus, we reduced the problem of finding the conditional extremum of a function of two variables to the problem of determining the extremum of a function of one variable.

$$ u_(x)^(")=-9x^2+10x;\\ -9x^2+10x=0; \; x\cdot(-9x+10)=0;\\ x_1=0; \ ; y_1=-x_1=0;\\ x_2=\frac(10)(9); \; y_2=-x_2=-\frac(10)(9).

We obtained points $M_1(0;0)$ and $M_2\left(\frac(10)(9); -\frac(10)(9)\right)$. Further research is known from the course of differential calculus of functions of one variable. By examining the sign of $u_(xx)^("")$ at each stationary point or checking the change in the sign of $u_(x)^(")$ at the found points, we obtain the same conclusions as when solving the first method. For example, we will check sign $u_(xx)^("")$:

$$u_(xx)^("")=-18x+10;\\ u_(xx)^("")(M_1)=10;\;u_(xx)^("")(M_2)=- 10.$$

Since $u_(xx)^("")(M_1)>0$, then $M_1$ is the minimum point of the function $u(x)$, and $u_(\min)=u(0)=0$ . Since $u_(xx)^("")(M_2)<0$, то $M_2$ - точка максимума функции $u(x)$, причём $u_{\max}=u\left(\frac{10}{9}\right)=\frac{500}{243}$.

The values ​​of the function $u(x)$ for a given connection condition coincide with the values ​​of the function $z(x,y)$, i.e. the found extrema of the function $u(x)$ are the sought conditional extrema of the function $z(x,y)$.

Answer: at the point $(0;0)$ the function has a conditional minimum, $z_(\min)=0$. At the point $\left(\frac(10)(9); -\frac(10)(9) \right)$ the function has a conditional maximum, $z_(\max)=\frac(500)(243)$.

Let's consider another example in which we will clarify the nature of the extremum by determining the sign of $d^2F$.

Example No. 3

Find the largest and smallest values ​​of the function $z=5xy-4$ if the variables $x$ and $y$ are positive and satisfy the coupling equation $\frac(x^2)(8)+\frac(y^2)(2) -1=0$.

Let's compose the Lagrange function: $F=5xy-4+\lambda \left(\frac(x^2)(8)+\frac(y^2)(2)-1 \right)$. Let's find the stationary points of the Lagrange function:

$$ F_(x)^(")=5y+\frac(\lambda x)(4); \; F_(y)^(")=5x+\lambda y.\\ \left \( \begin(aligned) & 5y+\frac(\lambda x)(4)=0;\\ & 5x+\lambda y=0;\\ & \frac(x^2)(8)+\frac(y^2)(2)- 1=0;\\ & x > 0; \; y > 0. \end(aligned) \right.

All further transformations are carried out taking into account $x > 0; \; y > 0$ (this is specified in the problem statement). From the second equation we express $\lambda=-\frac(5x)(y)$ and substitute the found value into the first equation: $5y-\frac(5x)(y)\cdot \frac(x)(4)=0$ , $4y^2-x^2=0$, $x=2y$. Substituting $x=2y$ into the third equation, we get: $\frac(4y^2)(8)+\frac(y^2)(2)-1=0$, $y^2=1$, $y =1$.

Since $y=1$, then $x=2$, $\lambda=-10$. We determine the nature of the extremum at point $(2;1)$ based on the sign of $d^2F$.

$$ F_(xx)^("")=\frac(\lambda)(4); \; F_(xy)^("")=5; \; F_(yy)^("")=\lambda. $$

Since $\frac(x^2)(8)+\frac(y^2)(2)-1=0$, then:

$$ d\left(\frac(x^2)(8)+\frac(y^2)(2)-1\right)=0; \; d\left(\frac(x^2)(8) \right)+d\left(\frac(y^2)(2) \right)=0; \; \frac(x)(4)dx+ydy=0; \; dy=-\frac(xdx)(4y). $$

In principle, here you can immediately substitute the coordinates of the stationary point $x=2$, $y=1$ and the parameter $\lambda=-10$, obtaining:

$$ F_(xx)^("")=\frac(-5)(2); \; F_(xy)^("")=-10; \; dy=-\frac(dx)(2).\\ d^2 F=F_(xx)^("")dx^2+2F_(xy)^("")dxdy+F_(yy)^(" ")dy^2=-\frac(5)(2)dx^2+10dx\cdot \left(-\frac(dx)(2) \right)-10\cdot \left(-\frac(dx) (2) \right)^2=\\ =-\frac(5)(2)dx^2-5dx^2-\frac(5)(2)dx^2=-10dx^2. $$

However, in other problems on a conditional extremum there may be several stationary points. In such cases, it is better to represent $d^2F$ in general form, and then substitute the coordinates of each of the found stationary points into the resulting expression:

$$ d^2 F=F_(xx)^("")dx^2+2F_(xy)^("")dxdy+F_(yy)^("")dy^2=\frac(\lambda) (4)dx^2+10\cdot dx\cdot \frac(-xdx)(4y) +\lambda\cdot \left(-\frac(xdx)(4y) \right)^2=\\ =\frac (\lambda)(4)dx^2-\frac(5x)(2y)dx^2+\lambda \cdot \frac(x^2dx^2)(16y^2)=\left(\frac(\lambda )(4)-\frac(5x)(2y)+\frac(\lambda \cdot x^2)(16y^2) \right)\cdot dx^2 $$

Substituting $x=2$, $y=1$, $\lambda=-10$, we get:

$$ d^2 F=\left(\frac(-10)(4)-\frac(10)(2)-\frac(10 \cdot 4)(16) \right)\cdot dx^2=- 10dx^2. $$

Since $d^2F=-10\cdot dx^2< 0$, то точка $(2;1)$ есть точкой условного максимума функции $z=5xy-4$, причём $z_{\max}=10-4=6$.

Answer: at point $(2;1)$ the function has a conditional maximum, $z_(\max)=6$.

In the next part we will consider the application of the Lagrange method for functions of a larger number of variables.

Classification of mathematical programming problems

PROGRAMMING

METHODS FOR SOLVING NONLINEAR PROBLEMS

Test questions for section 4

Scheme for solving the transport problem

Let us list the main stages of solving the transport problem.

1. Check the closed condition. If the task is open, the transport table is supplemented with either a column of a fictitious point of consumption or a row of a fictitious supplier.

2. Build a reference plan.

3. Check the support plan for non-degeneracy. If there is not enough occupied cell to satisfy the non-degeneracy condition, one of the cells of the transport table is filled with a supply equal to zero. If necessary, it is permissible to record zero deliveries in several cells.

4. The plan is checked for optimality.

5. If the optimality conditions are not met, move on to the next plan by redistributing supplies. The computational process is repeated until the optimal plan is obtained.

1. What is the meaning of the objective function in the mathematical model of the transport problem?

2.What is the meaning of restrictions in the mathematical model of the transport problem?

3. Is it possible to apply the potential method to solve an open (unclosed) transport problem?

4.What changes need to be made to the original transport table so that the problem can be solved by the potential method?

5.What is the essence of the minimum element method? What stage of solving the transport problem will be completed as a result of applying this method?

6. How do you know if the transportation plan is optimal?

7. In what case and how is it necessary to redistribute supplies in terms of transportation?

8. Suppose the constructed transportation plan is degenerate. Is it possible to continue solving the problem using the potential method and what needs to be done for this?

The general mathematical programming problem was formulated in Section 1.1. Depending on the type of functions included in the model (1.1)-(1.3), the problem is classified as one or another type of mathematical programming. There are linear programming (all functions are linear), integer (the solution is represented by integers), quadratic (the objective function is a quadratic form), nonlinear (at least one of the functions of the problem is nonlinear) and stochastic programming (parameters that are probabilistic in nature are included).

The class of nonlinear programming problems is wider than the class of linear models. For example, production costs in most cases are not proportional to the volume of output, but depend on it nonlinearly, income from the sale of production products turns out to be a nonlinear function of prices, etc. The criteria in optimal planning problems are often maximum profit, minimum cost, and minimum capital costs. The variable quantities are the output volumes of various types of products. The restrictions include production functions that characterize the relationship between product output and the costs of labor and material resources, the volume of which is limited.



Unlike linear programming, which uses a universal solution method (the simplex method), for solving nonlinear problems there is a whole range of methods depending on the form of the functions included in the model. Of the variety of methods, we will consider only two: the Lagrange method and the dynamic programming method.

WITH The essence of the Lagrange method is to reduce the conditional extremum problem to solving the unconditional extremum problem. Consider the nonlinear programming model:

(5.2)

Where – known functions,

A – given coefficients.

Note that in this formulation of the problem, the constraints are specified by equalities, and there is no condition for the variables to be non-negative. In addition, we believe that the functions are continuous with their first partial derivatives.

Let us transform conditions (5.2) so that on the left or right sides of the equalities there is zero:

(5.3)

Let's compose the Lagrange function. It includes the objective function (5.1) and the right-hand sides of the constraints (5.3), taken respectively with the coefficients . There will be as many Lagrange coefficients as there are constraints in the problem.

The extremum points of function (5.4) are the extremum points of the original problem and vice versa: the optimal plan of problem (5.1)-(5.2) is the global extremum point of the Lagrange function.

Indeed, let a solution be found problems (5.1)-(5.2), then conditions (5.3) are satisfied. Let's substitute the plan into function (5.4) and verify the validity of equality (5.5).

Thus, in order to find the optimal plan for the original problem, it is necessary to examine the Lagrange function for the extremum. The function has extreme values ​​at points where its partial derivatives are equal zero. Such points are called stationary.

Let us define the partial derivatives of the function (5.4)

,

.

After equalization zero derivatives we get the system m+n equations with m+n unknown

, (5.6)

In the general case, system (5.6)-(5.7) will have several solutions, which will include all the maxima and minima of the Lagrange function. In order to highlight the global maximum or minimum, the values ​​of the objective function are calculated at all found points. The largest of these values ​​will be the global maximum, and the smallest will be the global minimum. In some cases it is possible to use sufficient conditions for a strict extremum continuous functions (see Problem 5.2 below):

let the function be continuous and twice differentiable in some neighborhood of its stationary point (i.e. )). Then:

A) If ,(5.8)

then is the point of strict maximum of the function;

b) If ,(5.9)

then is the strict minimum point of the function;

G ) If ,

then the question of the presence of an extremum remains open.

In addition, some solutions of system (5.6)-(5.7) may be negative. Which is inconsistent with the economic meaning of the variables. In this case, you should consider replacing negative values ​​with zero values.

Economic meaning of Lagrange multipliers. Optimal multiplier value shows how much the criterion value will change Z when the resource increases or decreases j by one unit, since

The Lagrange method can also be used in the case where the constraints are inequalities. Thus, finding the extremum of the function under conditions

,

performed in several stages:

1. Determine stationary points of the objective function, for which they solve a system of equations

.

2. From the stationary points, select those whose coordinates satisfy the conditions

3. Using the Lagrange method, solve the problem with equality constraints (5.1)-(5.2).

4. The points found in the second and third stages are examined for the global maximum: the values ​​of the objective function at these points are compared - the largest value corresponds to the optimal plan.

Problem 5.1 Let us solve problem 1.3, considered in the first section, using the Lagrange method. The optimal distribution of water resources is described by a mathematical model

.

Let's compose the Lagrange function

Let's find the unconditional maximum of this function. To do this, we calculate the partial derivatives and equate them to zero

,

Thus, we obtained a system of linear equations of the form

The solution to the system of equations represents an optimal plan for the distribution of water resources across irrigated areas

Values ​​are measured in hundreds of thousands of cubic meters. - the amount of net income per one hundred thousand cubic meters of irrigation water. Therefore, the marginal price of 1 m 3 of irrigation water is equal to den. units

The maximum additional net income from irrigation will be

160·12.26 2 +7600·12.26-130·8.55 2 +5900·8.55-10·16.19 2 +4000·16.19=

172391.02 (den. units)

Problem 5.2 Solve a nonlinear programming problem

Let's represent the limitation as:

.

Let's compose the Lagrange function and determine its partial derivatives

.

To determine the stationary points of the Lagrange function, its partial derivatives should be set equal to zero. As a result, we obtain a system of equations

Multiplier methodLagrange(in English literature “LaGrange's method of undetermined multipliers”) ˗ is a numerical method for solving optimization problems that allows you to determine the “conditional” extremum of the objective function (minimum or maximum value)

in the presence of specified restrictions on its variables in the form of equalities (i.e., the range of permissible values ​​is defined)

˗ these are the values ​​of the function argument (controllable parameters) on the real domain at which the function value tends to an extremum. The use of the name “conditional” extremum is due to the fact that an additional condition is imposed on the variables, which limits the range of permissible values ​​when searching for the extremum of the function.

The Lagrange multiplier method allows the problem of searching for a conditional extremum of an objective function on a set of admissible values ​​to be transformed into the problem of unconditional optimization of a function.

In case the functions And are continuous along with their partial derivatives, then there are such variables λ that are not simultaneously equal to zero, under which the following condition is satisfied:

Thus, in accordance with the Lagrange multiplier method, to find the extremum of the objective function on the set of admissible values, I compose the Lagrange function L(x, λ), which is further optimized:

where λ ˗ is a vector of additional variables called undetermined Lagrange multipliers.

Thus, the problem of finding the conditional extremum of the function f(x) has been reduced to the problem of finding the unconditional extremum of the function L(x, λ).

And

The necessary condition for the extremum of the Lagrange function is given by a system of equations (the system consists of “n + m” equations):

Solving this system of equations allows us to determine the arguments of the function (X) at which the value of the function L(x, λ), as well as the value of the target function f(x) correspond to the extremum.

The magnitude of the Lagrange multipliers (λ) is of practical interest if the constraints are presented in the form with a free term in the equation (constant). In this case, we can consider a further (increase/decrease) value of the objective function by changing the value of the constant in the equation system. Thus, the Lagrange multiplier characterizes the rate of change in the maximum of the objective function when the limiting constant changes.

There are several ways to determine the nature of the extremum of the resulting function:

First method: Let be the coordinates of the extremum point, and be the corresponding value of the objective function. A point close to the point is taken and the value of the objective function is calculated:

If , then there is a maximum at the point.

If , then there is a minimum at the point.

Second method: A sufficient condition from which the nature of the extremum can be determined is the sign of the second differential of the Lagrange function. The second differential of the Lagrange function is defined as follows:

If at a given point minimum, if , then the objective function f(x) has a conditional maximum.

Third method: Also, the nature of the extremum of the function can be determined by considering the Hessian of the Lagrange function. The Hessian matrix is ​​a symmetric square matrix of second partial derivatives of a function at the point at which the elements of the matrix are symmetric about the main diagonal.

To determine the type of extremum (maximum or minimum of a function), you can use Sylvester’s rule:

1. In order for the second differential of the Lagrange function to be of positive sign it is necessary that the angular minors of the function be positive. Under such conditions, the function at this point has a minimum.

2. In order for the second differential of the Lagrange function to be negative in sign , it is necessary that the angular minors of the function alternate, and the first element of the matrix must be negativesv. Under such conditions, the function at this point has a maximum.

By angular minor we mean the minor located in the first k rows and k columns of the original matrix.

The main practical significance of the Lagrange method is that it allows you to move from conditional optimization to unconditional optimization and, accordingly, expand the arsenal of available methods for solving the problem. However, the problem of solving the system of equations to which this method reduces is, in the general case, no simpler than the original problem of finding an extremum. Such methods are called indirect. Their use is explained by the need to obtain a solution to an extremal problem in analytical form (for example, for certain theoretical calculations). When solving specific practical problems, direct methods are usually used, based on iterative processes of calculating and comparing the values ​​of the functions being optimized.

Calculation method

1 step: We determine the Lagrange function from the given objective function and system of constraints:

Forward

In order to add your comment to the article, please register on the site.

Lagrange multiplier method.

The Lagrange multiplier method is one of the methods that allows you to solve nonlinear programming problems.

Nonlinear programming is a branch of mathematical programming that studies methods for solving extremal problems with a nonlinear objective function and a region of feasible solutions defined by nonlinear constraints. In economics, this corresponds to the fact that results (efficiency) increase or decrease disproportionately to changes in the scale of resource use (or, what is the same, the scale of production): for example, due to the division of production costs in enterprises into variable and semi-fixed; due to saturation of demand for goods, when each subsequent unit is more difficult to sell than the previous one, etc.

The nonlinear programming problem is posed as the problem of finding the optimum of a certain objective function

F(x 1 ,…x n), F (x) → max

when conditions are met

g j (x 1 ,…x n)≥0, g (x) ≤ b , x ≥ 0

Where x-vector of the required variables;

F (x) -objective function;

g (x) - constraint function (continuously differentiable);

b - vector of constraint constants.

The solution to a nonlinear programming problem (global maximum or minimum) can belong either to the boundary or to the interior of the admissible set.

Unlike a linear programming problem, in a nonlinear programming problem the optimum does not necessarily lie on the boundary of the region defined by the constraints. In other words, the task is to select such non-negative values ​​of variables, subject to a system of restrictions in the form of inequalities, under which the maximum (or minimum) of a given function is achieved. In this case, the forms of neither the objective function nor the inequalities are specified. There may be different cases: the objective function is nonlinear, but the constraints are linear; the objective function is linear, and the constraints (at least one of them) are nonlinear; both the objective function and the constraints are nonlinear.

The nonlinear programming problem is found in the natural sciences, engineering, economics, mathematics, business relations, and government.



Nonlinear programming, for example, is related to a basic economic problem. Thus, in the problem of allocating limited resources, either efficiency or, if the consumer is being studied, consumption is maximized in the presence of restrictions that express the conditions of resource scarcity. In such a general formulation, the mathematical formulation of the problem may be impossible, but in specific applications the quantitative form of all functions can be determined directly. For example, an industrial enterprise produces plastic products. Production efficiency here is measured by profit, and constraints are interpreted as available labor, production space, equipment productivity, etc.

The cost-effectiveness method also fits into the nonlinear programming scheme. This method was developed for use in decision making in government. A common function of efficiency is welfare. Here two nonlinear programming problems arise: the first is maximizing the effect at limited costs, the second is minimizing costs provided that the effect is above a certain minimum level. This problem is usually well modeled using nonlinear programming.

The results of solving a nonlinear programming problem are helpful in making government decisions. The resulting solution is, of course, recommended, so it is necessary to examine the assumptions and accuracy of the nonlinear programming problem before making a final decision.

Nonlinear problems are complex; they are often simplified by leading to linear ones. To do this, it is conventionally assumed that in a particular area the objective function increases or decreases in proportion to the change in the independent variables. This approach is called the method of piecewise linear approximations; however, it is applicable only to certain types of nonlinear problems.

Nonlinear problems under certain conditions are solved using the Lagrange function: by finding its saddle point, the solution to the problem is thereby found. Among computational algorithms for scientific research, gradient methods occupy a large place. There is no universal method for nonlinear problems and, apparently, there may not be, since they are extremely diverse. Multiextremal problems are especially difficult to solve.

One of the methods that allows you to reduce a nonlinear programming problem to solving a system of equations is the Lagrange method of indefinite multipliers.

Using the Lagrange multiplier method, the necessary conditions are essentially established to allow the identification of optimum points in optimization problems with equality constraints. In this case, the constrained problem is transformed into an equivalent unconditional optimization problem, which involves some unknown parameters called Lagrange multipliers.

The Lagrange multiplier method consists in reducing problems on a conditional extremum to problems on the unconditional extremum of an auxiliary function - the so-called. Lagrange functions.

For the problem of the extremum of a function f(x 1, x 2,..., x n) under the conditions (constraint equations) φ i(x 1 , x 2 , ..., x n) = 0, i= 1, 2,..., m, the Lagrange function has the form

L(x 1, x 2… x n,λ 1, λ 2,…λm)=f(x 1, x 2… x n)+∑ i -1 m λ i φ i (x 1, x 2… x n)

Multipliers λ 1 , λ 2 , ..., λm called Lagrange multipliers.

If the values x 1 , x 2 , ..., x n , λ 1 , λ 2 , ..., λm the essence of the solutions to the equations that determine the stationary points of the Lagrange function, namely, for differentiable functions are solutions to the system of equations

then, under fairly general assumptions, x 1 , x 2 , ..., x n provide an extremum of the function f.

Consider the problem of minimizing a function of n variables subject to one constraint in the form of equality:

Minimize f(x 1, x 2… x n) (1)

under restrictions h 1 (x 1, x 2… x n)=0 (2)

According to the Lagrange multiplier method, this problem is transformed into the following unconstrained optimization problem:

minimize L(x,λ)=f(x)-λ*h(x) (3)

where the Function L(x;λ) is called the Lagrange function,

λ is an unknown constant, which is called the Lagrange multiplier. There are no requirements for the sign of λ.

Let, for a given value λ=λ 0, the unconditional minimum of the function L(x,λ) with respect to x be achieved at the point x=x 0 and x 0 satisfy the equation h 1 (x 0)=0. Then, as is easy to see, x 0 minimizes (1) taking into account (2), since for all values ​​of x satisfying (2), h 1 (x)=0 and L(x,λ)=min f(x).

Of course, it is necessary to select the value λ=λ 0 in such a way that the coordinate of the unconditional minimum point x 0 satisfies equality (2). This can be done if, considering λ as a variable, find the unconditional minimum of function (3) in the form of a function λ, and then choose the value of λ at which equality (2) is satisfied. Let's illustrate this with a specific example.

Minimize f(x)=x 1 2 +x 2 2 =0

under the constraint h 1 (x)=2x 1 +x 2 -2=0=0

The corresponding unconstrained optimization problem is written as follows:

minimize L(x,λ)=x 1 2 +x 2 2 -λ(2x 1 +x 2 -2)

Solution. Equating the two components of the gradient L to zero, we obtain

→ x 1 0 =λ

→ x 2 0 =λ/2

In order to check whether the stationary point x° corresponds to the minimum, we calculate the elements of the Hessian matrix of the function L(x;u), considered as a function of x,

which turns out to be positive definite.

This means that L(x,u) is a convex function of x. Consequently, the coordinates x 1 0 =λ, x 2 0 =λ/2 determine the global minimum point. The optimal value of λ is found by substituting the values ​​x 1 0 and x 2 0 into the equation 2x 1 + x 2 =2, from which 2λ+λ/2=2 or λ 0 =4/5. Thus, the conditional minimum is achieved at x 1 0 =4/5 and x 2 0 =2/5 and is equal to min f(x) = 4/5.

When solving the example problem, we considered L(x;λ) as a function of two variables x 1 and x 2 and, in addition, assumed that the value of the parameter λ was chosen so that the constraint was satisfied. If the solution of the system

J=1,2,3,…,n

λ cannot be obtained in the form of explicit functions, then the values ​​of x and λ are found by solving the following system consisting of n+1 equations with n+1 unknowns:

J=1,2,3,…,n., h 1 (x)=0

To find all possible solutions to a given system, you can use numerical search methods (for example, Newton's method). For each of the solutions (), we should calculate the elements of the Hessian matrix of the function L, considered as a function of x, and find out whether this matrix is ​​positive definite (local minimum) or negative definite (local maximum).

The Lagrange multiplier method can be extended to the case where the problem has several constraints in the form of equalities. Consider a general problem that requires

Minimize f(x)

under restrictions h k =0, k=1, 2, ..., K.

The Lagrange function takes the following form:

Here λ 1 , λ 2 , ..., λk-Lagrange multipliers, i.e. unknown parameters whose values ​​need to be determined. Equating the partial derivatives of L with respect to x to zero, we obtain the following system of n equations with n unknowns:

If it turns out to be difficult to find a solution to the above system in the form of functions of the vector λ, then you can expand the system by including restrictions in the form of equalities

The solution of the extended system, consisting of n + K equations with n + K unknowns, determines the stationary point of the function L. Then a procedure for checking for a minimum or maximum is implemented, which is carried out on the basis of calculating the elements of the Hessian matrix of the function L, considered as a function of x, similar to as was done in the case of a problem with one constraint. For some problems, an extended system of n+K equations with n+K unknowns may have no solutions, and the Lagrange multiplier method turns out to be inapplicable. It should be noted, however, that such tasks are quite rare in practice.

Let us consider a special case of the general problem of nonlinear programming, assuming that the system of constraints contains only equations, there are no conditions for the non-negativity of the variables and and and are continuous functions along with their partial derivatives. Therefore, by solving the system of equations (7), we obtain all points at which function (6) can have extreme values.

Algorithm for the Lagrange multiplier method

1. Compose the Lagrange function.

2. Find the partial derivatives of the Lagrange function with respect to the variables x J ,λ i and equate them to zero.

3. We solve the system of equations (7), find the points at which the objective function of the problem can have an extremum.

4. Among the points suspicious for an extremum, we find those at which the extremum is reached, and calculate the values ​​of function (6) at these points.

Example.

Initial data: According to the production plan, the company needs to produce 180 products. These products can be manufactured in two technological ways. When producing x 1 products using the 1st method, the costs are 4x 1 +x 1 2 rubles, and when producing x 2 products using the 2nd method, they are 8x 2 +x 2 2 rubles. Determine how many products should be produced using each method so that production costs are minimal.

The objective function for the stated problem has the form
® min under the conditions x 1 + x 2 =180, x 2 ≥0.
1. Compose the Lagrange function
.
2. We calculate the partial derivatives with respect to x 1, x 2, λ and equate them to zero:

3. Solving the resulting system of equations, we find x 1 =91,x 2 =89

4. Having made a replacement in the objective function x 2 =180-x 1, we obtain a function of one variable, namely f 1 =4x 1 +x 1 2 +8(180-x 1)+(180-x 1) 2

We calculate or 4x 1 -364=0 ,

whence we have x 1 * =91, x 2 * =89.

Answer: The number of products manufactured by the first method is x 1 =91, by the second method x 2 =89, while the value of the objective function is equal to 17,278 rubles.

  • Tutorial

Good afternoon everyone. In this article I want to show one of the graphical methods for constructing mathematical models for dynamic systems, which is called bond graph(“bond” - connections, “graph” - graph). In Russian literature, I found descriptions of this method only in the Textbook of Tomsk Polytechnic University, A.V. Voronin “MODELING OF MECHATRONIC SYSTEMS” 2008 Also show the classical method through the Lagrange equation of the 2nd kind.

Lagrange method

I will not describe the theory, I will show the stages of calculations with a few comments. Personally, it’s easier for me to learn from examples than to read theory 10 times. It seemed to me that in Russian literature, the explanation of this method, and indeed mathematics or physics in general, is very rich in complex formulas, which accordingly requires a serious mathematical background. While studying the Lagrange method (I study at the Polytechnic University of Turin, Italy), I studied Russian literature to compare calculation methods, and it was difficult for me to follow the progress of solving this method. Even remembering the modeling courses at the Kharkov Aviation Institute, the derivation of such methods was very cumbersome, and no one bothered themselves in trying to understand this issue. This is what I decided to write, a manual for constructing mathematical models according to Lagrange, as it turned out it is not at all difficult, it is enough to know how to calculate derivatives with respect to time and partial derivatives. For more complex models, rotation matrices are also added, but there is nothing complicated in them either.

Features of modeling methods:

  • Newton-Euler: vector equations based on dynamic equilibrium force And moments
  • Lagrange: scalar equations based on state functions associated with kinetic and potential energies
  • Bond Count: flow based method power between system elements

Let's start with a simple example. Mass with spring and damper. We ignore the force of gravity.


Fig 1. Mass with spring and damper

First of all, we designate:

  • initial coordinate system(NSK) or fixed sk R0(i0,j0,k0). Where? You can point your finger at the sky, but by twitching the tips of the neurons in the brain, the idea passes through to place the NSC on the line of movement of the M1 body.
  • coordinate systems for each body with mass(we have M1 R1(i1,j1,k1)), the orientation can be arbitrary, but why complicate your life, set it with minimal difference from the NSC
  • generalized coordinates q_i(the minimum number of variables that can describe the movement), in this example there is one generalized coordinate, movement only along the j axis


Fig 2. We put down coordinate systems and generalized coordinates


Fig 3. Position and speed of body M1

Then we will find the kinetic (C) and potential (P) energies and the dissipative function (D) for the damper using the formulas:


Fig 4. Complete formula for kinetic energy

In our example there is no rotation, the second component is 0.




Fig 5. Calculation of kinetic, potential energy and dissipative function

The Lagrange equation has the following form:


Fig 6. Lagrange Equation and Lagrangian

Delta W_i This is virtual work done by applied forces and moments. Let's find her:


Fig 7. Calculation of virtual work

Where delta q_1 virtual movement.

We substitute everything into the Lagrange equation:


Fig 8. The resulting mass model with spring and damper

This is where Lagrange's method ended. As you can see, it’s not that complicated, but it’s still a very simple example, for which most likely the Newton-Euler method would even be simpler. For more complex systems, where there will be several bodies rotated relative to each other at different angles, the Lagrange method will be easier.

Bond graph method

I’ll show you right away what the model looks like in bond-graph for an example with a mass, a spring and a damper:


Fig 9. Bond-graph masses with spring and damper

Here you will have to tell a little theory, which will be enough to build simple models. If anyone is interested, you can read the book ( Bond Graph Methodology) or ( Voronin A.V. Modeling mechatronic systems: a tutorial. – Tomsk: Tomsk Polytechnic University Publishing House, 2008).

Let us first define that complex systems consist of several domains. For example, an electric motor consists of electrical and mechanical parts or domains.

bond graph based on the exchange of power between these domains, subsystems. Note that power exchange, of any form, is always determined by two variables ( variable power) with the help of which we can study the interaction of various subsystems within a dynamic system (see table).

As can be seen from the table, the expression of power is almost the same everywhere. In summary, Power- This work " flow - f" on " effort - e».

An effort(English) effort) in the electrical domain this is voltage (e), in the mechanical domain it is force (F) or torque (T), in hydraulics it is pressure (p).

Flow(English) flow) in the electrical domain it is current (i), in the mechanical domain it is speed (v) or angular velocity (omega), in hydraulics it is the flow or flow rate of fluid (Q).

Taking these notations, we obtain an expression for power:


Fig 10. Power formula through power variables

In the bond-graph language, the connection between two subsystems that exchange power is represented by a bond. bond). That's why this method is called bond-graph or g raf-connections, connected graph. Let's consider block diagram connections in a model with an electric motor (this is not a bond-graph yet):


Fig 11. Block diagram of power flow between domains

If we have a voltage source, then accordingly it generates voltage and transfers it to the motor for winding (this is why the arrow is directed towards the motor), depending on the resistance of the winding, a current appears according to Ohm’s law (directed from the motor to the source). Accordingly, one variable is an input to the subsystem, and the second must be exit from the subsystem. Here the voltage ( effort) – input, current ( flow) - exit.

If you use a current source, how will the diagram change? Right. The current will be directed to the motor, and the voltage to the source. Then the current ( flow) – input, voltage ( effort) - exit.

Let's look at an example in mechanics. Force acting on a mass.


Fig 12. Force applied to mass

The block diagram will be as follows:


Fig 13. Block diagram

In this example, Strength ( effort) – input variable for mass. (Force applied to mass)
According to Newton's second law:

Mass responds with speed:

In this example, if one variable ( force - effort) is entrance into the mechanical domain, then another power variable ( speed - flow) – automatically becomes exit.

To distinguish where the input is and where the output is, a vertical line is used at the end of the arrow (connection) between the elements, this line is called sign of causality or causation (causality). It turns out: applied force is the cause, and speed is the effect. This sign is very important for the correct construction of a system model, since causality is a consequence of the physical behavior and exchange of powers of two subsystems, therefore the choice of location of the causality sign cannot be arbitrary.


Fig 14. Designation of causality

This vertical line shows which subsystem receives the force ( effort) and as a result produce a flow ( flow). In the example with mass it would be like this:


Fig 14. Causal relationship for the force acting on the mass

It is clear from the arrow that the input for mass is - force, and the output is speed. This is done so as not to clutter the diagram with arrows and systematize the construction of the model.

Next important point. Generalized impulse(amount of movement) and moving(energy variables).

Table of power and energy variables in different domains



The table above introduces two additional physical quantities used in the bond-graph method. They're called generalized impulse (R) And generalized movement (q) or energy variables, and they can be obtained by integrating power variables over time:


Fig 15. Relationship between power and energy variables

In the electrical domain :

Based on Faraday's law, voltage at the ends of the conductor is equal to the derivative of the magnetic flux through this conductor.


A Current strength- a physical quantity equal to the ratio of the amount of charge Q passing through the cross section of the conductor in a certain time t to the value of this period of time.

Mechanical domain:

From Newton's 2nd law, Force– time derivative of impulse


And correspondingly, speed- time derivative of displacement:

Let's summarize:

Basic elements

All elements in dynamic systems can be divided into two-pole and four-pole components.
Let's consider bipolar components:

Sources
There are sources of both effort and flow. Analogy in the electrical domain: source of effortvoltage source, stream sourcecurrent source. Causal signs for sources should only be like this.


Fig 16. Causal connections and designation of sources

Component R – dissipative element

Component I – inertial element

Component C – capacitive element

As can be seen from the figures, different elements of the same type R, C, I are described by the same equations. ONLY there is a difference for electrical capacitance, you just need to remember it!

Quadrupole components:

Let's look at two components: a transformer and a gyrator.

The last important components in the bond-graph method are the connections. There are two types of nodes:




That's it with the components.

The main steps for establishing causal relationships after constructing a bond-graph:

  1. Give causal connections to everyone sources
  2. Go through all the nodes and put down causal relationships after point 1
  3. For components I assign an input causal relationship (effort is included in this component), for components C assign output causality (effort comes out of this component)
  4. Repeat point 2
  5. Insert causal connections for R components
This concludes the mini-course on theory. Now we have everything we need to build models.
Let's solve a couple of examples. Let's start with an electrical circuit, it is better to understand the analogy of constructing a bond-graph.

Example 1


Let's start building a bond-graph with a voltage source. Just write Se and put an arrow.


See, everything is simple! Let's look further, R and L are connected in series, which means the same current flows in them, if we speak in power variables - the same flow. Which node has the same flow? The correct answer is 1-node. We connect the source, resistance (component - R) and inductance (component - I) to the 1-node.


Next, we have capacitance and resistance in parallel, which means they have the same voltage or force. 0-node is suitable like no other. We connect the capacitance (component C) and resistance (component R) to the 0-node.


We also connect nodes 1 and 0 to each other. The direction of the arrows is chosen arbitrarily; the direction of the connection affects only the sign in the equations.

You will get the following connection graph:

Now we need to establish causal relationships. Following the instructions for the sequence of their placement, let's start with the source.

  1. We have a source of voltage (effort), such a source has only one variant of causality - output. Let's put it on.
  2. Next there is component I, let’s see what they recommend. We put
  3. We put it down for 1-node. Eat
  4. A 0-node must have one input and all output causal connections. We have one day off for now. We are looking for components C or I. We found it. We put
  5. Let's list what's left


That's all. Bond graph is built. Hurray, Comrades!

All that remains is to write the equations that describe our system. To do this, create a table with 3 columns. The first will contain all the components of the system, the second will contain the input variable for each element, and the third will contain the output variable for the same component. We have already defined the input and output by causal relationships. So there shouldn't be any problems.

Let's number each connection for ease of recording the levels. We take the equations for each element from the list of components C, R, I.



Having compiled a table, we define the state variables, in this example there are 2 of them, p3 and q5. Next you need to write down the equations of state:


That's it, the model is ready.

Example 2. I would like to immediately apologize for the quality of the photo, the main thing is that you can read

Let's solve another example for a mechanical system, the same one that we solved using the Lagrange method. I will show the solution without comment. Let's check which of these methods is simpler and easier.

In Matbala, both mathematical models with the same parameters were compiled, obtained by the Lagrange method and bond-graph. The result is below: Add tags