【有限元方法】Newton-Raphson Method

Newton-Raphson Method

Linear vs Nonlinear Analysis:

  • At this point, we can conduct a linear analysis no problem

∫ ∑ i , j = 1 3 σ i j ε i j ∗ d v = ∫ t n ⋅ u ∗ d s + ∫ ρ b ⋅ u ∗ d v ⇒ ∫ e [ B ] T [ C ] [ B ] d x ⏟ k e u e = ∫ ∂ e [ N ] T t n d s + ∫ e [ N ] T ρ b d v \begin{aligned} &\int \sum_{i,j=1}^3\sigma_{ij}\varepsilon_{ij}^*dv=\int t_n\cdot u^*ds + \int \rho b \cdot u^*dv \\ \Rightarrow &\underbrace{\int_e[B]^T[C][B]dx}_{k_e}u_e=\int_{\partial e}[N]^Tt_n ds + \int_e[N]^T\rho b dv \end{aligned} i,j=13σijεijdv=tnuds+ρbudvke e[B]T[C][B]dxue=e[N]Ttnds+e[N]Tρbdv

  • Two Assumption:

(1) Small Deformations
(2) Linear Elastic Materials

  • This allowed us to solve our system using a system of linear equations:

[ K ] [ u ] = [ F ] \begin{aligned} [K] [u] = [F] \end{aligned} [K][u]=[F]

  • Unfortunately, the world is a cruel place and the majority of realistic scenarios require a nonlinear analysis:

Stress-Strain Relationship:
∫ ∑ i , j = 1 3 σ i j ε i j ∗ d v \begin{aligned} &\int \sum_{i,j=1}^3\sigma_{ij}\varepsilon_{ij}^*dv \end{aligned} i,j=13σijεijdv

t n t_n tn and ρ b \rho b ρb are solution dependent:

∫ t n ⋅ u ∗ d s + ∫ ρ b ⋅ u ∗ d v \begin{aligned} \int t_n\cdot u^*ds + \int \rho b \cdot u^*dv \end{aligned} tnuds+ρbudv

Types of Nonlinearities

There are many types of nonlinearities:

1. Geometric Nonlinearity

  • Buckling
  • Large deformation of the material
    在这里插入图片描述

2. Material Nonlinearity

  • Plasticity
  • Damage

在这里插入图片描述

3. Kinematic Nonlinearity

  • Contact

在这里插入图片描述

Newton-Raphson Method (Single Variable)

To solve nonlinear equations we typically employ the Newton-Raphson method (also referred to as Newton’s method). To see how this method works, let’s examine a single variable scenario:

If we hace a continuous function f f f, we can perform a Taylor series expansion:

f ( x ( i + 1 ) ) ≈ f ( x ( i ) ) + ∂ f ( x ( i ) ) ∂ x ( x ( i + 1 ) − x ( i ) ) + 1 2 ! ( ∂ 2 f ( x ( i ) ) ∂ x 2 ) ( x ( i + 1 ) − x ( i ) ) + . . . \begin{aligned} f(x^{(i+1)})\approx f(x^{(i)})+\frac{\partial f(x^{(i)})}{\partial x}(x^{(i+1)}-x^{(i)})+\frac{1}{2!}(\frac{\partial ^2f(x^{(i)})}{\partial x^2})(x^{(i+1)}-x^{(i)})+... \end{aligned} f(x(i+1))f(x(i))+xf(x(i))(x(i+1)x(i))+2!1(x22f(x(i)))(x(i+1)x(i))+...

Neglecting higher-order terms:

f ( x ( i + 1 ) ) ≈ f ( x ( i ) ) + ∂ f ( x ( i ) ) ∂ x ( x ( i + 1 ) − x ( i ) ) \begin{aligned} f(x^{(i+1)})\approx f(x^{(i)})+\frac{\partial f(x^{(i)})}{\partial x}(x^{(i+1)}-x^{(i)}) \end{aligned} f(x(i+1))f(x(i))+xf(x(i))(x(i+1)x(i))

Rearrange equation:

