ExpSolve

From TomWiki
Revision as of 07:04, 10 July 2011 by Elias (talk | contribs) (Created page with "==expSolve== ==Purpose== Solve exponential fitting problems for given number of terms p. ==Calling Syntax== Prob = expAssign( ... ); Result = expSolve(Prob, PriLev); or R...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

expSolve

Purpose

Solve exponential fitting problems for given number of terms p.

Calling Syntax

Prob = expAssign( ... );

Result = expSolve(Prob, PriLev); or

Result = tomRun('expSolve', PriLev);

Description of Inputs

Prob.SolverL2||Name of solver to use. If empty, TOMLAB selects dependent on license.
Prob Problem created with expAssign.
PriLev Print level in tomRun call.

Description of Outputs

Result TOMLAB Result structure as returned by solver selected by input argument Solver.
LS Statistical information about the solution. See Table 153, page 239.

Global Parameters Used

Description

expSolve solves a cls (constrained least squares) problem for exponential fitting formulates by expAssign. The problem is solved with a suitable or given cls solver.

The aim is to provide a quicker interface to exponential fitting, automating the process of setting up the problem structure and getting statistical data.

M-files Used

GetSolver, expInit, StatLS and expAssign

Examples

Assume that the Matlab vectors t, y contain the following data:

To set up and solve the problem of fitting the data to a two-term exponential model


,


give the following commands:

>> p      = 2;                         % Two terms
>> Name   = 'Simple two-term exp fit'; % Problem name, can be anything
>> wType  = 0;                         % No weighting
>> SepAlg = 0;                         % Separable problem
>> Prob = expAssign(p,Name,t,y,wType,[],SepAlg);

>> Result = tomRun('expSolve',Prob,1);
>> x = Result.x_k'

x =
          0.01          0.58         72.38        851.68

The vector contains the parameters as so the solution may be visualized with

>> plot(t,y,'-*', t,x(3)*exp(-t*x(1)) + x(4)*exp(-t*x(2)) );

Figure 6: Results of fitting experimental data to two-term exponential model. Solid line: final model, dash-dot: data.