ExpSolve: Difference between revisions
(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...") |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Category:Solvers]] | |||
{{cleanup|Clean this article.}} | |||
==expSolve== | ==expSolve== | ||
Revision as of 07:19, 11 July 2011
{{#switch: | left =
{{#switch:{{#if: | {{{smallimage}}} | }} | none =| #default =
}} {{#if:{{#if: | {{{smallimageright}}} | }} | {{#ifeq:{{#if: | {{{smallimageright}}} | }}|none | | }} }}{{
#switch:left | left =| #default = }}
{{#if:{{#if:
| {{{smallimage}}}
|
}}
| {{#if:
| {{{smallimage}}}
|
}}
| [[File:{{#switch:caution
| critical = Ambox speedy deletion.png
| important = Ambox deletion.png
| warning = Ambox content.png
| caution = Cleanup.png
| move = Ambox move.png
| protection = Ambox protection.png
| notice
| #default = Cleanup.png
}} | {{#switch:left
| left = 20x20px
| #default = 40x40px
}} |link=|alt=]]
}}{{#switch:left
| left =
| #default = | {{#if:
| {{{smalltext}}}
| Cleanup is needed
}} | {{#switch:left
| left = {{#if:
| {{{smallimageright}}}
|
}}
| #default = {{#if:
}} | {{{smallimageright}}}
|
}} |
| #default =
{{#switch: | none =| #default =
}}{{#if: | {{#ifeq:|none
|| }} }}
{{
#switch: | left =| #default = }}
{{#if:
|
| [[File:{{#switch:caution
| critical = Ambox speedy deletion.png
| important = Ambox deletion.png
| warning = Ambox content.png
| caution = Cleanup.png
| move = Ambox move.png
| protection = Ambox protection.png
| notice
| #default = Cleanup.png
}} | {{#switch:
| left = 20x20px
| #default = 40x40px
}} |link=|alt=]]
}}{{#switch:
| left =
| #default = | Cleanup is needed Clean this article. |
{{#switch:
| left =| #default = |
}}
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.