Analytical Model of Cantilever Truss Structure for Simscape

This example shows how to find parameterized analytical expressions for the displacement of a joint of a trivial cantilever truss structure in both the static and frequency domains. The analytical expression for the static case is exact. The expression for the frequency response function is an approximate reduced-order version of the actual frequency response.

Define Model Parameters

The goal of this example is to analytically relate the displacement d to the uniform cross-section area parameter A for a particular bar in the cantilever truss structure. The governing equation is represented by Md2xdt2+Kx=F. Here, d results from a load at the upper-right joint of the cantilever. The truss is attached to the wall at the leftmost joints.

The truss bars are made of a linear elastic material with uniform density. The cross-section area A of the bar highlighted in blue (see figure) can vary. All other parameters, including the uniform cross-section areas of the other bars, are fixed. Obtain the displacement of the tip by using small and linear displacement assumptions.

First, define the fixed parameters of the truss.

Specify the length and height of the truss and the number of top horizontal truss bars.

L = 1.5;
H = 0.25;
N = 3;

Specify the density and modulus of elasticity of the truss bar material.

rhoval = 1e2;
Eval = 1e7;

Specify the cross-section area of other truss bars.

AFixed = 1;

Next, define the local stiffness matrix of the specific truss element.

Compute the local stiffness matrixk and express it as a symbolic function. The forces and displacements of the truss element are related through the local stiffness matrix. Each node of the truss element has two degrees of freedom, horizontal and vertical displacement. The displacement of each truss element is a column matrix that corresponds to [x_node1,y_node1,x_node2,y_node2]. The resulting stiffness matrix is a 4-by-4 matrix.

Find and plot the analytical solution for the displacement d as a function of A. Here, K\F represents the displacements at all joints and c selects the particular displacements. First, show the symbolic solution representing numeric values using 16 digits for compactness.

Approximate Parametric Symbolic Solution for Frequency Response

A parametric representation for the frequency response H(s,A) can be efficient for quickly examining the effects of parameter A without resorting to potentially expensive numeric calculations for each new value of A. However, finding an exact closed-form solution for a large system with additional parameters is often impossible. Therefore, you typically approximate a solution for such systems. This example approximates the parametric frequency response near the zero frequency as follows:

Speed up computations by using variable-precision arithmetic (vpa).

Find the Padé approximation of the transfer function H(s,A)=c(s2M(A)+K(A))-1F around the frequency s = 0 using the first three moments of the series. The idea is that given a transfer function, you can compute the Padé approximation moments as c(-K(A)-1M(A))jK(A)-1F, where j∈{0,2,4,6,...} correspond to the power series terms {1,s2,s4,s6,...}. For this example, compute HApprox(s,A) as the sum of the first three terms. This approach is a very basic technique for reducing the order of the transfer function.

To further speed up calculations, approximate the inner term of each moment term in terms of a Taylor series expansion of A around AFixed.

Use vpa to speed up calculations.

digits(32);
K = vpa(K);
M = vpa(M);

Compute the LU decomposition of K.

[LK,UK] = lu(K);

Create helper variables and functions.

iK = @(x) UK\(LK\x);
iK_M = @(x) -iK(M*x);
momentPre = iK(F);

Define a frequency series corresponding to the first three moments. Here, s is the frequency.

syms s
sPowers = [1 s^2 s^4];

Set the first moment, which is the same as d_Static in the previous computation.

The analytical and numeric curves are close in the chosen interval, but, in general, the curves diverge for frequencies outside the neighborhood of s = 0. Also, for values of A far from AFixed, the Taylor approximation introduces larger errors.

Open Example (es)

A modified version of this example exists on your system. Do you want to open this version instead? (es)