Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Excel solver in matlab optimisation

Subject: Excel solver in matlab optimisation

From: Vijay

Date: 24 Jun, 2008 11:25:06

Message: 1 of 7

Hai everyone,

Am currently working on matlab optimisation toolbox. I am exactly looking for a tool which is similar to solver function in MS- Excel wherein i can find the set of variables which influence the function such that i can minimise my cost function to certain value. (ie) cost function should be equal to 1. This is can be done with ease using MS excel solver function. But i am struggling to find similar function with matlab. I tried using fsolve but am not able to find solution.

Could anyone help me in this regard???

Vijay

Subject: Excel solver in matlab optimisation

From: John D'Errico

Date: 24 Jun, 2008 13:08:01

Message: 2 of 7

Vijay <aarvijayanand@aol.com> wrote in message
<1254084.1214306736921.JavaMail.jakarta@nitrogen.mathforum.org>...
> Hai everyone,
>
> Am currently working on matlab optimisation toolbox. I am exactly looking
for a tool which is similar to solver function in MS- Excel wherein i can find
the set of variables which influence the function such that i can minimise my
cost function to certain value. (ie) cost function should be equal to 1. This is
can be done with ease using MS excel solver function. But i am struggling to
find similar function with matlab. I tried using fsolve but am not able to find
solution.
>
> Could anyone help me in this regard???
>
> Vijay

Except, you are not minimizing your cost
function.

fsolve is a root finder. It finds a combination
of your parameters that produces zero as
the result when you evaluate your cost
function.

Your problem is formally to find a combination
of your parameters that produces a value of
1 when you evaluate your function. What
would happen if you subtract 1 from your
function? Would it then fit into the fsolve
paradigm?

HTH,
John

Subject: Excel solver in matlab optimisation

From: Vijay

Date: 24 Jun, 2008 13:53:10

Message: 3 of 7

Hello John,

Thanks for ur reply.

I did the same way but still am not able to solve.

i will give my code so that u can have alook and suggest me further.

T_Staying_time_1 =[31464 18432 13104 10152 8352 6984 6120 5472 4824 4320 4032 3672 3384 3240 3024 2808 2664 2520 2376 2232 2232 2016 2016 1944 1800 1800 1800 1656 1584 1512 1512 1584 1440 1512 1656 3024 4320 4248 4032 4104 3960 3816 3816 3672 3672 3528 3672 3528]';

T_Staying_time_2 =[15732 9216 6552 5076 4176 3492 3060 2736 2412 2160 2016 1836 1692 1620 1512 1404 1332 1260 1188 1116 1116 1008 1008 972 900 900 900 828 792 756 756 792 720 756 828 1512 2160 2124 2016 2052 1980 1908 1908 1836 1836 1764 1836 1764]';

temp_tc1 = [120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 330 335 340 345 350 355]';

temp_tc2 = [120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 330 335 340 345 350 355]';

EC =[5287161963177.33 -0.0615797460685912];

% EC =[1287161963177.33 -0.0115797460685912];

options=optimset('Display','iter'); % 'MaxFunEvals',10^3,'TolFun',1e-40,'TolX',1e-10Option to display output

% [EC,fval] = fsolve(@(EC) end_line_sol(EC,T_Staying_time_1,T_Staying_time_2,temp_tc1,temp_tc2),[5e13 -6e-1],options) %, Call optimizer

[EC,fval] = fsolve(@(EC) end_line_sol(EC,T_Staying_time_1,T_Staying_time_2,temp_tc1,temp_tc2),EC,options) %, Call optimizer

function Dam_L=end_line_sol(EC,T_Staying_time_1,T_Staying_time_2,temp_tc1,temp_tc2)

Dam_L=[sum(T_Staying_time_1./(EC(1)*exp(EC(2)*temp_tc1)))-1;

sum(T_Staying_time_2./(EC(1)*exp(EC(2)*temp_tc2)))-1];

But the same program i can do it with ease using MS-Excel solver. But i need to program in matllab..

Vijay

Subject: Excel solver in matlab optimisation

From: Scott Seidman

Date: 24 Jun, 2008 14:04:49

Message: 4 of 7

Vijay <aarvijayanand@aol.com> wrote in
news:1254084.1214306736921.JavaMail.jakarta@nitrogen.mathforum.org:

> Hai everyone,
>
> Am currently working on matlab optimisation toolbox. I am exactly
> looking for a tool which is similar to solver function in MS- Excel
> wherein i can find the set of variables which influence the function
> such that i can minimise my cost function to certain value. (ie) cost
> function should be equal to 1. This is can be done with ease using MS
> excel solver function. But i am struggling to find similar function
> with matlab. I tried using fsolve but am not able to find solution.
>
> Could anyone help me in this regard???
>
> Vijay


fminsearch??


--
Scott
Reverse name to reply

Subject: Excel solver in matlab optimisation

From: Vijay

Date: 25 Jun, 2008 06:48:57

Message: 5 of 7

No fminsearch is not solving the problem Scott...

Subject: Excel solver in matlab optimisation

From: Scott Seidman

Date: 25 Jun, 2008 14:11:32

Message: 6 of 7

Vijay <aarvijayanand@aol.com> wrote in
news:12841851.1214376567644.JavaMail.jakarta@nitrogen.mathforum.org:

> No fminsearch is not solving the problem Scott...

If you want help, you gotta be a bit more specific than that. Try
subtracting 1.0 from your cost function and minimizing the result.

--
Scott
Reverse name to reply

Subject: Excel solver in matlab optimisation

From: vittorio bellini

Date: 4 Aug, 2008 16:19:01

Message: 7 of 7

Dear Vijay,
I've got your same problem. Have you find out how to solve
such "solver" problem? Have you developed some code it
about?
Thanks


Vijay <aarvijayanand@aol.com> wrote in message
<1254084.1214306736921.JavaMail.jakarta@nitrogen.mathforum.
org>...
> Hai everyone,
>
> Am currently working on matlab optimisation toolbox. I
am exactly looking for a tool which is similar to solver
function in MS- Excel wherein i can find the set of
variables which influence the function such that i can
minimise my cost function to certain value. (ie) cost
function should be equal to 1. This is can be done with
ease using MS excel solver function. But i am struggling
to find similar function with matlab. I tried using fsolve
but am not able to find solution.
>
> Could anyone help me in this regard???
>
> Vijay

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
optimization Ned Gulley 26 Jun, 2008 13:21:15
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics