equation-solving

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

Integration of a system of differential equations MATLAB

爱⌒轻易说出口 提交于 2019-12-25 08:57:33
问题 I am a fairly new Matlab user which I had to explore to numerically integrate a system of differential equations. Now I am trying to resolve a simple equation but which gives me a "lambertw" output. (s - 1) * exp(-s) = k Therefore, for a given k, with k < exp(2) I should get approximately two different values of "s". Here is the bit of code I use for this task (using symbolic toolbox): %%Hopf bifurcation calculations syms s solve((s-1) * exp(-s) == k, s) %uhopf = s*k And the output: 1 -

How to take in code from user?

牧云@^-^@ 提交于 2019-12-25 07:16:50
问题 See I want to do this Equation Graph Plotter in Java using Netbeans. I am using Graphics 2D to plot the idividual Points. My Question is is it possible to take in an equation from the user and put it in the code ?? Example : float y=(float) ( Math.sin(x/100)*100); Suppose the user wants to see a cos graph is it possible to type in Math.cos(x/100)*100 and equate it to y ? If not how do I solve this ?? Any Alternate methods Appreciated 来源: https://stackoverflow.com/questions/15881469/how-to

How to take in code from user?

只谈情不闲聊 提交于 2019-12-25 07:16:02
问题 See I want to do this Equation Graph Plotter in Java using Netbeans. I am using Graphics 2D to plot the idividual Points. My Question is is it possible to take in an equation from the user and put it in the code ?? Example : float y=(float) ( Math.sin(x/100)*100); Suppose the user wants to see a cos graph is it possible to type in Math.cos(x/100)*100 and equate it to y ? If not how do I solve this ?? Any Alternate methods Appreciated 来源: https://stackoverflow.com/questions/15881469/how-to

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

Why MATLAB cannot give the correct result of the quartic equation?

拈花ヽ惹草 提交于 2019-12-24 14:00:32
问题 Although the MATLAB owns the built-in solve() to solve the quartic equation, the solve() function gives some error information in some cases. So I write a user-defined function called solveQuartic() to solve the roots of quartic equations. The reference that I find is here MY TRIAL function [res] = solveQuartic(a, b, c, d, e) p = (8*a*c - 3*b^2)/(8*a^2); q = (b^3 - 4*a*b*c + 8^a^2*d)/(8*a^3); delta0 = c^2-3*b*d + 12*a*e; delta1 = 2*c^3 - 9*b*c*d + 27*b^2*e + 27*a*d^2 - 72*a*c*e; Q = ((delta1

Function to translate linear equations into matrix form in R?

五迷三道 提交于 2019-12-23 10:55:06
问题 I was wondering whether there exist any packages or other pre-built solutions for R that are capable of translating sets of linear equations into matrix form (e.g. for solution via the Gauss Seidel algorithm), similar to the equationsToMatrix(eqns,vars) function in Matlab? An example from Matlab: [A, b] = equationsToMatrix([x - y == 0, x + 2*y == 3, [x, y]) A = [ 1, -1] [ 1, 2] b = 0 3 Suggestions for building blocks would be very helpful, too. 回答1: 1) This is not exactly what you are asking

Function to translate linear equations into matrix form in R?

我是研究僧i 提交于 2019-12-23 10:52:56
问题 I was wondering whether there exist any packages or other pre-built solutions for R that are capable of translating sets of linear equations into matrix form (e.g. for solution via the Gauss Seidel algorithm), similar to the equationsToMatrix(eqns,vars) function in Matlab? An example from Matlab: [A, b] = equationsToMatrix([x - y == 0, x + 2*y == 3, [x, y]) A = [ 1, -1] [ 1, 2] b = 0 3 Suggestions for building blocks would be very helpful, too. 回答1: 1) This is not exactly what you are asking

Integral solution to equation `a + bx = c + dy`

a 夏天 提交于 2019-12-23 09:17:16
问题 In the equation a + bx = c + dy , all variables are integers. a , b , c , and d are known. How do I find integral solutions for x and y ? If I'm thinking right, there will be an infinite number of solutions, separated by the lowest common multiple of b and d , but all I need is one solution, and I can calculate the rest. Here's an example: a = 2 b = 3 c = 4 d = 5 a + bx: (2, 5, 8, 11, 14) c + dy: (4, 9, 14, 19, 24) a + bx intersects c + dy at 14, so: x = 4 y = 2 Right now, I'm looping through

Setting up a system of linear equations in matlab

半世苍凉 提交于 2019-12-23 05:46:53
问题 I have the following equation that I want to solve: H*b0 = M(Q+1)b(Q+1)+l+M'B The unknowns are b0, b(q+1) and B . The sizes of the known matrices are: H=(42 x 42) M(Q+1) = (42 x 21-P) l = (42 x 1) M' = (42 x 4) So I want to figure out how to find the vectors. Is there a built in command that I could do to do this? This comes from This paper EDIT:: Size of unknowns should be (all are column vectors): b0 = 21 b(q+1) = 21-P (P=4 in this case) B = P (4 in this case) 回答1: First, rearrange your