Questions tagged [sage]

For questions related to computational science problems that are solved using SageMath.

Filter by
Sorted by
Tagged with
1 vote
0 answers
30 views

SageMath: How do I plot the sum of a deterministic variable and a random variable

Suppose I have the following function $$f(x,y,z1,z2)=g(x-z1,y-z2)$$ where $g(x,y)$ is a deterministic function from the $X\times Y\to S$ and $z1,z2$ are random variables following a known probability ...
vidyarthi's user avatar
  • 111
0 votes
1 answer
46 views

'Integral2' error in MATLAB for invalid integrand

Here is the code that I am trying to run: ...
vidyarthi's user avatar
  • 111
0 votes
1 answer
63 views

Systematically outputting sign vectors of restricted hyperplane arrangement

(I previously asked this question on Sage's dedicated Q&A site, but got no response, so I figured it would be worth trying here.) I have a way of constructing hyperplane arrangements in Sage, ...
Will Dana's user avatar
  • 109
1 vote
1 answer
121 views

Evaluating an indefinite integral that has no closed form

I need to evaluate the following indefinite integral: $$I=\int\frac{x^5+2ax^3+a^2x-4a}{x^7+ax^5+2ax^4}dx=\int\frac{x^5+2ax^3+a^2x-4a}{x^4(x^3+ax+2a)}dx$$ The solution that I obtained while ...
Richard's user avatar
  • 131
2 votes
0 answers
119 views

Find solution to Polynomial Sequences without going through variety in Sage

I'm computing the Groebner basis of an ideal defined over the QQ ring. Once I have this Groebner basis, I would like to obtain a set of values that satisfy the equations in the Groebner basis. I know ...
David Bernal's user avatar
3 votes
1 answer
143 views

Doubt about Python code for calculation of Energy Conditions in General Relativity

In General Relativity, one possible way to decide if a space-time [i.e. a Lorentzian Manifold $(\mathcal{M}, \textbf{g})$ where $\textbf{g}$ is an arbitrary metric tensor.] is a "resonable physical" $[...
M.N.Raia's user avatar
  • 141
2 votes
1 answer
777 views

Forward and backward integration -- cause of errors

I write a test program to integrate foward on $[0,T_f]$ and then backward on $[T_f,0]$ from the endpoint of the forward integration an Hamiltonian system: $$ \dot q(t) = \frac{\partial H}{\partial p}(...
Smilia's user avatar
  • 468
2 votes
0 answers
63 views

localizing rings in SAGE [closed]

I am a bit of SAGE newb, so I apologize if this is a simplistic question. I want to use SAGE to compute some invariants of elliptic curves defined over rings which aren't the integers $\mathbb{Z}$ ...
CWcx's user avatar
  • 121
1 vote
1 answer
98 views

How do you save a large amount of data using SAGE?

I'm trying to save a 'big' rational matrix in SAGE, but I'm running into problems. After computing my matrix A, which has size 5 x 10,000 and each entry contains rational numbers in fraction form with ...
Sandi's user avatar
  • 11
8 votes
3 answers
5k views

random number generation from cython

I want to make my python program fast by using cython, but my inner loop is still making slow python calls to the random number generator! Several years ago this same issue was raised by someone on ...
none's user avatar
  • 508
3 votes
1 answer
2k views

Solve log equations problem [SageMath]

Input var('x') solve((log((x**2 - x), 6) - log((6*x - 10), 6) == 0), x) Output [log(x^2 - x) == log(6*x - 10)] But real ...
Ticksy's user avatar
  • 155