
The specific steps are as follows: (1) the symbolical expression of Π d is differentiated with respect to the ith variable in q e, and the symbolical expression of the first-order partial derivative of Π d is obtained, denoted by Π d, q e i (2) the symbolical expression of Π d, q e i is differentiated with respect to the jth variable in q e, and the resulting derivative is the symbolical expression of k i j e (3) the symbolical expression of Π d, q e i is differentiated with respect to the jth variable in q

The variation of the total potential energy Π d is taken with respect to displacement variables, and all the terms in element matrices (stiffness coefficient k i j e, damping coefficient c i j e, and mass coefficient m i j e) can be obtained in the form of Matlab symbol. īased on the symbolical expressions of the displacement, velocity, and acceleration of the element, the symbolical expression of the total potential energy Π d of the element (including the elastic strain energy, potential energy of damping forces, and the potential energy of inertial forces) can be obtained.( z, t ), and v ¨ ( z, t ) of the planar beam element should be written.For example, the symbolical expressions of v ( z, t ), v That is, the element’s displacement, velocity, and acceleration are described by symbolical expressions, respectively. The displacement, velocity, and acceleration variables of nodes are used to express the displacement, velocity, and acceleration of the element, respectively. The sequences of variables in the vectors q e, q The sequence of the node displacement variables in the vector q e determines the position of the terms in the element stiffness (damping and mass) matrix. e, and the node acceleration variables and their corresponding vector q ¨ e of the element are symbolically expressed.The node displacement variables and their corresponding vector q e, the node velocity variables and their corresponding vector q Based on the above preparations, the detailed procedures to formulate the element matrix by means of Matlab program are presented as follows:



It should be noted that the specific differentiations and integrals will be done in Matlab.
#Matlab 2018b ut chemical engineering code#
Both solvers terminate at iteration 100, that is, immediately before the maximum number of iterations is reached because the termtol threshold has been violated.Īs was the case with the GDM MatLab example of Section 3.6.2, the NR MatLab code developed in this section can relatively easily be extended to cater for multivariable problems by adapting the code to reflect the relative differences between Equations (3.60) and (3.61). Reviewing the actual numerical values it is confirmed that the GDM and NR f( x i) values are identical from i = 29 up to the maximum number of iterations. At iteration 28 the GDM does, however, seem to diverge from the optimum solution and converge toward the NR solution and closely “follow” the NR solver results from this point onward. iteration # for example, problem f(x i) = x 2.įigure 3.14 reveals that the GDM initially converges significantly faster than the NR solver and seems to reach the optimum solution x = 0 around the 20th iteration. Function = s_function(t,x,u,flag)Įrror() įunction =mdlInitializeSizes
