On 10/22/2007 2:12:58 AM, Wave wrote:
>Thanks jmG. No need to sorry, life is hard in engineering. Sad. I have no choice but to take this class as I double major in aeronautical and mechanical engineering (the aero major needs this class the most as this professor will teach Theoretical and Computational Aerodynamics in the spring).
The TAs are actually doing the grading and are in charge of assigning these projects. I'm not sure who write these projects.
maybe this will help clarify some stuff in project 3
http://mae.ucdavis.edu/~eng180/index.htm >_______________________
All in all it is a Matlab task or project about splines. The tridiagonal solver is very important, the form for the l, p, c splines is universal and as given in the Mathcad sheet you had. The first and last elements vary for the 3 types, but it is not rigid as suggested . In Mathcad, you can extract the spline coefficients and modify the first and last ones for other kind of extra-fit (extrapolation sometimes needed). Same thing applies to Hermite cubic and quadratic.
Now, about the Dolittle-Cholesky comparison, who cares ? unless one is recognized better/faster than the other one. On that, trust Mathsoft .
His suggestion about simply linear or quadratic for the first derivative (the one at the extreme right) ... I disagree on the two principles as suggested. It may become a very delicate task for the Engineer to fit real life problem .
You project is more a Matlab one than Mathcad.
...............
Extract from project 2:
Splines
Linear spline:
Plot straight lines from point to point. You don't need additional points between the given points, but it's a good idea to test your code by finding them, and then to extend the code to quadratic and cubic splines.
Quadratic spline:
Quadratic polynomial is y=ai+bi(x-xi)+ci(x-xi)2.
Where, bi=bi-1+2ci-1(xi-xi-1).
To find the coefficient b for the current segment (i) you need to know b and c from the previous segment (i-1). The (i-1) segment does not exist for the first segment. Therefore, you have to find the coefficients of the quadratic polynomial for the first segment by some other way. Find them by fitting a parabola to the first three points. Having the coefficients of the polynomial for each segment you can plot a line between each pair of the given points. The line will look differently if you go forward from the first point or go backward from the last point. Find two lines: the "forward" line and the "backward" one. Then, average them. To program the backward way is tricky. Here is a nice and simple "cheat": flip the data and run your forward subroutine again.
Cubic spline:
y=ai+bi(x-xi)+ci(x-xi)2+di(x-xi)3.
Here you use the tridiagonal solver to find the coefficients bi. First, make sure that your tridiagonal solver works.
Known b, the coefficients c and d can be found solving a system of two equations:
yi+1=yi+bi(xi+1-xi)+ci(xi+1-xi)2+di(xi+1-xi)3
bi+1=bi+2ci(xi+1-xi)+3di(xi+1-xi)2
Where the second equation is the derivative of the first equation.
....................
jmG