1,711 questions
3
votes
3
answers
843
views
Error while loading conda entry point: codad-libmamba-solver
Complete newbie to linux and all that stuff, so please bear with me. Installed Linux Mint in a dual boot system with windows 11 today, so that i can code with VSCodium on Linux and still keep my ...
2
votes
1
answer
113
views
Excel VBA to Write SWCC Equation
I'm tring to make Satayanaga's best fit equation for unimodal 2017 to VBA, because I keep having problem with Excel's solver if I put the equation straight to the cell.
I'm trying with this. But I'm ...
0
votes
0
answers
95
views
Microsoft Solver Foundation giving wild result for a simple problem
I'm using Microsoft Solver Foundation to minimize chi-square between two distributions. Usually there are multiple peaks in each distribution but occasionally there is just one. I'm noticing in that ...
2
votes
1
answer
108
views
Issue with sympy solver, giving different results based off order
So, I have noticed when I switch the order of the symbols to be solved in the sympy.solve I get slightly different results.
My code:
from sympy.solvers import solve
import sympy as sy
r=sy.Symbol('r')...
0
votes
1
answer
41
views
SMT-LIB Error ((error "Parse Error: output.smt:37.36: Symbol '->' not declared as a type"))
I am coding in SMT-LIB langage and I am using -> but I got an error that is not defined :
(define-sort |? Z| () (-> |Z| Bool))
(declare-const |set.intent Z| (-> |? Z| |POW Z|))
(assert (! (...
1
vote
0
answers
106
views
How to reduce the number of cores Gurobi solver uses
I am using Pyomo with Gurobi solver.
gurobipy==11.0.2
Pyomo==6.7.3
The error is:
gurobipy.GurobiError: Requested number of cores (12) is greater than allowed (8) cores
I have tried:
echo "...
0
votes
1
answer
65
views
I have a not declared smt-lib issue
I have an issue with my SMT code. I'm using SMT-LIB 2.7 syntax, and executing it with a 2.6 solver (CVC4).
Here is my code:
(set-option :print-success false)
(set-logic ALL)
(define-sort |Z| () Int)
(...
1
vote
2
answers
121
views
Using SymPy to find equation system solutions in specified variables valid for all values of remaining variables
Is there a standard way to implement sympy.solve to solve a system of equations with respect to a specified subset of free symbols (i.e. sympy.core.symbol.Symbol instances), such that it only finds ...
1
vote
1
answer
133
views
How to solve an equation with symbolic variable?
I have the following simple script in Octave :
pkg load symbolic
syms a
P=[[a 2 -1];[2 sym('-3/2') sym('1/2')];[-2 0 sym('1/2')]]
M=[3 4 2;8 10 6;12 16 10]
P*M
Resulting in:
[3*a + 4 4*a + 4 2*...
0
votes
0
answers
33
views
How to implement conditions on choco-solver?
I'm reading this paper:
https://hal.science/hal-01092574/
They use CP programing to find diferential characteristic for AES cipher.
I am curious to know how we can implement this functionality using ...
1
vote
1
answer
63
views
Solving a PDE backwards with FiPy
I'm trying to simulate the dynamic behaviour of the granular flow inside a rotary kiln. The PDE describing it was derived by Descoins (2005) and it is expressed as follows:
The original equation (...
0
votes
2
answers
193
views
Disabling Crossover using HiGHS Solver and Linopy
I have implemented a linear programme using Linopy and use the HiGHS solver to solve it with the interior point method.
For this application, I don't need to run crossover on the solution. When I pass ...
0
votes
0
answers
169
views
Pyomo + HiGHS: Solution values sometimes change after loading the results
I am using Pyomo with the HiGHS solver to optimize a model. The problem I am facing is that, after solving the model and loading the solution using model.solutions.load_from(opt_results), the values ...
2
votes
0
answers
97
views
Optimizing Assembly Code with Z3 Solver While Handling Unknown Initial CPU State
I'm working on building a simple assembly optimizer.
I was thinking about using Z3 to find shorter sequences of instructions with the same overall effect on a CPU state.
The idea is to take an ...
0
votes
1
answer
132
views
Using Capsolver TwoCaptcher does not work (Java)
I try to solve a captcher from the following standard homepage:
https://google.com/recaptcha/api2/demo
For that I am using the following code:
String apiKey = "CAP-XXX";
...
2
votes
1
answer
85
views
Time only parts of programs of various languages
I am having a competition with a group of students where the goal is to solve N sudoku boards in the shortest amount of time. I am looking to automate the running and timing of programs by letting ...
2
votes
0
answers
179
views
Apptainer build problem with Library of iterative solver - Quad precision is not enabled
Im trying to build a container (with apptainer) that contains a build of the the LIS library. Here is my script:
Bootstrap: docker
From: ubuntu:22.04
%environment
export INTEL_MPI_DIR="/tmp/...
0
votes
0
answers
61
views
How can I modify this Lights Out solver algorithm to account for an arbitrary number of missing tiles?
My code: https://jsfiddle.net/03t2wdrq/
// based on https://www.keithschwarz.com/interesting/code/?dir=lights-out
var puzzle = [];
var toggle = [];
var solution = [];
// initialize toggle matrix ...
3
votes
1
answer
74
views
GEKKO - python: if conditions
I tried using the python library of Gekko to simulate a solver. I need to use a large number of if conditions, for which I have used the if2 and if3 provided by Gekko. I understand that m.if2 or m.if3 ...
0
votes
0
answers
64
views
Struggling to Configure Solvers for MINLP Optimization with Pyomo (using NEOS or Local Installation)
I'm working on a Mixed-Integer Nonlinear Programming (MINLP) optimization problem using Pyomo in Python, but I'm having trouble installing and configuring solvers.
I've tried both installing solvers ...
0
votes
2
answers
86
views
Fluid Mechanic Python Solve 4 equations 4 unknown variable
I am solving a fluid mechanic problem where the flow rate is to be determined.
I have the following sets of 4 eqs with 4 unknown variables (v, dot_v, Re,f):
v = dot_v / 0.0113
Re = v* 0.12 / 1.10**-6
...
0
votes
2
answers
91
views
MiniZinc: syntax error: syntax error, unexpected [, expecting end of file
I am trying to solve a puzzle for my sporting event in which i want to equally place all matchups that variate enough without playing the sport more than twice (14 games per team in total) and also as ...
1
vote
1
answer
112
views
Pyomo not respecting constraint
I'm having a problem and I'm hoping you could help me.
I have a constraint such as follows:
def grid_power_calculation_with_balance(model, t):
if t == 0:
return model.P_grid[t] == 0
...
0
votes
1
answer
41
views
Making btSequentialImpulseConstraintSolver deterministic in Ammo.js
I read in a pdf by Shahin Rabbani that in order to make everything in Ammo.js deterministic, in particular I should “make sure the following flags in btSolverMode in btContactSolverInfo.h are cleared:
...
0
votes
1
answer
41
views
Can a constraint solver handle constraints that are nested logical clauses?
I have a typical constraint problem:
For 10 variables x_1,x_2,... x_10 find an assignment of values to variables, where values come from the domain [1,2...1000].
However, my constraints are nested ...
0
votes
1
answer
93
views
How to use Pyomo for adding constraints on the output of a function
I am currently working on developing a specialized solver aimed at tuning the hyperparameters of a SARIMAX (Seasonal Autoregressive Integrated Moving Average with eXogenous regressors) model. The ...
0
votes
1
answer
68
views
sympy.solve never returns for certain coefficients
The form of the expression (corresponding the the variable called 'expression' below) whose critical points I'm trying to solve for is identical in all cases since the only thing that is changing ...
1
vote
1
answer
99
views
Using Excel, return 1 for all values >0 WITHOUT using an IF
Working on a covering problem using solver in Excel. I have a matrix of adjacent cells, and a set of binary decision variables. I can use sumproduct() across the decision variables and each row of ...
1
vote
0
answers
40
views
Solving power law parameters from known and unknown variable values
In the following code I am trying to solve the power law model.
I have only one known value for k and three known values for E. Thus I am guessing the lower and upper bound values of k.
I would like ...
2
votes
1
answer
115
views
Why might sympy.solve succeed with respect to fewer variables but fail w.r.t. more variables?
This question concerns surprising behavior from the sympy.solve function applied to systems of equations. The behavior seems almost like a bug, or at least an edge case for which the sympy.solve ...
0
votes
1
answer
107
views
Solve a Vector Polynomial Equation
So I am trying to symbolically solve a polynomial equation in mathematica that is described with vectors:
A = {Subscript[a, 0], Subscript[a, 1], Subscript[a, 2]}
B = {Subscript[b, 0], Subscript[b, 1], ...
0
votes
2
answers
212
views
LP Solver; Setting up model constraints for large number of chained dependency variables is slow
Creating the model is too slow. Solving it is not the problem here.
I have looked at a few similar questions before, but they don't have the problem from the size that I am giving it.
The constraint ...
0
votes
1
answer
93
views
How can I set my solver in Excel to find the closest result to a certain value?
`Sub Leagues_Solver()
Dim i As Integer
For i = 0 To 30
' Leagues_Solver Macro
'Reset Solver
SolverReset
mytarget = Range("$A$1").Offset(i, 0)
'
SolverOk SetCell:=Sheets("...
2
votes
0
answers
77
views
delay block: total pivoting and singular matrix problem
I am working on a larger model in OpenModelica and I keep getting this error:
Failed to solve linear system of equations (no. 5) at time 0.000000, system is singular for U[2, 2].
The default linear ...
0
votes
0
answers
50
views
OpenModelica "linear system solver failed" when using OMPython with ModelicaSystem
I made a model of a cardiovascular system with OpenModelica. The model is very complex so I can't post it all here.
If I run the model from the terminal or using OMCSessionZMQ (like shown below) there ...
0
votes
1
answer
95
views
Using solve_ivp inside root or fsolve gives ValueError: setting an array element with a sequence
I need to solve a system of equations with a certain parameter p, and then I need to find the value of p that gives me the desired results. My code looks like (in a simplified version)
import numpy as ...
3
votes
2
answers
623
views
Using a CP sat solver, I want to use 2 conditions in an "OnlyEnforceIf" but can't find how
I am using a CP-sat solver by google or tools and I am adding some constraints to my variables.
There is a constraints that should be enforce if 2 bool variables are True. However I can't manage to ...
0
votes
2
answers
186
views
Is there a way to optimize parameter substitution in an equation for faster computation in C++
I've a set of equations which take vector inputs and return solution for different time steps. There are a few parameters in the equations which are received during runtime and stay constant for that ...
-1
votes
1
answer
115
views
Setting priorities in Excel Solver
Excel Solver (https://i.sstatic.net/ZLQyOB9m.png)
Hello everyone, right now I am working on a Solver in Excel. Now, I am trying to find a solution for below problem:
SOLVER FUNCTION: To select a ...
1
vote
0
answers
105
views
Issue with calling Knitro
I use pyomo to formulate my problem and then use ampl to call knitro to solve my problem, as show in code below:
self.solver_pyo = pyo.SolverFactory(modules.find(“Knitro”), solve_io = “nl”)
My ...
0
votes
1
answer
92
views
If, Then, ElseIf statement solves (using solver) for two of my criteria and returns, but will not solve for the third. No error messages either
I am trying to use VBA to solve for a variable to get three different returns: 10%, 16%, Breakeven. I have to use solver to avoid circular references, but I have 5 different scenarios to solve for all ...
0
votes
0
answers
55
views
Using Solver in VBA
I am trying to create a function which uses the Solver but I am getting a runtime error 438 method range of object worksheet failed. Please see code below:
Function DepreciationProfilingMethod(WS As ...
-1
votes
2
answers
280
views
How to acitvate Gurobi in Opensolver Excel
I am a student using OpenSolver in Excel on a Mac for my project, and I have obtained a student license for Gurobi. However, I am encountering an issue with installing and activating Gurobi in ...
0
votes
1
answer
153
views
Pyomo does not optimize
I am really new in the pyomo. But it is not looking so comlicated and still I am not sure where is the error. The following optimizer is just an example and it does not reach a solution. The iteration ...
3
votes
1
answer
108
views
Specify Mass Matrix in ode45() MATLAB
I have the following nonlinear system and accompanying ODE:
My solution in MATLAB:
% Solving with ODE45
dt = 10^-1; % [s]
T = 100; % [s]
N = 2; % number of masses
X_0 = zeros(2*N,1);
t_span = [0:dt:T];...
0
votes
1
answer
120
views
Linear Regression Function in R with a Constrained (ie Bounded) variable and Binary Variables
I am running a linear regression with 3 independent variables of which 2 are continuous and one is binary representing a holiday. In 7th grade language it would look like
log(Unit_Sales) ~ Intercept + ...
0
votes
0
answers
132
views
How to Properly Integrate OpenSolver Add-In with VBA in Excel on MacOS?
I'm trying to integrate the OpenSolver add-in with my VBA code in Excel on MacOS. My goal is to use OpenSolver to solve a traveling salesperson problem (TSP). However, I'm running into several issues ...
0
votes
0
answers
108
views
Show current gap while logging in AMPL+CBC solver
I'm trying using CBC instead the old dog CPLEX in my project to solve a large MILP problem. I would like to get the current gap as it's showed in CPLEX log but in the showed CBC messages.
CPLEX ...
2
votes
1
answer
319
views
Getting OSError: [Errno 86] Bad CPU type in executable when using PuLP CBC solver
I am trying to use the following Python package on M3 Max Mac: pydfs_lineup_optimizer.
I am using Python 3.12.2.
However, I am getting the following error:
Traceback (most recent call last):
File &...
0
votes
0
answers
78
views
VBA Solver which includes formula for "SetCell" variable & Uses Arrays & Loop?
I would like to create a VBA code which,
a. Includes a formula within the code for the variable which is referenced in the SetCell section of the Solver Function (this is what am looking to maximize).
...