0
$\begingroup$

I have never learnt to use the services (I have them though) but now I was given a massive amount of equations and I cannot really handle them without some solver tool, just plug equations and constraits and you get solution.

Please, post here how you solve things with so-called solvers? I will accept the answer which I believe will help most peole like me gettin no head-or-tail about "solvers".

Example 1.

$ \begin{cases} 0.5=B+A(1-e^{\frac{-2}{r}}) \\ 1 = B + A(1-e^{\frac{-3}{r}}) \\ 0 = B, \end{cases} $

where $A$, $B$ and $r$ are some constants.

Example 2.

A decision making problem, some functions are linear like 1/4/5/6/7 while some are defined step-wise, some non-linear etc. Anyway a huge amount of different restrictions not realyl hard but good for computer brains. The N in upper index means normalization. The lower indices for $V$ just mean different functions.

$ \begin{cases} V_{5}^{N}(k)=\frac{50}{40}V^{N}_{5}=\frac{50}{35} V^{N}_{4} \\ V^{N}_{8}(1) = V^{N}_{4}(x+10)+V^{N}_{4}(x), x \in[2,10] \\ V_{7}^{N}(x+1) -V_{7}^{N}(x) = V_{4}^{N}(y+1)-V_{4}^{N}(y), x \in [0,99], y \in [2,19] \\ 1 = (V^{N}_{2}(30)-V^{N}_{2}(0)) +(V^{N}_{3}(20) -V^{N}_{3}(2)) \\ V^{N}_{1}(0)=0, V^{N}_{1}(40)=1 \\ V^{N}_{2}(0)=0, V^{N}_{2}(30)=1 \\ V^{N}_{3}(2)=0, V^{N}_{3}(30)=1 \\ V^{N}_{4}(2)=0, V^{N}_{4}(20)=1 \\ V^{N}_{5}(0)=0, V^{N}_{5}(20)=1 \\ V^{N}_{6}(2)=0, V^{N}_{6}(20)=1 \\ V^{N}_{7}(0)=0, V^{N}_{7}(100)=1 \\ V^{N}_{8}(0)=0, V^{N}_{8}(100)=1 \\ V^{N}_{9}(100)=0, V^{N}_{9}(0)=1 \\ \end{cases} $

...in this example, there are many more restrictions so I am struggling to solve it. I am looking for a solution in which I just introduce the equations and restrictions -- and then get the solution.

  • 1
    For MATLAB, you can find information on solving systems of equations here: http://www.mathworks.com/help/toolbox/symbolic/solve.html . Examples are also included.2011-10-12

1 Answers 1

1

Here is Mathematica's command to find real solutions for example 1:

Solve[{1/2 == b + a (1 - Exp[-2/r]),    1 == b + a (1 - Exp[-3/r]), b == 0}, {a, b, r}, Reals] 

enter image description here

  • 0
    any idea whether some Python pkg has solvers like Mathematica? I tend to do most of issues with Numpy/Scipy/Python, only in campus I can run the others.2011-10-12