( x ( i + 1 ) − x ( i ) ) = ( f ( x ( i + 1 ) ) − f ( x ( i ) ) ) f ′ ( x ( i ) ) Δ x = ( x ( i + 1 ) − x ( i ) ) K t = f ′ ( x ( i ) ) \begin{aligned} (x^{(i+1)}-x^{(i)})&=\frac{(f(x^{(i+1)}) - f(x^{(i)}))}{f'(x^{(i)})} \\ \Delta x &= (x^{(i+1)}-x^{(i)}) \\ K_t &= f'(x^{(i)}) \end{aligned} (x(i+1)x(i))ΔxKt=f(x(i))(f(x(i+1))f(x(i)))=(x(i+1)x(i))=f(x(i))

Simply equation:

Δ x = F − f ( x ( i ) ) K t = K t − 1 ( F − f ( x ( i ) ) ) \begin{aligned} \Delta x &=\frac{F- f(x^{(i)})}{K_t} = K_t^{-1}(F-f(x^{(i)})) \end{aligned} Δx=KtFf(x(i))=Kt1(Ff(x(i)))

Now let’s examine the parameters of the equation:

F = F = F= Desired Value
x i = x^{i} = xi= Initial Value of x x x
f ( x ( i ) ) = f(x^{(i)}) = f(x(i))= Initial Value of the Function
K t = K_t = Kt= Slope of the Tangent Line
Δ x = \Delta x= Δx= Increment in x x x : solve it

在这里插入图片描述

In FEA:

  • F − f ( x ( i ) ) = F - f(x^{(i)})= Ff(x(i))= Different between applied forces ( F ) (F) (F) and internal forces ( f ( x ( i ) ) ) (f(x^{(i)})) (f(x(i)))
  • Δ x = \Delta x = Δx= Displacement increment

Example 1 - Single Variable Newton-Raphson Method

If f ( x ) = x f(x) = \sqrt{x} f(x)=x , find x x x such that f ( x ) = 3 f(x) = 3 f(x)=3

Function Information:

f ( x ) = x ⇒ K t = ∂ f ∂ x = 1 2 x \begin{aligned} f(x) = \sqrt{x} \Rightarrow K_t = \frac{\partial f}{\partial x} = \frac{1}{2\sqrt{x}} \end{aligned} f(x)=x Kt=xf=2x 1

Δ x = K t − 1 ( F − f ( x ( i ) ) ) \Delta x =K_t^{-1}(F-f(x^{(i)})) Δx=Kt1(Ff(x(i)))

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545

Δ x = K t − 1 ( F − f ( x ( i ) ) ) = ( 0.5 ) − 1 ( 3 − 1 ) = 4 \Delta x =K_t^{-1}(F-f(x^{(i)})) =(0.5)^{-1}(3-1)=4 Δx=Kt1(Ff(x(i)))=(0.5)1(31)=4

在这里插入图片描述

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545
52.240.223.428.42

在这里插入图片描述

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545
52.240.223.428.42
8.422.900.170.578.99

在这里插入图片描述

Newton-Raphson Method (Multi-Variable)

Unfortunately, most scenarios (especially finite element) involve many multi-variable equations:

f 1 ( x 1 , x 2 , . . . , x n ) = 0 f 2 ( x 1 , x 2 , . . . , x n ) = 0 ⋮ f n ( x 1 , x 2 , . . . , x n ) = 0 f_1(x_1, x_2, ..., x_n) = 0 \\ f_2(x_1, x_2, ..., x_n) = 0 \\ \vdots \\ f_n(x_1, x_2, ..., x_n) = 0 f1(x1,x2,...,xn)=0f2(x1,x2,...,xn)=0fn(x1,x2,...,xn)=0

We can perform the Taylor series expansion for each equation:

f 1 ( x 1 ( i + 1 ) , x 2 ( i + 1 ) , . . . , x n ( i + 1 ) ) ≈ f 1 ( x 1 ( i ) , x 2 ( i ) , . . . , x n ( i ) ) + ∂ f 1 ∂ x 1 ∣ x ( i ) ( x 1 ( i + 1 ) − x 1 ( i ) ) + ∂ f 1 ∂ x 2 ∣ x 2 ( i ) ( x ( i + 1 ) − x 2 ( i ) ) + ⋯ + ∂ f 1 ∂ x n ∣ x n ( i ) ( x ( i + 1 ) − x n ( i ) ) \begin{aligned} &f_1(x_1^{(i+1)}, x_2^{(i+1)}, ..., x_n^{(i+1)})\approx f_1 (x_1^{(i)}, x_2^{(i)}, ..., x_n^{(i)}) \\ &+ \frac{\partial f_1}{\partial x_1}|_{x^{(i)}}(x_1^{(i+1)}-x_1^{(i)})+ \frac{\partial f_1}{\partial x_2}|_{x_2^{(i)}}(x^{(i+1)}-x_2^{(i)}) + \cdots +\frac{\partial f_1}{\partial x_n}|_{x_n^{(i)}}(x^{(i+1)}-x_n^{(i)}) \end{aligned} f1(x1(i+1),x2(i+1),...,xn(i+1))f1(x1(i),x2(i),...,xn(i))+x1f1x(i)(x1(i+1)x1(i))+x2f1x2(i)(x(i+1)x2(i))++xnf1xn(i)(x(i+1)xn(i))

Writing all the equations in matrix form:

[ f 1 ( x ( i + 1 ) ) f 2 ( x ( i + 1 ) ) ⋮ f n ( x ( i + 1 ) ) ] = [ f 1 ( x ( i ) ) f 2 ( x ( i ) ) ⋮ f n ( x ( i ) ) ] + [ ∂ f 1 ∂ x 1 ∂ f 1 ∂ x 2 ⋯ ∂ f 1 ∂ x n ∂ f 2 ∂ x 1 ∂ f 2 ∂ x 2 ⋯ ∂ f 2 ∂ x n ⋮ ⋮ ⋱ ⋮ ∂ f n ∂ x 1 ∂ f n ∂ x 2 ⋯ ∂ f n ∂ x n ] [ ( x 1 ( i + 1 ) − x 1 ( i ) ) ( x 2 ( i + 1 ) − x 2 ( i ) ) ⋮ ( x n ( i + 1 ) − x n ( i ) ) ] \begin{aligned} \begin{bmatrix} f_1(x^{(i+1)}) \\ f_2(x^{(i+1)}) \\ \vdots \\ f_n(x^{(i+1)}) \end{bmatrix} = \begin{bmatrix} f_1(x^{(i)}) \\ f_2(x^{(i)}) \\ \vdots \\ f_n(x^{(i)}) \end{bmatrix} + \begin{bmatrix} \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2} & \cdots & \frac{\partial f_1}{\partial x_n} \\ \frac{\partial f_2}{\partial x_1} & \frac{\partial f_2}{\partial x_2} & \cdots & \frac{\partial f_2}{\partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial f_n}{\partial x_1} & \frac{\partial f_n}{\partial x_2} & \cdots & \frac{\partial f_n}{\partial x_n} \end{bmatrix} \begin{bmatrix} (x_1^{(i+1)}-x_1^{(i)})\\ (x_2^{(i+1)}-x_2^{(i)}) \\ \vdots \\ (x_n^{(i+1)}-x_n^{(i)}) \end{bmatrix} \end{aligned} f1(x(i+1))f2(x(i+1))fn(x(i+1)) = f1(x(i))f2(x(i))fn(x(i)) + x1f1x1f2x1fnx2f1x2f2x2fnxnf1xnf2xnfn (x1(i+1)x1(i))(x2(i+1)x2(i))(xn(i+1)xn(i))

