Another good resource is:
ask.sagemath.org
Joal Heagney
On Friday, 12 October 2012 08:37:50 UTC+10, Doaa El-Sakout wrote:
>
> I try to solve an ODE and plot the result as follows,
>
>
> x,t,a=var('x,t,a')
> a=0.29
> x = function('x', t)
> S=desolve(diff(x,t)-x*(1-x)+a*
> (1+sin(2*pi*t)),x,contr
A way to get these new parameters from maxima is as follows:
soln = S[0][0][1]
soln.arguments()
to get the argument names, (Which are t and u), then
t,u = soln.arguments()
Once you've done this, you can replace u with a value as follows:
soln.subs(u == 0.5)
Which returns:
-0.145*sin(2*pi*t) - 0
On Wednesday, 11 April 2012 03:11:03 UTC+10, Michael Orlitzky wrote:
>
> On 04/09/12 22:18, ancienthart wrote:
> > Hah. Thanks Michael and P. I first learnt Python in the 1.5 era, so
> > there's a few of the nice new syntax features I'm still not up to speed
> on.
&
Hah. Thanks Michael and P. I first learnt Python in the 1.5 era, so there's
a few of the nice new syntax features I'm still not up to speed on.
Any reason why .subs doesn't accept multiple arguments? Would there be any
point in requesting .subs_expr become the new default on trac?
Joal Heagney
Or rather, the limit syntax seems to be completely out of whack.
This seems to be promising, except that minus needs to be replaced by
-Infinity, and then I get an error message relating to the limit function.
>
>
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscr
Hi kcrisman, just some followups:
Have added the following to ask.sagemath.org
http://ask.sagemath.org/question/1265/how-to-dynamically-substitute-a-variable-in-a
Have applied the http://trac.sagemath.org/sage_trac/ticket/11143 patch
(along with this patch as well
http://trac.sagemath.org/sage_
t the result back here. Will take care of the other points as
you have suggested.
Again thank you for your help,
Joal Heagney
On Friday, 23 March 2012 00:12:27 UTC+10, kcrisman wrote:
>
>
>
> On Thursday, March 22, 2012 5:46:58 AM UTC-4, ancienthart wrote:
>>
>> On Wednesday,
On Wednesday, 21 March 2012 22:42:16 UTC+10, kcrisman wrote:
>
>
>> fracintegral(x,1/2)
>>>
>>
>>>
>> 4/15*x^(5/2)/sqrt(pi)
>>
> Though you should get a deprecation error.
>
Yeah, I do. I don't know the correct way to collect a variable argument
from inside a function call, and apply
Hi everyone, I've got the following behaviour in sage 4.8.
First I define the following function to calculate the fractional integral
of a function:
def fracintegral(func,n, x=x,a=0):
> var('t')
> assume(t > a)
> assume(x > a)
> return integrate((x-t)^n*func(t),t,a,x)/gamma(n)
>
I've opened an enhancement ticket here:
http://trac.sagemath.org/sage_trac/ticket/12554
and given you the credit for the example implementation. My approach used a
dictionary, but your implementation has the advantage that if an earlier
test returns True, the additional test logic doesn't have to
Yup, that's very similar to a solution I came up with. Just checking that
there isn't a pre-existing method or function I missed. Think I'll go write
an enhancement ticket at sage trac. :/
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from th
Guys, is there a method or function to flip an equation or inequality?
I'd like to turn 2*x + 3*y < 8 into 8 > 2*x + 3*y automatically.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@goog
Yes, but if you post integrate(0,x) directly into a cell, it evaluates to a
constant.
Any idea why it doesn't do so in this case?
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegrou
The following happens when I enter the following in 4.7.1
y = function('y',x)
a = 1 + diff(y,x) == 0
integrate(a,x)
I get:
x + y(x) == c2 + integrate(0, x)
Any idea why sage doesn't reduce integrate(0,x) to zero in this case?
If it's not a simple "feature", I'll enter this in trac.
Joal Heagne
Thanks Rajeev.
Incidently, doing
plt.savefig('./a.png')
will allow notepad to display the resultant file.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options,
Aaah.
I've found plenty of evidence stating that sage can do log-log plots, but
can someone please give me a code example on how to actually achieve it?
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
Normally solve(e == m, a_x, to_poly_solve='force') works, but interestingly,
not for your equation.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visi
I know it's a silly question, but do you have the standard c++ libraries
installed?
sudo apt-get install g++
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more opt
Yup, Robert's right, IDLE's just a GUI. It does some rewriting of code, but
that's just so that IDLE's onboard debugger tools can capture exceptions and
output.
If you want faster code, you may want to look at the following blog post:
http://sagemath.blogspot.com/2010/11/getting-started-with-cyt
And then there's Jason's beautiful little time-saving method if you use a
lot of graphics:
*from contextlib import contextmanager @contextmanager def r_graphics(r):
r.png() yield r.dev_off() with r_graphics(r): r.boxplot()
r.some_other_plot()*
This and further discussion can be found at:
http:
A good tutorial for R/sage is available at:
http://www.sagenb.org/home/pub/2232/
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http
Can you try the following for us please?
png()
hist(x)
dev.off()
and
png()
plot(x,y)
def.off()
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit th
var('x,y,z')
A = implicit_plot3d(x^2 + y^2 + z^2 == 1,
(x,-1,1),(y,-1,1),(z,-1,1),opacity=0.5)
B = implicit_plot3d(x^2 + 2*y^2 + 2*z^2 == 1,
(x,-1,1),(y,-1,1),(z,-1,1),color='red')
show(A+B)
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, se
The ticket is open at #11266
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://
I've just joined sage-trac-account, requested an account and will post a new
ticket once I have approval.
As for trellis/lattice packages, this highlights what could be a big problem
with R, as there are literally thousands of different packages, a good few
that create plots. If we create a lis
True, but I'd like something a little more ... pythonic.
I was thinking of a wrapper that acts like the following:
graph = Rgraphic(arguments passed to R.Cairo)
graph.boxplot(arguments)
graph.histogram(arguments)
graph.etc..
show(graph)
All method calls that aren't defined in the Rgraphic c
kcrisman? :P
I'm not actually sure if the r.png( ) in the system I have set up uses the
system png libraries or cairo, but having the tcl/tk R package installer is
handy.
What I'd like to see in sage is a rewrite of the r.png( ) functionality
Currently, to include a R graphic object in the
These two posts explain what I do.
https://groups.google.com/d/topic/sage-devel/s1hI8JnHY6k/discussion
https://groups.google.com/d/topic/sage-release/ilYqmm2QyHc/discussion
It's a bit unclear, but basically I install jpeg-dev and png-dev libraries
and everything else I can think of to cover my b
Kelvin's suggestion is the easiest. This is how I run sage on my windows
work machine, inside virtualbox on ubuntu. The vmware image provided on the
website lacks R png support, so I like to roll my own.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsu
(Respectfully) Then why does splitting the range of values for x into
positive, zero and negative ranges work?
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more opt
Now THAT seriously needs to be made clearer in the documentation, including
some examples.
Also, how to use use_grobner because use_grobner=True don't work.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-sup
Here's a one liner to filter the solutions.
filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns)
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit
Here's a one-liner to filter the solutions:
filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit t
Which is why I did the sanity checking in the last step. I admit n( ) on
lhs() and rhs() is ugly, but I'm sure others could suggest ways to check for
equality in an equation.
On the other hand, you didn't mention in the original problem that x had to
be in the reals. :D
Joal Heagney
--
To pos
I think sage solving is based on maxima, and I've noticed that Maxima has
always had this problem with non-linear equations.
If you set it up as follows:
eq = x == sqrt(1 + x)
solns = solve(eq^2,x); solns
You will get:
[x == -1/2*sqrt(5) + 1/2, x == 1/2*sqrt(5) + 1/2]
Of course, then you have
Would it be possible to add a post-maxima check to ensure the answers are in
the same domain as the inputs?
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more option
Drat.
I have been playing around with things a little with this in mind.
The best I can get, is to define a normal python function, with the s, v and
k terms passed in as arguments, and have it return a vector of equations.
Results are italic.
var('t')
def returneqn(v_t,v_0,k,s_0):
return t*
Hi guys, back again.
It seems that I can never find what I look for in the reference documents,
but it always becomes embarrassingly easy once someone explains it to me.
I've been playing around with the displacement reaction for viscous drag
ballistics, and have derived the following equation:
Yeah, I spotted that after I posted my above post. Well, not spotted, more
that I finally understood the line.
The first time I read it, I didn't notice that the second lambda didn't have
an x before the :
Thanks,
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.
Hah hah. This get's close to desirable behaviour in pure python.
class Test:
def __init__(self,seq):
self.seq = seq
def __repr__(self):
return "Test(%s)" % self.seq
def apply_map(self,function):
newseq = map(function,self.seq)
return Test(newseq)
def
Should have noted that this was for proposal one.
I kinda prefer it to proposal two myself - will be almost invisible in use.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.co
Sorry, all the suggestions I've put below are for proposal one.
Joal Heagney
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.c
I'm relying on the fact that __getattr__ is only called if the attribute is
missing from the matrix class. I was of the opinion that this would
completely avoid raising an AttributeError in the first place. This
(should?) mean that the currently defined simplify_ methods on the matrices
will st
My current path of research involves giving the Matrix class a __getattr__
method with argument *missing_method*, that returns a callable object. The
callable object then returns the matrix result of .apply_map(lambda x:
getattr(x,*missing_method*))
Still having some fun ironing out the wrinkle
Eeeeggg.
Working on it. I'm currently investigating using getters and setters to pull
attributes from matrix or it's contents.
My current idea looks something like this:
def map(self, function):
try:
:
http://groups.google.com/group/sage-support
URL: ht
This tip, which seems the most effective and least likely to blow up, has
made it to the following blog.
http://doxdrum.wordpress.com/2011/01/22/sage-tip-simplifying-a-matrix/
So is it possible that this could become an approach to matrices, either
automagically, or by a smarter map function?
P
*sigh* Which is why I put the comment about how it was likely I'd missed
something in the documentation. Nice to know that I'm at least right about
that. :P
Hmmm. My matrix is based on SR (Symbolic Ring), which doesn't have any
simplify methods, which suggests my idea of exposing element method
A possible approach for my proposed (mega) simplify method is outlined
below.
Since several objects have these defined as methods, would the following
approach work?
sage: D
[-(e^3 + 2)/(e^3 - 1) + (2*e^3 + 1)/(e^3 - 1) 1]
[ 2
Since several objects have these defined as methods, would the following
approach work?
sage: D
[-(e^3 + 2)/(e^3 - 1) + (2*e^3 + 1)/(e^3 - 1) 1]
[ 2 0]
I then defined the following function:
def mysimplify(obj):
try:
Attempting to use this on my matrix, I end up with the following results (D
is my matrix):
D.apply_map(simplify_full)
Traceback (most recent call last):
File "", line 1, in
File "_sage_input_61.py", line 10, in
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n
50 matches
Mail list logo