/r/sagemath
This is a subreddit for links and general discussions about the Sage Mathematical Software System.
You can find the documentation for Sage here.
If you are looking for answers to specific questions related to Sage usage, please go to Ask Sagemath.
/r/sagemath
Let's look back at some memorable moments and interesting insights from last year.
Your top 6 posts:
I have a sparse Graph on ~40 nodes. Still the weighted tsp seems to run for ever. Any hints? Here's my code.
I am relatively new to Sage but after reading the documentation I am unsure what's the best way to proceed when defining new algebraic structures. Is there a direct way in which I could define something like a ternary magma (i.e. a set T with a ternary operation ( , , ) : T x T x T -> T) from scratch in Sage? I am interested in studying different axioms like associativity, semiheaps, etc. and checking long calculations symbolically with the aid of Sage.
Hi guys, can anyone help me?
I've never worked with sage, but I decided to use it to get some simple results in my research.
The problem is the following: I end up with a equation which depends on variable 'a' and 't', what I need is to isolate variable 'a' so I will get a(t), I've tried using solve command but it didn't work. Does anyone know how to do it?
Let's look back at some memorable moments and interesting insights from last year.
Your top 10 posts:
error shown in the console is as following (when launching):
sage math Error: Could not fork child process: Resource temporarily unavailable (-1). DLL rebasing may be required; see 'rebaseall / rebase --help'.
looking this error up appears to provide no solutions, am I missing something?
I should mention this has never worked, even when removing and re-installing. Am I missing a prerequisite?
Hi I'm a telecomunications engineer and I need help with a proyect that has to be made with an extension of sage called "notebook sage" and I have no idea of doing it. It´s about encryption.A monetary reward is offered. The work literally says “ Write an encryption and decryption protocol using hash functions, public-key cryptography and private-key cryptography, in which all cases are clearly specified. and private key cryptography, in which all cases are clearly specified”. We have used cases like vignere, cesar..and so on.
I’d like to write proofs in a math programming language as a way of processing them, making sure I understand them, harnessing the power of computers to ensure the proof is valid, and studying the proof in more detail by having automatic functions for examining some of the relevant objects in the proof.
Is this a common use of Sage, to write proofs?
Title. I right-clicked on a result and had some options for renderers. I chose SVG just to see how it would look, and it returns nothing, and I can't even right click any result to revert it, as I don't have any results to click on. This was on SageMath 9.1(using jupyter notebook) installed on Win 10. I have frantically tried to search for a config file, but with no luck.
I've been trying to figure out how to permits rows and columns of a matrix in Sage. It might sound very stupid, but seriously, how is it done?
Hello,
I'm wondering how I can introduce arbitrary variables in a polynomial ring i.e:
R.<x1,...,xn> = PolynomialRing(k)
where k is a finite field given.
And I also want to take the specific elements [x1,...,xn] of the ring, do you have some idea?
How do I find the zeros of a function in Sage Math ?
For example, on a TI CAS calculator, it would be zeros(x^2-2,x)
.
And in GeoGebra CAS, it would be Root(x^2-2)
.
I usually use the python interpreter in pycharm. after upgrading to 9.4 i cant find the python interpreter in the sage files. Does anyone know where it is?
Hi!
I am using Ubuntu 20.04 Focal and need some Sage functionalities that were introduced in v. 9.1. However, the Sage version available on repository universe is 9.0. Is there any PPA for the latest versions of SageMath or is my only chance to manually update SageMath?
Thanks a lot.
Hi, does anyone know how I can get Sage to run on a Mac without having to run as root? In the terminal, when I just type "sage", I get an error. I can however get it to run fine with "sudo sage". Seems a bit strange to me, and I've seen it work perfectly fine without having to specify root for other people.
Anyone know a way around this to allow me to run sage just by inputing "sage" to the terminal -- whether that be a change to the config of sage to allow it to run without root or even just a way to create a symlink to sage which runs it as root without me having to specify if need be. Thanks :)
Hello All, I am quite new to sage math and working on verifying an answer of mine using the Chinese Remainder theorem.
Could anyone help me structure the equation for it to work in SageMath?
Hello, I'm fairly new to Sage. I have a question regarding importing my code. I have a .M file I would like to import into my sage console. I tried looking on the sage handbook for the command, but I can't seem to do it. It appears the console cannot even see the file even when I give it a specific path name. For example,
load('/Users/Username/OneDrive/Desktop/a2tworder2.m')
results in an error, because Sage cannot find the file to load or attach. I'm trying to implement this code into sage so that I can do more things with symmetric functions. Am I doing something wrong?
Thank you in advance.
Edit: I'm running windows 10
I am trying to find the function that is its own Laplace transform in Sagemath. How should I go about this? The answer is supposed to be a Gaussian.
For a school project, I would like to solve the following differential equation :
As you can see, this is an equation of motion, with a set of initial conditions.
h, m, ω, k, E are constants. but the cos(ωt) is a function of time.
I would like to solve this ODE numerically or get the expression of the solution as a function of time, eventually plot y and t .
In order to simplify the expression, I define a, b and c :
Since this is a second order equation, I create a system of two first order equations :
Here is what I coded :
E = 1 # without unit
k = 200 # N/m
h = 8 # without unit
m = 1 # kg
f = 20 # Hz
omega = 2*pi*f #rad/s
# a,b, and c used to simplify
a = h/m
b = k/m
def c(t):
return E*(omega**2)*cos(omega*t)
# Variables
var('t,ydot,y')
eom1 = y.diff(t) == ydot
eom2 = ydot.diff(t) == c(t) - a*ydot(t) - b*y(t)
# Initial conditions
y0 = 0
ydot0 = 0
# Solving and plotting the solutions
sol = desolve_system_rk4([eom1, eom2], ivar=t, vars=[y, ydot], ics = [0, y0, ydot0], end_points=20, step=1)
S = [(t, y) for t, y, ydot in sol]
list_plot(S)
But this isn't properly working.
If you know how to help me, feel free.
Thanks a lot.
I'm a noob in Sage, and I was trying to do some computations for matrices in it.
I have a matrix that contains elements that are powers of a symbolic variable ω.
After doing some multiplication of similar matrices, and finding the trace, I find that the trace of the matrix is not simplified to a single polynomial, and instead, written in a factorized form.
How can I obtain this result (after multiplying the factors) as a single expression?
Thanks in advance for any help!
I am doing some work that requires me to do a lot of symbolic integration of rational functions over the interval [-1, 1]. These rational functions end up containing the integration variable, plus a few real symbolic parameters t1,...,tn. The issue is, as I add more parameters and things get more complicated, Sage's integrate function slows down a lot, and even occasionally seems to get completely stuck.
I am reasonably new to Sage, and I have gotten my code to work for the simpler cases, so it might just be that these functions are too complicated to integrate as I add more parameters. But I'm wondering, are there any general things I could do that might make the integration a little easier/faster? For example, I tried calling .partial_fractions() on the integrand before passing it to the integrate function, but I didn't really notice much of an effect. If you can think of anything that might help speed up these computations, I would appreciate it.