We can move the vector containing the value of the functions at the initial guess to the other side to obtain the following:

[ ∂ f 1 ∂ x 1 ∂ f 1 ∂ x 2 ⋯ ∂ f 1 ∂ x n ∂ f 2 ∂ x 1 ∂ f 2 ∂ x 2 ⋯ ∂ f 2 ∂ x n ⋮ ⋮ ⋱ ⋮ ∂ f n ∂ x 1 ∂ f n ∂ x 2 ⋯ ∂ f n ∂ x n ] [ ( x 1 ( i + 1 ) − x 1 ( i ) ) ( x 2 ( i + 1 ) − x 2 ( i ) ) ⋮ ( x n ( i + 1 ) − x n ( i ) ) ] = [ f 1 ( x ( i + 1 ) ) f 2 ( x ( i + 1 ) ) ⋮ f n ( x ( i + 1 ) ) ] − [ f 1 ( x ( i ) ) f 2 ( x ( i ) ) ⋮ f n ( x ( i ) ) ] \begin{bmatrix} \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2} & \cdots & \frac{\partial f_1}{\partial x_n} \\ \frac{\partial f_2}{\partial x_1} & \frac{\partial f_2}{\partial x_2} & \cdots & \frac{\partial f_2}{\partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial f_n}{\partial x_1} & \frac{\partial f_n}{\partial x_2} & \cdots & \frac{\partial f_n}{\partial x_n} \end{bmatrix} \begin{bmatrix} (x_1^{(i+1)}-x_1^{(i)})\\ (x_2^{(i+1)}-x_2^{(i)}) \\ \vdots \\ (x_n^{(i+1)}-x_n^{(i)}) \end{bmatrix} = \begin{bmatrix} f_1(x^{(i+1)}) \\ f_2(x^{(i+1)}) \\ \vdots \\ f_n(x^{(i+1)}) \end{bmatrix} - \begin{bmatrix} f_1(x^{(i)}) \\ f_2(x^{(i)}) \\ \vdots \\ f_n(x^{(i)}) \end{bmatrix} x1f1x1f2x1fnx2f1x2f2x2fnxnf1xnf2xnfn (x1(i+1)x1(i))(x2(i+1)x2(i))(xn(i+1)xn(i)) = f1(x(i+1))f2(x(i+1))fn(x(i+1)) f1(x(i))f2(x(i))fn(x(i))

