[sage-support] Re: copy and paste of units?

2011-10-24 Thread Simon King
Hi Stan,

On 24 Okt., 17:21, Stan Schymanski  wrote:
> udict = {h_c: h_c*joule}
>
> Traceback (click to the left of this block for traceback)
> ...
> NameError: name 'joule' is not defined
>
> Does anyone know how I can get around this error without re-typing the
> whole dictionary and adding "units.xxx." in front of every single
> unit?

Why not simply defining
  sage: joule = units.energy.joule
?

Of course, you could be more radical and automatically export anything
in units.energy into the global name space:
  sage: for s in units.energy.trait_names():
  : globals()[s] = getattr(units.energy,s)
  :
  sage: joule
  joule
  sage: british_thermal_unit
  british_thermal_unit

Best regards,
Simon

-- 
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://www.sagemath.org


[sage-support] [ANN] New free multifactor analysis tool for experiment planning

2011-10-24 Thread dmitrey
Hi all,

you may be interested in new free multifactor analysis tool for
experiment planning (in physics, chemistry, biology etc). It is based
on numerical optimization solver BOBYQA, released in 2009 by Michael
J.D. Powell, and has easy and convenient GUI frontend, written in
Python + tkinter. Maybe other (alternative) engines will be available
in future.

See its webpage for details:
http://openopt.org/MultiFactorAnalysis

Regards, Dmitrey.

-- 
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://www.sagemath.org


[sage-support] Re: copy and paste of units?

2011-10-24 Thread Keshav Kini
Actually, you cannot even copy and paste the dictionary into the 
*same*worksheet. The display form of an object is not necessarily sufficient to 
reconstruct the object. As for an easier way to do what you are trying to 
do, I'm not sure.

-Keshav


Join us in #sagemath on irc.freenode.net !

-- 
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://www.sagemath.org


Re: [sage-support] Re: integral of exp(-x^2)*cos(x) from -pi to pi is complex?

2011-10-24 Thread Jeroen Demeyer
On 2011-10-09 05:26, Dan Drake wrote:
> We need to work on the numerical approximation stuff for the error
> function!

Ticket #11948:
http://trac.sagemath.org/sage_trac/ticket/11948

(I have a preliminary but not properly tested patch)

-- 
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://www.sagemath.org


[sage-support] copy and paste of units?

2011-10-24 Thread Stan Schymanski
Dear all,

I am using a dictionary to store units of variables, such as

var('h_c')
udict = {}
udict[h_c] = E*units.energy.joule

However, whenever I display the dictionary, I only see:
{h_c: h_c*joule}

This means that I cannot copy and paste the dictionary into a new
worksheet, as it raises an error:
udict = {h_c: h_c*joule}

Traceback (click to the left of this block for traceback)
...
NameError: name 'joule' is not defined

Does anyone know how I can get around this error without re-typing the
whole dictionary and adding "units.xxx." in front of every single
unit?

Thanks for your help already!

Cheers
Stan

-- 
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://www.sagemath.org


[sage-support] Re: How to set 'location' in Normal distribution?

2011-10-24 Thread kcrisman


On Oct 23, 2:58 pm, Jose Guzman  wrote:
> Hi everybody,
>
> I am making a revision of ticket #11572 and wanted to become familiar
> with the way that Sage handle probability distributions . I realized
> that the normal distribution is implemented as follows in Sage:
>
> sage: T=RealDistribution('gaussian',sigma=20)
>
> Is there any reason why this class does not include the mean as a
> parameter for the gaussian distribution?

That is a very good question.   I would say this is a bug report or a
feature enhancement request.It must have just slipped the mind of
the people who put this in originally.

Unless the Gaussian distribution is only the one centered at zero and
the normal is able to be centered anywhere?   But I've never heard of
that as a distinction...

For sure we want to start unifying this behavior.  Scipy is good to
have as an option, of course, but we want more Sage-"native" wrapping
of things like GSL (which I think #11572 is going for?).  Thanks for
catching this and working on that ticket; kamhamea/Mato did a lot of
good work on that ticket, and it would be a real shame to have it
bitrot further.

- kcrisman

-- 
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://www.sagemath.org


[sage-support] Re: finding the closed form for a linear second order recurrence sequence

2011-10-24 Thread achrzesz
Also:

sage: from sympy import *
sage: n = Symbol('n', integer=True)
sage: u = Function('u')
sage: f=u(n+2)-2*u(n+1)-8*u(n)
sage: rsolve(f,u(n),{u(0):2,u(1):7})
(-2)**n/6 + 11*4**n/6

Andrzej Chrzeszczyk

-- 
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://www.sagemath.org


Re: [sage-support] Re: finding the closed form for a linear second order recurrence sequence

2011-10-24 Thread Burcin Erocal
On Sun, 23 Oct 2011 15:09:09 -0700 (PDT)
Simon King  wrote:

> On 23 Okt., 23:18, David Joyner  wrote:
> > On Sun, Oct 23, 2011 at 4:51 PM, Avril Coghlan
> >
> >  wrote:
> > > Dear all,
> >
> > > I am new to SAGE (since today) but am excited about learning how
> > > to use it!
> >
> > > I'm wondering is it possible to use SAGE to find the close form
> > > for a linear second order recurrence sequence?
> > > For example, can SAGE find a closed form for an equation such as:
> > >  u_{n+2} = 2 * u_{n+1} + 8 * u_{n}, where we know u_{0} = 2 and
> > > u_{1} = 7  ?
> >
> > > I will be very grateful for any help, or if you can point me
> > > towards the right documentation page to look at.
> >
> > Your question might be addressed in this sage-support
> > thread:http://www.mail-archive.com/sage-support@googlegroups.com/msg17045.html
> 
> Probably the thread is answering Avril's question.
> 
> But the last post in the thread is Nathann saying:
> """
> Should we create a ticket for this ? I'd have done it if not for my
> doubt on the section I should pick for this... :-)
> """
> 
> Is there a ticket?

http://trac.sagemath.org/sage_trac/ticket/1291

Cheers,
Burcin

-- 
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://www.sagemath.org


[sage-support] Re: finding the closed form for a linear second order recurrence sequence

2011-10-24 Thread achrzesz

sage: maxima('batch(solve_rec)')
"/home/andy/Pobrane/sage-4.7.1/local/share/maxima/5.23.2/share/contrib/
solve_rec/solve_rec.mac"
sage: maxima('deq: u[n+2]=2*u[n + 1] + 8*u[n];')
u[n+2]=2*u[n+1]+8*u[n]
sage: maxima('sol:solve_rec(deq,u[n],u[0]=2,u[1]=7);')
u[n]=11*4^n/6-(-2)^(n-1)/3

Andrzej Chrzeszczyk

-- 
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://www.sagemath.org