Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> Dear comrades,
> 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, [],[])
> I receive an error:
> ??? 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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.