or in a more simple form:

[ K ] [ Δ x ] = [ F ] − [ f ( x ( i ) ) ] [K] [\Delta x] = [F] - [f(x^{(i)})] [K][Δx]=[F][f(x(i))]

Moving [ K t ] [K_t] [Kt] to the other side:

[ Δ x ] = [ K t ] − 1 ( [ F ] − [ f ( x ( i ) ) ] ) [\Delta x] = [K_t]^{-1}([F]-[f(x^{(i)})]) [Δx]=[Kt]1([F][f(x(i))])

Same as single variable case but now we have vectors and matrices

Convergence Checks:

With multiple variables it is difficult to determine if the method has converged or not. To make things easier, the norm of the vectors is used:

1. Force (and Moment) Convergence:

  • Force convergence is achieved when the norm of the vector f ( x ( i ) ) − F f(x^{(i)}) - F f(x(i))F divided by the norm of vector F F F is less than the specified tolerance e R e_R eR

∣ ∣ f ( x ( i ) ) − F ∣ ∣ ∣ ∣ F ∣ ∣ ≤ e R \frac{||f(x^{(i)})-F||}{||F||} \leq e_R ∣∣F∣∣∣∣f(x(i))F∣∣eR

2. Displacement Convergence:

  • Force convergence is achieved when the norm of the vector Δ u \Delta u Δu divided by the norm of vector x ( i ) x^{(i)} x(i) is less than the specified tolerance e u e_u eu
    ∣ ∣ Δ x ∣ ∣ ∣ ∣ x ( i ) ∣ ∣ ≤ e e \frac{||\Delta x||}{||x^{(i)}||} \leq e_e ∣∣x(i)∣∣∣∣Δx∣∣ee

Example 2 - Multi-Variable Newton-Raphson Method:

If f ( x 1 , x 2 ) = [ 20 x 1 4 x 2 + 3 x 2 3 , 20 x 1 2 x 2 3 ] f(x_1, x_2) = [20x_1^4x_2+3x_2^3, 20x_1^2x_2^3] f(x1,x2)=[20x14x2+3x23,20x12x23], find { x 1 , x 2 } \{x_1, x_2\} {x1,x2} such that f ( x 1 , x 2 ) = [ 20 , 1 ] f(x_1, x_2) = [20, 1] f(x1,x2)=[20,1]

Function Information:

f 1 ( x 1 , x 2 ) = 20 x 1 4 x 2 + 3 x 2 3 f 2 ( x 1 , x 2 ) = 20 x 1 2 x 2 3 . ⇒ [ K t ] = [ ∂ f 1 ∂ x 1 ∂ f 1 ∂ x 2 ∂ f 2 ∂ x 1 ∂ f 2 ∂ x 2 ] = [ 80 x 1 3 x 2 20 x 1 4 + 9 x 2 2 40 x 1 x 2 3 60 x 1 2 x 2 2 ] \begin{aligned} f_1(x_1, x_2) &= 20x_1^4x_2+3x_2^3 \\ f_2(x_1, x_2) &= 20x_1^2x_2^3. \\ \Rightarrow [K_t] &= \begin{bmatrix} \frac{\partial f_1}{\partial x_1} &\frac{\partial f_1}{\partial x_2} \\ \frac{\partial f_2}{\partial x_1} &\frac{\partial f_2}{\partial x_2} \end{bmatrix} = \begin{bmatrix} 80x_1^3x_2& 20x_1^4+9x_2^2 \\ 40x_1x_2^3& 60x_1^2x_2^2 \end{bmatrix} \end{aligned} f1(x1,x2)f2(x1,x2)[Kt]=20x14x2+3x23=20x12x23.=[x1f1x1f2x2f1x2f2]=[80x13x240x1x2320x14+9x2260x12x22]

