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

From Wikiversity
Jump to navigation Jump to search

Obtaining Solution to the Weak Form from a Trial Solution[edit | edit source]

Given[edit | edit source]





where the weak form is



A trial solution for u(x) is suggested as


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



Using the initial condition


Using the condition that


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



Replacing, the weak form becomes


After integration the equation becomes


Rearranging we get


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


The solution to the weak form becomes


Giving the solution of


Problem 3.7: Rework Problem 3.1 without using a shift in the given polynomial basis.[edit | edit source]

Given[edit | edit source]


Boundary Conditions:




The exact solution to Eq.3.1:


Find[edit | edit source]

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


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.


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


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


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.





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


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


Which we can then rewrite Eq.7.15 as




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


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



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




Solution[edit | edit source]


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



Graphical Comparison Between Exact and Numerical Approximate Solutions[edit | edit source]

WRPlot n=2 case.jpg

Case:n=4[edit | edit source]

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




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





Using our predefined linear differential operator in Eq.7.14.


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





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


Solving this system using MATLAB, the solution becomes


Solution[edit | edit source]


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]

WRPlot n=4 case.jpg 14:38, 14 February 2011 (UTC)

Case:n=6[edit | edit source]


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





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


Forming the inner product.




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


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.


Solution[edit | edit source]


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]

Plot n=6 case.jpg