Comments on: Programming https://opensolver.org The Open Source Optimization Solver for Excel Tue, 14 Jun 2022 22:04:05 +0000 hourly 1 By: Andrew Mason (Team OpenSolver) https://opensolver.org/excel-programming/comment-page-2/#comment-501695 Tue, 14 Jun 2022 22:04:05 +0000 http://opensolver.org#comment-501695 In reply to Paolo.

Thanks for the quick reply. Andrew

]]>
By: Paolo https://opensolver.org/excel-programming/comment-page-2/#comment-501689 Tue, 14 Jun 2022 21:55:33 +0000 http://opensolver.org#comment-501689 if there are a lot of if statements the problem is non linear.. the only open solver engine that goes around this is nomad, but the number of variables it can handle (before degrading performance) is limited.

]]>
By: michele vietri https://opensolver.org/excel-programming/comment-page-2/#comment-399285 Thu, 03 Dec 2020 08:50:53 +0000 http://opensolver.org#comment-399285 Hi all, very interesting site!! I have a question, because I’m not so expert in all these tools. I have a huge excel with many formulas (few thousands of variables), in some cells (as variables) we have some binary entries and some integer , on other different cells calculated through excel formulas and on the variables we have the constraints. Most of the excel functions are not linear (“IF”, etc.). I tried to use bonmin and couenne but I have problems with the parsing. I changed many formulas (avoiding volatiles) and it went on and stopped again and finally I realize that also “IF” with arguments is a problem and I have many of them. Have you any suggestion for me to use the Opensolver?
Thanks a lot!!
Michele

]]>
By: Saad https://opensolver.org/excel-programming/comment-page-1/#comment-298288 Fri, 14 Dec 2018 21:39:12 +0000 http://opensolver.org#comment-298288 Hi,

I am trying to build a solver model using VBA, so far I have been able to set the objectives, variables and constraints but I am having trouble with the sensitivity analysis. I would like to have a sensitivity analysis on another sheet and would greatly appreciate it if someone could help me out here.
Here is what I have coded so far

Sub Model_Creation()

Dim TestSheet As Worksheet
Set TestSheet = Sheets(“Sheet4”)

OpenSolver.ResetModel Sheet:=TestSheet

‘Objective Definition
OpenSolver.SetObjectiveFunctionCell TestSheet.Cells(39, 13), Sheet:=TestSheet
OpenSolver.SetObjectiveSense MaximiseObjective, Sheet:=TestSheet

‘Variables Definition
OpenSolver.SetDecisionVariables TestSheet.Range(Cells(4, 2), Cells(38, 10)), Sheet:=TestSheet

‘Constraints Definition
OpenSolver.AddConstraint TestSheet.Range(Cells(4, 2), Cells(38, 10)), RelationLE, TestSheet.Range(Cells(42, 4), Cells(76, 12)), Sheet:=TestSheet
OpenSolver.AddConstraint TestSheet.Range(Cells(4, 11), Cells(38, 11)), RelationLE, TestSheet.Range(Cells(4, 12), Cells(38, 12)), Sheet:=TestSheet

End Sub

Thank you in advance for the assistance.

]]>
By: Jack Dunn (Team OpenSolver) https://opensolver.org/excel-programming/comment-page-1/#comment-281505 Tue, 07 Mar 2017 14:49:22 +0000 http://opensolver.org#comment-281505 In reply to Jack Dunn (Team OpenSolver).

Just a note to future readers, this was added as a feature in version 2.8.5: http://opensolver.org/opensolver-2-8-5/

]]>
By: OpenSolver 2.8.5 (3 Nov 2016) – OpenSolver for Excel https://opensolver.org/excel-programming/comment-page-1/#comment-278538 Thu, 03 Nov 2016 00:10:19 +0000 http://opensolver.org#comment-278538 […] work with OpenSolver. Another example comes from Judd Larson at the University of Wyoming. Judd’s problem involved optimizing a function that depended on the solution to a series of differential […]

]]>
By: Jack Dunn (Team OpenSolver) https://opensolver.org/excel-programming/comment-page-1/#comment-278506 Sun, 30 Oct 2016 14:44:28 +0000 http://opensolver.org#comment-278506 In reply to Judd Larson.

If I’m understanding correctly, you need to run a macro after every change to the variable cells in order to update the objective/constraint cells, correct? This is something that is theoretically possible to do with the NOMAD solver in OpenSolver (but not the others). This feature is on our todo list but we haven’t added it yet because we haven’t settled on the best UI for such a feature.

It only takes a very simple 2-line modification to the OpenSolver code to achieve what you want, so email me (email hidden; JavaScript is required) if you are interested in trying it out and I can walk you through the modification that you need to make.

]]>
By: Jack Dunn (Team OpenSolver) https://opensolver.org/excel-programming/comment-page-1/#comment-278503 Sun, 30 Oct 2016 14:34:38 +0000 http://opensolver.org#comment-278503 In reply to Lucas Rodrigues.

This sounds odd – it should be working since we do a lot of our testing via VBA and solve hundreds of models in VBA loops. I’ll look into it if you send me a copy of the sheet along with your version information (copy everything in the About OpenSolver page) to email hidden; JavaScript is required

]]>
By: Judd Larson https://opensolver.org/excel-programming/comment-page-1/#comment-278495 Sat, 29 Oct 2016 08:52:21 +0000 http://opensolver.org#comment-278495 I’m re-purposing an old Classic 4th-Order Runge-Kutta (RK4) subroutine I wrote in 2002 to integrate a series of ordinary differential equations (ODEs). I’m trying to reverse model via Solver microbial kinetic constants within a series of ODEs (Ks, km, X, etc.) (by minimizing an objective sum of square residual between my model and measured data by changing kinetic constants with constraints applied). My RK4 subroutine seems to solve the the series of ODEs successfully. However, I need to be able to run (i.e., Call) my RK4 subroutine every time Solver changes my kinetic constants so that my model output is updated, thus updating my objective sum of square residual cell (or internal value), so that Solver can “see” a change in the Objective cell from changing the “Changing” variables. Is there a way to call my RK4 subroutine every time Solver updates my “changing” cells? Thanks so much! If interested I can send you my code and excel file.

]]>
By: Lucas Rodrigues https://opensolver.org/excel-programming/comment-page-1/#comment-278483 Fri, 28 Oct 2016 11:02:22 +0000 http://opensolver.org#comment-278483 Hi.

I have an issue with opensolver: I set the objective cell, the variable cells and the constraints all via VBA, then I run it and get the results. After that I change all those parameters, still in the same loop on VBA.

The second running gives me the error “no solver model with decision variables was found on the sheet”. If I check the model, however, it is there and correct. If I debug and stop the code right after the first running and manually start it again, it works too.

The problem only happens if I let it run all at once. I have tried the same code with the native solver and it runs fine. Any ideas?

Thanks for the attention.

]]>