Sample Calculations ( 1 s t 1^{st} 1st Iteration):
f 1 ( 1 , 1 ) = 20 ( 1 ) 4 ( 1 ) + 3 ( 1 ) 3 = 23 f 2 ( 1 , 1 ) = 20 ( 1 ) 2 ( 1 ) 3 = 20 [ K t ] = [ 80 ( 1 ) 3 ( 1 ) 20 ( 1 ) 4 + 9 ( 1 ) 2 40 ( 1 ) ( 1 ) 3 60 ( 1 ) 2 ( 1 ) 2 ] ⇒ [ K t ] = [ 80 29 40 60 ] [ Δ x ] = [ K t ] − 1 ( [ F ] − [ f ] ) [ Δ x ] = [ 80 29 40 60 ] − 1 ( [ 20 1 ] ) − [ 23 20 ] ) = [ 0.102 − 0.385 ] ) \begin{aligned} f_1(1, 1) &= 20(1)^4(1) + 3(1)^3 = 23 \\ f_2(1, 1) &= 20(1)^2(1)^3 = 20 \\ [K_t] & = \begin{bmatrix} 80(1)^3(1) & 20(1)^4+9(1)^2 \\ 40(1)(1)^3 & 60(1)^2(1)^2 \end{bmatrix} \\ \Rightarrow [K_t] &= \begin{bmatrix} 80 & 29 \\ 40 & 60 \end{bmatrix} \\ [\Delta x] &= [K_t]^{-1}([F]-[f]) \\ [\Delta x] &=\begin{bmatrix} 80 & 29 \\ 40 & 60 \end{bmatrix} ^{-1}( \begin{bmatrix} 20 \\ 1 \end{bmatrix}) - \begin{bmatrix} 23 \\ 20 \end{bmatrix}) = \begin{bmatrix} 0.102 \\ -0.385 \end{bmatrix}) \end{aligned} f1(1,1)f2(1,1)[Kt][Kt][Δx][Δx]=20(1)4(1)+3(1)3=23=20(1)2(1)3=20=[80(1)3(1)40(1)(1)320(1)4+9(1)260(1)2(1)2]=[80402960]=[Kt]1([F][f])=[80402960]1([201])[2320])=[0.1020.385])

x 1 ( i ) x_1^{(i)} x1(i) x 2 ( i ) x_2^{(i)} x2(i) f 1 ( x ( i ) ) f_1(x^{(i)}) f1(x(i)) f 2 ( x ( i ) ) f_2(x^{(i)}) f2(x(i)) Δ x 1 \Delta x_1 Δx1 Δ x 2 \Delta x_2 Δx2 e R e_R eR e u e_u eu
1123200.102-0.38596.128.1
1.1020.61518.8385.6500.125-0.21523.919.7
1.2270.40018.3251.9270.096-0.0859.69.9
⋮ \vdots ⋮ \vdots ⋮ \vdots ⋮ \vdots ⋮ \vdots ⋮ \vdots ⋮ \vdots ⋮ \vdots
1.3480.30219.9791.0010.001-0.00010.10.04

6 Iterations

Other Methods:

Over the years the Newton-Raphson method has been modified to help improve stability and reduce computation time:

1. Modified Newton-Rapshson Method

  • [ K t ] [K_t] [Kt] is recalculated at selected iterations (say every 5 t h 5^{th} 5th increment) or kept constant during the entire analysis
  • Requires additional computations to converge but is able to reduce computation cost

Secant Method (Quasi-Newton)

  • Approximates [ K t ] [K_t] [Kt] after the first iterations

