Jump to content

University of Florida/Eml5526/s11.team2.reiss.HW3 HW3

From Wikiversity

Obtaining Solution to the Weak Form from a Trial Solution

[edit | edit source]


Given

[edit | edit source]

on

(10.1)

(10.2)


(10.3)


where the weak form is

with

(10.4)

A trial solution for u(x) is suggested as

(10.5)

with w(x) of the same form.

1) determine the solution to the weak form. 2) verify that the solution satisfies the equilibrium equation of the strong form 3) verify that the natural boundary condition is satisfied

Solution 3.10.1

[edit | edit source]

From the given information the equations for u(x) and w(x) are as follows

(10.5)

(10.6)

Using the initial condition

(10.7)

Using the condition that

(10.8)

The partial derivatives of u(x) and w(x) are

(10.8)

(10.9)

Replacing, the weak form becomes

(10.10)

After integration the equation becomes

(10.11)

Rearranging we get

(10.12)

The and values must be arbitrary, the solutions to this equation are dependent on the bracketed terms equaling zero. The solution for this, in matrix form, is

(10.13)

The solution to the weak form becomes

(10.14)

Giving the solution of

(10.15)

Problem 3.7: Rework Problem 3.1 without using a shift in the given polynomial basis.

[edit | edit source]

Given

[edit | edit source]

(7.1)

Boundary Conditions:

(7.2)

(7.3)

(7.4)

The exact solution to Eq.3.1:

(7.5)

We want to find an approximation to Eq.3.5 in the form of

(7.6)

as well as investigate how the accuracy of our approximation changes with n going from 2 to 4 and then 6.

Case:n=2

[edit | edit source]

First let's expand Eq.3.6 out to n=2 terms.

(7.7)

Now consider Eq.7.4, and substitute the appropriate terms into Eq.7.7.

(7.8)

Let's rewrite this equation in terms of a product between 2 vectors.

(7.9)

In order for us to solve for the unknown in Eq.7.9, we must have 3 linearly independent equations describing linear combinations of the Two of the equations are easily obtained directly from the given boundary conditions in Eq.7.2 and Eq.7.3. It only makes practical sense that if we want our approximation to closely resemble our exact solution, we must require identical behavior between Eq.7.5 and Eq.7.8 at the boundaries.

(7.10)

(7.11)

(7.12)

(7.13)

Now we just need one more linearly independent equation and we can then readily solve for the To develop another set of equations which are linearly independent of Eq.7.11 and Eq.7.13, we take the inner product between our approximation of u(x), Eq.7.9 and our basis set of functions Eq.7.4. Before getting to the inner product first, let's define our linear differential operator as the following

(7.14)

Now, using our operator in Eq.7.14, we can now operate on our approximation in Eq.7.9.

(7.15)

Which we can then rewrite Eq.7.15 as

(7.16)

Therefor

(7.21)

Using Eq.7.11 and Eq.7.13, we can form the following matrix equation.

(7.21)

Let's solve for the inverse of the matrix in Eq.7.21 using the Gauss-Jordan Method. Letting the matrix above in Eq.7.21 equal , we can find by

(7.22)

(7.23)

Now using Eq.7.23, we can solve Eq.7.21 for our unknown

(7.24)

(7.25)

(7.26)

Solution

[edit | edit source]

(7.27)

Now. let's check the absolute error between our approximate solution above in Eq. 7.26 and our exact solution in Eq.7.5.

Comparing , 7.27, to , 7.5, we can see that using this basis gives an exact solution to

(7.27)

(7.5)

Graphical Comparison Between Exact and Numerical Approximate Solutions

[edit | edit source]



Case:n=4

[edit | edit source]

We will follow exactly the same methodology as we have above, leaving out the explanations for each step.

(7.32)

(7.33)

(7.34)

Using our given boundary conditions to obtain our first 2 linearly independent equations.

(7.35)

(7.36)

(7.37)

(7.38)

Using our predefined linear differential operator in Eq.7.14.

(7.39)

Because this time we have 5 unknown we will have to choose 3 equations from our inner product operation.

(7.40)

(7.41)

(7.42)

(7.43)

Now we can use the bottom three rows of Eq.7.43, along with Eq.7.36 and Eq.7.38 to develop a system of equations

(7.44)

Solving this system using MATLAB, the solution becomes

(7.45)

Solution

[edit | edit source]

(7.46)

We can see from above in Eq.7.46 that our solution did not improve at all by an increase in n from 2 to 4. This should have been intuitive from the start since we showed earlier that using n=2 gives us an equivalent

Graphical Comparison Between Exact and Numerical Approximate Solutions

[edit | edit source]



Egm5526.s11.team-2.langpm 14:38, 14 February 2011 (UTC)

Case:n=6

[edit | edit source]

(7.47)

Using the given boundary conditions in Eq.7.2 and Eq.7.3 we have the following to restrictions on our approximated solution.

(7.48)

(7.49)

(7.50)

(7.51)

Using the same linear differential operator as we have for the past 2 cases, Eq.7.14 we have the following.

(7.52)

Forming the inner product.

(7.53)

(7.54)

(7.55)

We take the bottom 5 rows from Eq.7.55 and build a system of equations with Eq.7.49 and Eq.7.51.

(7.56)

As in the case, we use a MATLAB to determine the unknown adn to determine the final form of our approximation to the solution of the differential equation 7.1.

(7.57)

Solution

[edit | edit source]

(7.58)

We can see from above in Eq.7.58 that our solution did not improve at all by an increase in n from 2 to 6 as was expected. Comparing this to the results from problem 3.1 we can see that the shift is not necessary for this basis function. It will return an exact solution with or without the shift.

Graphical Comparison Between the Exact and Numerical Solutions

[edit | edit source]