equation-solving

NotImplementedError: Initial conditions produced too many solutions for constants [SymPy]

NotImplementedError: Initial conditions produced too many solutions for constants [SymPy] Question: I attempted to solve this differential equation by adapting the code found here. import sympy as sp t = sp.symbols(‘t’, real=True) x = sp.Function(‘x’, real=True) diffeq = sp.Eq(x(t).diff(t), sp.sqrt(1 – x(t)**2)) res = sp.dsolve(diffeq, ics={x(0): 0}) The math.se post suggests that a piecewise function …

Total answers: 1

Python Sympy : Why can't it find the root of the equation

Python Sympy : Why can't it find the root of the equation Question: I am trying to find the real root of the 5th degree equation shown below. As a result of the solution, there are 4 imaginary and 1 real root, but I found this solution in a different way. I couldn’t get it …

Total answers: 2

Solving a linear system of equations

Solving a linear system of equations Question: I am working on using the finite element method to calculate heat flow through elements. I’m currently stuck on solving a system of equations where there is variables on both side of the equality. A simple example could be something like this | 1 -1 0| |100 | …

Total answers: 2

Find common tangent line between two cubic curves

Find common tangent line between two cubic curves Question: Given two functions, I would like to sort out the common tangent for both curves: The slope of the common tangent can be obtained by the following: slope of common tangent = (f(x1) – g(x2)) / (x1 – x2) = f'(x1) = g'(x2) So that in …

Total answers: 3

Python – Sympy – Solving equations numerically for multiple parameters in a grid

Python – Sympy – Solving equations numerically for multiple parameters in a grid Question: A given equation depends on an unknown variable (y) and a set of parameters. I would like to numerically solve for y, given each element of a grid with values of the parameters. A simplified example of my attempted solution is …

Total answers: 2

Solving 5 Linear Equations in Python

Solving 5 Linear Equations in Python Question: I’ve tried using matrices, and it has failed. I’ve looked at external modules and external programs, but none of it has worked. If someone could share some tips or code that would be helpful, thanks. Asked By: JShoe || Source Answers: I’m not sure what you mean when …

Total answers: 3

SymPy – Arbitrary number of Symbols

SymPy – Arbitrary number of Symbols Question: I am coding a function that solves an arbitrary number of simultaneous equations. The number of equations is set by one of the parameters of the function and each equation is built from a number of symbols – as many symbols as there are equations. This means that …

Total answers: 7