[ K t ] i = f ( x ( i ) ) − f ( x ( i − 1 ) ) x ( i ) − x ( i − 1 ) [K_t]_i = \frac{f(x^{(i)})-f(x^{(i-1)})}{x^{(i)}-x^{(i-1)}} [Kt]i=x(i)x(i1)f(x(i))f(x(i1))

  • Don’t need to calculate derivatives!
  • Provides a good convergence rate while reducing the computational cost

Example 3- Single Variable Modified Newton-Raphson Method:

If f ( x ) = x f(x) = \sqrt{x} f(x)=x , find x x x such that f ( x ) = 3 f(x) = 3 f(x)=3

Function Information:

f ( x ) = x ⇒ K t = ∂ f ∂ x = 1 2 x \begin{aligned} f(x) = \sqrt{x} \Rightarrow K_t = \frac{\partial f}{\partial x} = \frac{1}{2\sqrt{x}} \end{aligned} f(x)=x Kt=xf=2x 1

Δ x = K t − 1 ( F − f ( x ( i ) ) ) \Delta x =K_t^{-1}(F-f(x^{(i)})) Δx=Kt1(Ff(x(i)))

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545

在这里插入图片描述

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545
52.240.51.526.52

在这里插入图片描述

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545
52.240.51.526.52
6.522.550.50.897.41

在这里插入图片描述

x ( i ) x^{(i)} x(i) f ( x ( i ) ) f(x^{(i)}) f(x(i)) K t K_t Kt Δ x \Delta x Δx x ( i + 1 ) x^{(i+1)} x(i+1)
110.545
52.240.51.526.52
6.522.550.50.897.41
7.412.720.50.557.97

在这里插入图片描述

Slower Convergence!!

Material Nonlinearity Example

在这里插入图片描述
在这里插入图片描述

Wolfram Mathematica

(* Material Nonlinearity Example*)
 Clear["Global *"]
 
 (*Parameters *)  
 L = 1.0;
 A = 1;
 p = X1^2';

(* Newton-Raphson Parameters*)
Xi = 1;
ErrorLimit = 0.5;
MaxIter = 1;

(* Stress-Strain Relationship *)
s = 10 * u'[X1] + 100000 * u'[X1]^3;


(* Exact Solution *)
DE = D[s*A, X1]+p;
sol = NDSolve[{DE == 0, u[0] == 0, u[L] == 0}, u[X1], X1];   // Numerical  
uExact = u[X1] /. sol[[1]]; 

Plot[uExact, {X1, 0, L}]

在这里插入图片描述

(* RR Approximation *)



(* Approximation Function *)
uApprox = a0 + a1*X1 + a2*X1^2;

(* Essential Boundary Conditioons *)
BC1 = uApprox /. {X1 -> 0};
BC2 = uApprox /. {X1 -> L};
sol1 = Solve[{BC1 == 0, BC2 == 0}, {a0, a1}];
{a0, a1} = {a0, a1} /. sol1[[1]];

(* Total Internal Strain Energy *)
S = 10 * e + 100000 * e^3;
SED = Integrate[S, {e, 0, e}];      // 5e^2 + 25000e^4, Strain Energy Density
e = D[uApprox, X1];
TSE = Integrate[SED, {X1, 0, L}];  // 1.66667a2^2+5000 a2^4,   Total Strain Energy

(* Work *)
W = Integrate[p * uApprox, {X1, 0, L}];   // -0.05a2

(* Potential Energy *)
PE = TSE - W;             // 0.05a2 + 1.66667a2^2 + 5000a2^4

(* Newton-Rapshon Method *)
// What equation trying to solve?

ai = {a2};
Func = D[PE, a2];    // f(x)
Kt = D[Func, a2];    // f'(x)


For[i = 1, i <= maxIter, i++

(* Calculate Function and Kt at Current Iteration *)
FuncIter = Func /. {a2 -> Xi};
KtIter = Kt /. {a2 -> Xi};

(* Solving for Delta X *)
Delta = (-1) * FuncIter / KtIter;

(* Finding Xi for Next Iteration *)
XInit = Xi;
Xi = Xi + Delta;


(* Break Loop Once Convergence Occurs *)
Error. = (Delta / XInit) * 100;
If[Abs[Error] <= ErrorLimit, 
 Print["Analysis Converged!"];
 Print["     Coefficient a2 = ",  Xi];
 Print["    Error= ", Error, " (%)"];
 a2 = Xi;
 Conv = 1;
 Break[]];

(* Track Results *)
Print["  Iteration: ", i];
Print["  Coefficient a2 = ", Xi];
Print["Error = ", Error, "(%)"];

(* Error Message if Max Number of Iterations Reached *)
If[i==maxIter, 
  Print["Max of Number of Iterations Reached"]];



]

