I am learning rigid body kinematics from: https://rotations.berkeley.edu/the-poisson-top-with-friction/ . The link to the matlab source code is at the bottom of the page. Derive the Poisson top’s equations of motion: http://rotations.berkeley.edu/wp-content/uploads/2017/10/derive_poisson_top_ODEs.txt Solve the Poisson top’s equations of motion: http://rotations.berkeley.edu/wp-content/uploads/2017/10/solve_poisson_top_ODEs.txt I rewrote most of the code for the derivation process in python, though may not be elegant code. In fact, it
Tag: sympy
Graphing Inequalities in python
I’m looking to create a program that will randomly generate lines (that are inequalities) and that will show the area that satisfies the constraints. I don’t mind which libraries are used so feel free to use sympy, numpy etc I will show my current code but this just fills the area between 2 lines and doesn’t use inequalities at all.
How might I find an approximate solution to this equation?
The following code is meant to find for how much Bitcoin one is meant to buy in order to break even given the expected inflation, the holding period, and the amount of savings in dollars: When the program is fed with years=3, times=4, cpi=8, and a=1000 it does not find a solution. Because of it I introduced a loop that
Trying to simplify a stubborn expression in SymPy – complex exponential / trigonometric space vector equation
I am trying to simplify which I know reduces down to 1.5e^(I*phi) I cannot get SymPy to recognize this. I have tried simplify, trigsimp, expand, etc. But nothing seems to work. Any suggestions? Here is my code: None of these produce the expected result. I can confirm my result manually, by substituting values in for phi like this: Answer It’s
SymPy returns wrong solution of a nonlinear ODE?
I am trying to solve the ODE of the frictional free fall: I think the solution might be wrong. I believe it should be the reciprocal of the returned expression. Therefore, if I try to find the value of the constant for an initial condition of rest (v(0) = 0), I get no real solutions: As a consequence, if I
SymPy lambdify gives wrong result, while *.subs gives the accruate one
Sorry for bothering you with this. I have a serious issue and now im on clock to solve it, so here is my question. I have an issue where I lambdify a quantity, but the result of the quantity differs from the “.subs” result, and sometimes it’s way off, or it’s a NaN, where in reality there is a real
What is the difference between (matplotlib) and (SymPy Plotting Module)?
https://scicomp.stackexchange.com/questions/1144/how-can-i-plot-piece-wise-defined-function-in-some-easily-accessed-open-source-t ①Why is it that the above source code can be used to create a plot, but the following source code cannot? ②Can you point me to a web site that has a table comparing (matplotlib) and (SymPy Plotting Module)? ③(matplotlib) to (SymPy Plotting Module) converter and a (SymPy Plotting Module) to (matplotlib) converter would be helpful. Answer ①Why is it
sympy matplolib piecewise TypeError?
matplotlib TypeError? Please tell me the difference. i want to use plt.plot OK Error.why? raise TypeError(“can’t convert expression to float”) TypeError: can’t convert expression to float (ref) Sympy issues with plotting a piecewise function sympy piecewise:How can I plot a piecewise function using matplotlib? (20220315) Answer Matplotlib expects arrays of points rather than symbolic expressions. SymPy’s plot function is designed
UFuncTypeError: Cannot cast ufunc ‘det’ input from dtype(‘O’) to dtype(‘float64’) with casting rule ‘same_kind’? How to avoid this issue?
I’m trying to build a PDE in python. I’m new to this and wondering where I have gone wrong. Would appreciate some help. I understand that I have a python object and I’m trying to cast it to a float64 but is there any way around this? Here is my error Here is my code Answer A symbolic calculation like
Sympy calculation on tan function
I have a problem when simplifying a symbolic expression in sympy when having a trigonometric function and a complex exponent, namely I just assumed a different definition of tan function, and I have a weird thing going on. So I do: Symbolic variable sym.simplify(test2) is equal to -tan(a) and normaly test1 variable should be equal to 0, however when I