solver

Excel VBA: Overflow error from too many undestroyed objects?

安稳与你 提交于 2020-02-05 04:05:34
问题 when performing optimization tasks on a large dataset I receive an overflow runtime error 6 from time to time (generally after 1 hour or 2). The error goes away when I restart my macro from where it stopped, i.e. launch the macro again from the point where the error occured. Could an overflow error be related to some issue of having created too many objects that are not destroyed properly after use? Here's a (simplified version) of my container class, which is used destroyed (via Set ... =

Solve finds wrong solution?

徘徊边缘 提交于 2020-01-07 05:23:46
问题 I have this equation in x and y: (x + y)^(1/2) - 6*y*(x + y)^5 - (x + y)^6 + (x - 1)/(2*(x + y)^(1/2)) = 0. Now I call the solver: R_c = @(y)solve((x + y)^(1/2) - 6*y*(x + y)^5 - (x + y)^6 + (x - 1)/(2*(x + y)^(1/2)), x, 'Real', true); which gives me the implicit solutions as a function of y. Now try R_c(.3) to find the explicit solution at y = 0.3. MATLAB's answer is: ans = 0.42846617518653978966562924618638 0.15249587894102346284238111155954 0.12068186494007759990714181154349 However, the

How do I access and print the complete vector distributed among MPI workers?

廉价感情. 提交于 2020-01-06 19:37:39
问题 How do I access a global vector from an individual thread in MPI? I'm using a library - specifically, an ODE solver library - called CVODE (part of SUNDIALS). The library works with MPI, so that multiple threads are running in parallel. They are all running the same code. Each thread sends the thread "next to" it a piece of data. But I want one of the threads (rank=0) to print out the state of the data at some points. The library includes functions so that each thread can access their own

Solve a pair of coupled nonlinear equations within certain limits

回眸只為那壹抹淺笑 提交于 2020-01-06 16:23:15
问题 This answer to this question works only for situations in which the desired solution to the coupled functions is not restricted to a certain range. But what if, for example, we wanted a solution such that 0 < x < 10 and 0 < y < 10 ? Another way of thinking about this is, what if the coupled functions are undefined when x or y is, e.g., less than zero? There are functions within scipy.optimize that find roots to a function within a given interval (e.g., brentq), but these work only for

how to print output in hexadecimal format

白昼怎懂夜的黑 提交于 2020-01-05 06:42:15
问题 this Boolector program printing output in binary format. But I need in hexadecimal format. so how to print hexdecimal format in boolector. (set-logic QF_BV) (set-info :smt-lib-version 2.0) (declare-const val1 (_ BitVec 16)) (declare-const val2 (_ BitVec 16)) (declare-const gen_mul (_ BitVec 16)) (declare-const eval1 (_ BitVec 32)) (declare-const eval2 (_ BitVec 32)) (declare-const org_mul (_ BitVec 32)) (declare-const rem17 (_ BitVec 32)) (declare-const res (_ BitVec 16)) (assert (= gen_mul

Unexpected result on solving some inequality in Matlab symbolic computation

为君一笑 提交于 2020-01-05 04:09:27
问题 Please consider this example. I would like to solve x^3 - 2x > 0. I try the following commands: syms x; f = @(x) x^3-2*x; solve(f(x)>0,x) and Matlab returns this ans = solve([0.0 < x^3 - 2.0*x], [x]) which is not what I expect. Therefore I use solve(f(x)+x>x,x) which returns ans = Dom::Interval(2^(1/2), Inf) Dom::Interval(-2^(1/2), 0) Can someone explain that why solve works successfully only in the second case? 回答1: Try adding the Real option to solve : solve(f(x)>0,x,'Real',1) ans = Dom:

C++ library for undetermined equation systems [closed]

耗尽温柔 提交于 2020-01-02 04:29:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I have been looking for a library in c++ to solve an undetermined system like this q is a vector, w, x, y, z variables and a,b,c,d constants. argmin_q MAX(q) - MIN(q) s.t. q[1] = a - w - y q[2] = b - w - z q[3] = c - x - y q[4] = d - x - z It would be very useful to find a solver, algorithm, etc. I found a

sympy hangs when trying to solve a simple algebraic equation

二次信任 提交于 2019-12-31 02:14:15
问题 I recently reinstalled my python environment and a code that used to work very quickly now creeps at best (usually just hangs taking up more and more memory). The point at which the code hangs is: solve(exp(-alpha * x**2) - 0.01, alpha) I've been able to reproduce this problem with a fresh IPython 0.13.1 session: In [1]: from sympy import solve, Symbol, exp In [2]: x = 14.7296138519 In [3]: alpha = Symbol('alpha', real=True) In [4]: solve(exp(-alpha * x**2) - 0.01, alpha) this works for

Why is an empty list returned when solving for this linear system in Maxima?

房东的猫 提交于 2019-12-24 19:38:35
问题 I'm trying to solve a simple linear system in Maxima using solve like so: /*Standard form*/ eq1 : x1 + 3*x2 + s1 = 6; eq2 : 3*x1 + 2*x2 + s2 = 6; base1 : solve([eq1,eq2],[s1,s2]); This however returns an empty list and I don't know why. Any ideas? I'm pretty sure the system has a solution, so that shouldn't be the issue. EDIT: I attempted to insert the equations explicitly into solve in place of eq1 and eq2 , and now it works. Now the question is, why do I need to explicitly insert the

Solving ODE with Simulink in Matlab

半城伤御伤魂 提交于 2019-12-24 03:07:56
问题 I need to solve this ODE using Simulink and I don't know how to make it. I only know how to do it using ODE solvers. y'' - y' - 2y = e^(3x) y(0)=1, y'(0)=2. I rewrote the equation obtaining an ODEs: y' = f(x,y) y(x0) = y0 y'1 = y2 y2= e^(3*x) + y' + 2y Using ODE solver. If someone can help me to solve this using a Simulink Model I would appreciate it. I know how to solve it in Matlab using ODE solvers as ode23 and ode23s but I don't know how to do it using a Simulink Model. Thanks in advance