Plot[{uExact, uApprox}, {X1, 0, L}]

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/130186.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

CSS3 分页、框大小、弹性盒子

一、CSS3分页&#xff1a; 网站有很多个页面&#xff0c;需要使用分页来为每个页面做导航。示例&#xff1a; <style> ul.pagination { display: inline-block; padding: 0; margin: 0; } ul.pagination li {display: inline;} ul.pagination li a { color: black; f…

[工业自动化-9]:西门子S7-15xxx编程 - PLC主站 - 信号量:模拟量

目录 前言&#xff1a; 一、模拟量模块 1.1 概述 1.2 安装 1.3 模拟量链接线 二、模拟量常见问题 2.1 两线制、四线制&#xff08;电流&#xff09; 2.2 模拟量模块的参数 2.3 差分信号与单端信号 三、如何防止电磁干扰 3.1 概述 3.2 工业现场的电磁干扰源来源 3.…

3D物理模拟和视觉特效软件SideFX Houdini mac中文介绍

SideFX Houdini for mac是一款3D物理模拟和视觉特效软件&#xff0c;几乎所有好莱坞特效电影里的物理模拟&#xff0c;包括碎裂&#xff0c;烟尘&#xff0c;碰撞&#xff0c;火焰&#xff0c;流体等模拟&#xff0c;都看得到它的身影。其独特的节点式操作方式&#xff0c;尤其…

Anaconda Powershell Prompt和Anaconda Prompt的区别

先说结论&#xff1a;主要功能应该一样。区别在于powershell支持的命令更多。比如查询路径的命令pwd和列表命令ls。 Anaconda PowerShell Prompt和Anaconda Prompt是Anaconda发行版中两个不同的命令提示符工具。 Anaconda Prompt是Anaconda发布的默认命令提示符工具&#xff0…

前端开发神器之 VsCode AI 辅助插件 DevChat

目录 前言DevChat介绍DevChat 独特优势注册账号安装插件设置密钥访问指令AI 解疑 最后 #AI编程助手哪家好&#xff1f;DevChat“真”好用 # 前言 我们都有过写代码时反复看了半天也不知道bug在哪&#xff0c;大大浪费了时间。一些基础的代码可能看一会儿能够解决&#xff0c;但…

DDoS攻击剧增,深入解析抗DDoS防护方案

当下DDoS攻击规模不断突破上限&#xff0c;攻击方式越发复杂。面对复杂的攻击形式&#xff0c;对于企业和组织来说无疑需要更完备的抗DDoS方案&#xff0c;依靠传统的解决方法并不能做到一劳永逸。在服务器抵抗DDoS防护上&#xff0c;你不会忽略F5的产品&#xff0c;让我们一起…

【Git】gui图形化界面的使用、ssh协议以及idea集成Git

目录 gui图形化界面的使用 介绍 特点 gui图形的使用 ssh协议 介绍 步骤及概念 ssh协议的使用 配置公钥 idea集成Git idea配置git IDEA安装gitee IDEA中登入Git ​编辑 项目分享 克隆分享的项目 ​编辑 ​编辑 idea上传远程 gui图形化界面的使用 介绍 GUI&#xff08…

4 Paimon数据湖之Hive Catalog的使用

更多Paimon数据湖内容请关注&#xff1a;https://edu.51cto.com/course/35051.html Paimon提供了两种类型的Catalog&#xff1a;Filesystem Catalog和Hive Catalog。 Filesystem Catalog&#xff1a;会把元数据信息存储到文件系统里面。Hive Catalog&#xff1a;则会把元数据…

什么是进程等待?

什么是进程等待 在了解进程等待之前&#xff0c;我们要回顾一下什么是僵尸进程&#xff1a;是指一个已经终止执行的进程&#xff0c;但其父进程还没有通过 wait() 系统调用来获取该进程的退出状态信息。当一个进程正常退出或者被终止时&#xff0c;其所占用的系统资源会被操作…

