Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Optimization. Convex nonlinear function. Exponential mixture
Replies: 1   Last Post: Aug 2, 2013 6:32 AM

 Messages: [ Previous | Next ]
 Torsten Hennig Posts: 2,419 Registered: 12/6/04
Re: Optimization. Convex nonlinear function. Exponential mixture
Posted: Aug 2, 2013 6:32 AM

> I am trying to solve the problem on resolving the
> mixture of two exponents.
> The data I measure comes in the plot Y(response
> measured from the system) over t (time).
> The task I have formulated sounds like this:
> Minimize ||yhat(c,t)-y||;
> where yhat = c(3)*exp(-t*c(1)) + c(4)*exp(-t*c(2))
> subject to
> c(1-4)>=1 and c(3)+c(4)=1.
>
> Here are my attempts in solving it (2 in total):
>
> (1)With the use of Optimization Toolbox:
> close all, clear all
> t = [0 .3 .8 1.1 1.6 2.3]';
> y = [.82 .72 .63 .60 .55 .50]';
> plot(t,y,'o')
> yhat = @(c,t) c(3)*exp(-t*c(1)) + c(4)*exp(-t*c(2));
>
> c0=[0.5; 0.5; 2; 30]
> c = fmincon(@(c)yhat(c,t)-y, c0, [1,1,1,1], 0,
> [0,0,1,1], 1, [],[])
> ??? Error using ==> fmincon at 647
> User supplied objective function must return a scalar
> value.
>
> (2) With the use of MATLAB Package bayesf
> http://statmath.wu.ac.at/~fruehwirth/monographie/
> Demo_mix_exponential.m in particular
> Here I fail to plug my data into the problem. Am
> sorry for perhaps a tedious question, but am really a
> nub that found no solution for the problem so far.
>
> I am greatly thankful for your suggestions and help.

The call to fmincon has to look like
c = fmincon(@(c)(yhat(c,t)-y)'*(yhat(c,t)-y), c0, [1,1,1,1], 0, [0,0,1,1], 1, [],[])

Best wishes
Torsten.

Date Subject Author
8/1/13 Daria
8/2/13 Torsten Hennig