« Previous « Start » Next »
29 EXP Problem
Exponential fitting problems are a set of special problems normally
solved by
expSolve. Several different models are treated in
TOMLAB:
Table 1: Exponential models treated in TOMLAB.
|
f(t) = Σip αi e−βi t, |
αi
≥ 0, |
0≤β1<β2< ... <βp. |
f(t) = Σip αi(1−e−βi t), |
αi
≥ 0, |
0≤β1<β2< ... <βp. |
f(t) = Σip t αi e−βi t, |
αi ≥
0, |
0≤β1<β2< ... <βp. |
f(t) = Σip (t αi−γi) e−βi t, |
αi,γi ≥ 0, |
0≤β1<β2< ... <βp. |
f(t) = Σip t αi e−βi (t − γi), |
αi ≥ 0, |
0≤β1<β2< ... <βp. |
|
Example problem:
The vectors
t,
y contain the following data:
|
ti |
0 |
1.00 |
2.00 |
4.00 |
6.00 |
8.00 |
10.00 |
15.00 |
20.00 |
yi |
905.10 |
620.36 |
270.17 |
154.68 |
106.74 |
80.92 |
69.98 |
62.50 |
56.29 |
|
Setup and solve the problem of fitting the data to a two-term
exponential model:
f(t) = α1 e−β1 t + α2 e−β2 t,
The following file defines and solves the problem in TOMLAB.
File: tomlab/quickguide/expQG.m
Open the file for viewing, and execute expQG in Matlab.
% expQG is a small example problem for defining and solving exponential
% fitting problems using the TOMLAB format. See the TOMLAB manual for
% options.
% f(t) = alpha(1)*exp(-beta(1)*t) + alpha(2)*exp(beta(2)*t)
t = [0 1.00 2.00 4.00 6.00 8.00 10.00 15.00 20.00]';
y = [905.10 620.36 270.17 154.68 106.74 80.92 69.98 62.50 56.29]';
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);
Prob.SolverL2 = 'nlssol';
Result = tomRun('expSolve',Prob,1);
%Prob.SolverL2 = 'snopt7';
%Result = tomRun('expSolve',Prob,1);
« Previous « Start » Next »