sympy Questions

3

As we know from sympy import * x = sin(pi/4) y = sin(pi/5) A = Matrix([x, y]) print(x) print(A.evalf()) displays sqrt(2)/2 Matrix([[0.707106781186548], [0.587785252292473]]) So print(roun...
Carotid asked 19/12, 2018 at 5:5

6

I would like to know how to do dot multiplication cross multiplication add/sub of vectors with the sympy library. I have tried looking into the official documentation but I have had no luck or...
Spatz asked 2/3, 2014 at 9:56

2

Solved

I've been doing derivatives in sympy, and I didn't know how that would syntactically be written. I tried looking it up, but none of the solutions made sense. For example, if I'm trying to different...
Rudich asked 17/2, 2016 at 5:59

3

Solved

I am new to SymPy, and I can't figure out from sympy.core import S What is S actually? And what does S.true mean?
Birefringence asked 25/1, 2017 at 19:43

1

Solved

I'm trying to compose two functions and I get a bizzare result ''' #!/usr/bin/python from sympy import * init_printing(use_unicode=True) x= symbols('x') f = x/(x+1); g = x/(x+2); print(compose(f,g)...
Aramanta asked 19/9, 2022 at 21:19

2

Solved

I want to do something like h = f(g(x)) and be able to differentiate h, like h.diff(x). For just one function like h = cos(x) this is in fact possible and the documentation makes it clear. But fo...
Vida asked 4/6, 2015 at 7:18

3

Solved

I'm trying to code various optimisation methods, as a way of revising. I want to be able to use SymPy to evaluate a function with an arbitrary number of variables at a given point, where the co-ord...
Silvery asked 18/3, 2013 at 13:49

2

Solved

I want to use python interpolate polynomial on points from a finite-field and get a polynomial with coefficients in that field. Currently I'm trying to use SymPy and specifically interpolate (from...
Voidance asked 2/1, 2018 at 17:33

3

Solved

Consider two functions of SymPy symbols e and i: from sympy import Symbol, expand, Order i = Symbol('i') e = Symbol('e') f = (i**3 + i**2 + i + 1) g = (e**3 + e**2 + e + 1) z = expand(f*g) This ...
Xerosere asked 29/8, 2017 at 14:54

3

Solved

I am hoping to use PyQt to produce an application that will display an equation entered by the user. I had considered matplotlib, but this seems like overkill as I would only be using it to render ...
Sentimentalism asked 10/10, 2010 at 20:17

3

Solved

I'm using Sympy to substiture a set of expressions for another using the Subs function, and I would like for the program not to rearrage or simplify the equations. i.e if i were substituting x+y fo...
Inquisitor asked 4/6, 2013 at 15:14

5

Solved

Is there a way to check if two expressions are mathematically equal? I expected tg(x)cos(x) == sin(x) to output True, but it outputs False. Is there a way to make such comparisons with sympy? Anoth...
Ozzy asked 9/5, 2016 at 9:56

3

Solved

I am trying to solve a set of equations using the following python code (using SymPy of course): def Solve(kp1, kp2): a, b, d, e, f = S('a b d e f'.split()) equations = [ Eq(a+b, 2.6), Eq(2*a ...
Sexuality asked 13/4, 2015 at 14:42

3

Is it possible to do from matrix_multiply_elementwise in sympy library with more than two matrices? Or any other way for multiplying couple of matrices elementwise? p.s. In numpy it is straightfo...
Anthonyanthophore asked 9/8, 2017 at 10:59

2

Solved

I am using numpy and want to compute the covariance matrix for an ndarray. I am trying to use numpy.cov() but am not getting the correct results. More details below. My ndarray is 768x8 for where...
Narration asked 2/4, 2017 at 23:25

1

Solved

I declare a variable, define an expression using the variable from sympy import * x = symbols ('x') f = 2 * x and then assign a value to the variable x = 42 How can I substitute the variable in ...
Roderic asked 25/3, 2022 at 9:57

1

I have a problem with sympy where it won't update my values. So I'm trying to do an iterative method for solving $\sigma_x$ and when I try to put numerical values into my expression it won't update...
Yahairayahata asked 23/3, 2022 at 13:9

2

Is it possible to manipulate statistical expressions in SymPy without specifying the distributions of random variables? For example, I would like to work with two random variables, X and Y, and be...
Hopehopeful asked 23/11, 2015 at 18:10

3

Solved

I have problems by solving a polynomial function with sympy. The following example shows a case which gives an error message that I cannot manage. If the polynomial gets simpler the solver works pr...
Nunhood asked 29/3, 2016 at 14:11

1

I am using SymPy and the scientific mode of PyCharm for symbolic calculations. I would like to display latex code for printed out expressions in the integrated console. Using qtconsole this works...
Befoul asked 6/1, 2020 at 23:48

8

Solved

I am looking for a way to do a plus/minus operation in python 2 or 3. I do not know the command or operator, and I cannot find a command or operator to do this. Am I missing something?
Raven asked 10/1, 2015 at 2:27

2

Solved

In sympy, how do I declare a Piecewise function with multiple limits for multiple variables in a sub-function? Here is my context and attempt: from sympy import Piecewise, Symbol, exp from sympy....
Suzannasuzanne asked 19/8, 2016 at 2:27

2

Solved

I am new to sympy but I already get a nice output when I plot the implicit function (actually the formula for Cassini's ovals) using sympy: from sympy import plot_implicit, symbols, Eq, solve x, y...
Throstle asked 31/7, 2015 at 13:20

7

Solved

I`m creating a script in Python Sympy library and trying to access the result returned by solveset() and linsolve() functions. My problem is that the object returned by these functions is of type f...
Unmask asked 17/7, 2016 at 5:33

5

Solved

I have some data I want to fit using a Fourier series of 2nd, 3rd, or 4th degree. While this question and answer on stack overflow gets close to what I want to do using scipy, they already pre-def...
Fleuron asked 26/9, 2018 at 19:34

© 2022 - 2025 — McMap. All rights reserved.