Anda di halaman 1dari 4

Solutions:

Solutions for all Excel problems are displayed in the spreadsheet attached. Matlab solutions can be
obtained by running the scripts. DO NOT run the Problem_3 script unless you have way too much time
on your hands.

Analysis:

The solutions algorithms all produced fairly consistent results across the board for these
problems. The only exception to this was the stiff ODE problem. This system of equations caused grief
due to rates of change that were exponentially different from each other. This gave normal ODE
solution algorithms problems with solving it. For example, solving to t=1e9 seconds took roughly 20 to
25 minutes and adequate solution behavior was not reached (A picture of the graph has been attached).
To see actual solution behavior, it was necessary to run the system with a stiff solver algorithm to
t=5e12. The normal algorithm (standard RK) was run to 5e12, but I gave up after 3 hours of not reaching
a solution. It really demonstrated the power of using a stiff solving tool. Although the theory behind
these algorithms was extensively covered, these tools are very useful applications for solving these
problems.

Also, a Runge-Kutta solver was written for VBA. The coefficients were derived from the classical
method, rather than the Cash-Karp or Gill used by Davis. When applied to both problems 1 and 2, the
results for problem two were identical, but the problem 1 results deviated slightly. Applying a variable
step algorithm may help, but getting the print code to work with that seemed quite complicated. This
may also be a result of different coefficients used.

Solutions:

Answers are clearly labelled in Excel spreadsheet. Matlab results displayed are also clearly labelled
when the appropriate files are executed.

Analysis:

Execution of the algorithms given was fairly straight forward. Instead of using Davis algorithms,
code for both trapezoidal and Simpson rules was written and executed on the data. Consistently, the
trapezoidal algorithms yielded slightly lower answers than the Simpson ones. This was probably due to
the use of the linear model for the intervals. In the case of problem 2, the reason for this was likely due
to the actually curved portion of the curve to be integrated being sliced off. This is because the linear
model of the interval was unable to catch this portion in its calculation. Other than that, results were
consistent and algorithms will be kept and used in the future.

In lieu of using the Simpson function from the file exchange, one was written and has been
included as a separate file. The algorithm is more succinct due to the fact it is only applicable to single
integration.
Solutions:

Answers to problems 1 and 2 are labelled clearly in the spreadsheet or labelled appropriately as results
from running the Matlab files.

Analysis:

The interpolation algorithms were applied fairly easily to the set of data. In almost all cases, the
interpolated value varied from the experimental value by at least “.1”. The reasoning for this is that the
actual “curve of the data” very possibly deviated from the interpolated curve. What this means is that
the curves were not identical at the point of interest, leading to a slightly variant interpolated value.
Interesting thing about this was that the values for interpolation were fairly consistent over a variety of
algorithms tested. In fact, the experimental value may have been subject to an error of some sort
possibly. Regardless, this toolbox of interpolation tools will be useful for further interpolation of
physiochemical data and other sets.
Solution Methods:

Problem 1:

A nonlinear optimization method was used in Excel due to the nonlinear nature of the problem.

Lsqcurvefit was used in Matlab.

Problem 2:

A nonlinear optimization method was used in Excel due to the seemingly nonlinear nature of the
problem. Lsqcurvefit was used in Matlab. Upon discovery that the problem was potentially linearizable,
a linear regression was run using regress in Matlab and data analysis in excel.

Problem 3:

Data analysis was used in Excel to model the linear regression after manipulating the initial function.

The regress function was used in Matlab.

Problem 4:

Data analysis was used in Excel to model the linear regression after manipulating the initial function.

The regress function was used in Matlab.

Problem 5:

This function could be modeled as a linear function by manipulating the form, or as a nonlinear function
by leaving the function as is. Therefore, a nonlinear optimization technique was used in Excel along with
using data analysis.

In Matlab, the linear regression was calculated with regress and the nonlinear regression was calculated
with lsqcurvefit.

Problem 6:

The expression was a simple linear expression. Regress was used in Matlab and data analysis was used
in Excel.
Analysis:

Results between the two programs throughout the assignment was fairly consistent. One of the areas
of difference was performing the regression for the first problem. The nonlinear regressions in both
programs on regard to one constant had a difference of about 20. This was probably due to the
difference in algorithms used by both programs, as there was a difference in the residual sums. Also,
the second problem was quite interesting. Both nonlinear and linear regressions were run on the data
set and function. Both programs produced wildly different parameters for the function. However,
evaluation, done in excel, showed that they were both fairly consistent with the data. I’m still not
convinced that the function in problem 2 can be turned into a linearizable function, as the “y” variable is
a function of both v and p. Regardless, all the tools present here are easy to apply to data as well as
incredibly useful for future work.

Anda mungkin juga menyukai