rust实现quic服务端和客户端

演示如何使用 Quinn 库实现一个简单的 QUIC 客户端和服务器。QUIC 是一种基于 UDP 的协议&#xff0c;用于在互联网上进行快速和安全的通信。 在程序中&#xff0c;使用了 Rust 的标准库中的 error、net 和 sync 模块&#xff0c;以及第三方库 tokio 和 quinn。程序使用了 asy…

C# OpenCvSharp DNN HybridNets 同时处理车辆检测、可驾驶区域分割、车道线分割

效果 项目 代码 using OpenCvSharp; using OpenCvSharp.Dnn; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; using System.Numerics; using System.Text; using System.Windows.Forms;namespace OpenCvSharp_D…

如何使用CORS和CSP保护前端应用程序安全

前端应用在提供无缝用户体验方面起着核心作用。在当今互联网的环境中&#xff0c;第三方集成和API的普及使得确保强大的安全性至关重要。安全漏洞可能导致数据盗窃、未经授权访问以及品牌声誉受损。本文将向您展示如何使用CORS和CSP为您的网页增加安全性。 嗨&#xff0c;大家好…

使用Redis实现热搜功能

Redis热搜 原理数据类型redis操作简单实现 实操封装方法执行方法最后使用springboot的定时任务对热搜榜单进行维护 原理 使用redis实现热搜的原理就是维护一个zset集合&#xff0c;然后使用score作为当前搜索词的搜索量&#xff0c;score越高的搜索词就说明该搜索词热度越高。…

【蓝桥杯选拔赛真题17】C++时间换算 第十二届蓝桥杯青少年创意编程大赛C++编程选拔赛真题解析

目录 C/C++时间换算 一、题目要求 1、编程实现 2、输入输出 二、算法分析 <

USB偏好设置-Android13

USB偏好设置 1、USB偏好设置界面和入口2、USB功能设置2.1 USB功能对应模式2.2 点击设置2.3 广播监听刷新 3、日志开关3.1 Evet日志3.2 代码中日志开关3.3 关键日志 4、异常 1、USB偏好设置界面和入口 设置》已连接的设备》USB packages/apps/Settings/src/com/android/setting…

CSS 移动端 1px(线条/边框) 不同机型上显示粗细不同,解决办法

由于不同的手机有不同的像素密度导致的。如果移动显示屏的分辨率始终是普通屏幕的2倍&#xff0c;1px的边框在devicePixelRatio2的移动显示屏下会显示成2px&#xff0c;所以在高清瓶下看着1px总是感觉变胖了 <!DOCTYPE html> <html lang"en"> <head&g…

快速修复因相机断电导致视频文件打不开的问题

3-5 本文主要解决因相机突然断电导致拍摄的视频文件打不开的问题。 在日常工作中&#xff0c;有时候需要使用相机拍摄视频&#xff0c;比如现在有不少短视频拍摄的需求&#xff0c;如果因电池突然断电的原因&#xff0c;导致拍出来的视频播放不了&#xff0c;这时候就容易出大…

自适应模糊PID控制器在热交换器温度控制中的应用

热交换器是一种常见的热能传递设备&#xff0c;广泛应用于各个工业领域。对热交换器温度进行有效控制具有重要意义&#xff0c;可以提高能源利用效率和产品质量。然而&#xff0c;受到热传导特性和外部环境变化等因素的影响&#xff0c;热交换器温度控制难度较大。本文提出一种…

个人怎么投资伦敦金?

伦敦金是一种被广泛交易的黄金合约&#xff0c;是投资者参与黄金市场的一种交易方式。伦敦金投资也是黄金交易中最为方便快捷的一个种类&#xff0c;在黄金交易市场中占有较大的比例&#xff0c;每天都有来自全球各地的投资者参与买卖&#xff0c;是实现财富增益的一个有效途径…

数据库数据恢复—MSSQL报错“附加数据库错误823”如何恢复数据?

数据库故障&分析&#xff1a; MSSQL Server数据库比较常见的报错是“附加数据库错误823”。如果数据库有备份&#xff0c;只需要还原备份即可&#xff1b;如果无备份或者备份不可用&#xff0c;则需要使用专业的数据恢复手段去恢复数据。 MSSQL Server数据库出现“823”的报…