12.07.2015 Views

Portable Document Format (PDF) - Institut für Mathematik - TU Berlin

Portable Document Format (PDF) - Institut für Mathematik - TU Berlin

Portable Document Format (PDF) - Institut für Mathematik - TU Berlin

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The user specifies the kind of DAE (linear or nonlinear) and the way thisDAE is solved by calling one of the two setup functions geldasetup (forlinear problems) or gendasetup (for nonlinear problems). Both of thesefunctions return a structure array which contains the necessary general informationabout the setup. This structure array is the first input to the functionsolvedae. The following inputs are handles to functions which describe thematrix- and vector-valued functions and their derivatives for linear DAEs orthe left hand side, its derivatives and its Jacobians for nonlinear DAEs. Initialvalues which do not necessarily have to be consistent are the next input. Asan optional input, time points where the solution should be evaluated can begiven. If this optional input is omitted, then the computed solution will beevaluated at t f only.2.1 ExamplesExample 1An example for a linear DAE is the following system.[ ] [ ] [ 0 01 −te−tẋ(t) = −x(t) +1 −t0 00], t ∈ [0, 1]To solve it with solvedae the first step would be to write three m-files implementingthe two matrix-valued functions E, A, and the vector-valued functionf.function [E] = myE(t)E(2,2) = -t;E(2,1) = 1;function [A] = myA(t)A(1,2) = t;A(1,1) = -1;A(2,1) = 0;A(2,2) = 0;function [f] = myf(t)f(1) = exp(-t);f(2) = 0;Then one types the following lines in the command window.s = geldasetup(2, 2, [0 1], ’standard’);A GUI opens. To use the standard setup of the solver no changes are required.So we accept the setup by pushing the apply-button. As a result we get astructure array called s which will be used to call the functions symdiff andsolvedae. Note, that we choose inconsistent initial values. Consistent initialvalues will be computed by the solver.10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!