[sage-support] Re: LaTeX problem

2008-12-08 Thread pong


This may work for you

html(r'\tan^{-1} x') or simply html(r'$\tan^
{-1} x$')

the r before ' stands for "raw string".


On Dec 8, 9:55 pm, acardh <[EMAIL PROTECTED]> wrote:
> I am working in the Sage Notebook, I can reproduce the Taylor Series
> example as is. The LaTeX works fine there.
>
> I took the next line from the Sage reference book, from the Latex
> printing support section:
>
> \tan^{-1} x
>
> The problem is that when I put it in the Notebook cell I get an error:
>
> SyntaxError:invalidsyntax
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] LaTeX problem

2008-12-08 Thread acardh

I am working in the Sage Notebook, I can reproduce the Taylor Series
example as is. The LaTeX works fine there.

I took the next line from the Sage reference book, from the Latex
printing support section:

\tan^{-1} x

The problem is that when I put it in the Notebook cell I get an error:

SyntaxError:invalidsyntax


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: question about visualization/animation of surfaces

2008-12-08 Thread Marshall Hampton

The nicest looking solution I have found is to make frames with
tachyon and then animate the results with ffmpeg.   I have meant to
create some how-to documentation for the things I have done so far but
I do not have the time right now, hopefully I will soon.  The options
for ffmpeg are somewhat confusing, at least for me, but I have gotten
good results by just using the flag "-q 2" which keeps the quality
high.

Hope that helps,
M. Hampton

On Dec 8, 5:47 pm, ggrafendorfer <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a list of surfaces (btw: volatility surfaces), each of which
> represented by a list of 3-Tuples (numbers),
> I would like to visualize them in an animation showing a surface
> evolving in time.
>
> Any suggestions which tools I could use for this?
>
> Thank you,
> Georg
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] question about visualization/animation of surfaces

2008-12-08 Thread ggrafendorfer

Hi,
I have a list of surfaces (btw: volatility surfaces), each of which
represented by a list of 3-Tuples (numbers),
I would like to visualize them in an animation showing a surface
evolving in time.

Any suggestions which tools I could use for this?

Thank you,
Georg




--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Change of variable in Differential Equation

2008-12-08 Thread David Joyner

Personally I don't see how

As a guess, for a substitution like you want to work, the following
much simpler computation

sage: t = var('t')
sage: x = function('x', t)
sage: y = function('y', x)
sage: diff(y,t)
diff(y(x(t)), t, 1)

should yield not diff(y(x(t)), t, 1) but perhaps something like

diff(y(x), x, 1)*diff(x(t),t) ?

I wonder what others think.


On Mon, Dec 8, 2008 at 6:16 PM, bsdz <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I was wondering if it is possible in Sage (perhaps even Maxima) to
> change the variable in an ODE or PDE algebraically. I have set up a
> simple PDE with the following: -
>
> x, t, k_1, k_2 = var("x t k_1 k_2")
> y = function('y', x, t)
> PDE = lambda f : k_1 * x^2 * diff(f,x,2) + diff(f,t) + k_2*(x*diff(f,x)-f)
> PDE(y(x,t))
>
> I would like to how to make the change of variable x = exp(z) where z
> is real. Is this possible?
>
> Thanks in advance
> Blair
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Change of variable in Differential Equation

2008-12-08 Thread bsdz

Hi

I was wondering if it is possible in Sage (perhaps even Maxima) to
change the variable in an ODE or PDE algebraically. I have set up a
simple PDE with the following: -

x, t, k_1, k_2 = var("x t k_1 k_2")
y = function('y', x, t)
PDE = lambda f : k_1 * x^2 * diff(f,x,2) + diff(f,t) + k_2*(x*diff
(f,x)-f)
PDE(y(x,t))

I would like to how to make the change of variable x = exp(z) where z
is real. Is this possible?

Thanks in advance
Blair
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How to replace variables in function?

2008-12-08 Thread bsdz

(Sorry if this reply appears twice - 1st one disappeared?)

This worked for me: -

H, p, Pole1, Pole2, Pole3, Ts, z, f = var("H p Pole1 Pole2 Pole3 Ts z
f")
p = (2/Ts)*(z-1)/(z+1)
z = exp(I*2*pi*Ts*f)
H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3))
show(H)

The only difference is that I have declared the variables in the first
line. Hope that helps.

On Dec 8, 5:58 pm, Sand Wraith <[EMAIL PROTECTED]> wrote:
> Hi all! Please help me to replace variables:
>
> I have this function:
>
> H(p)=(p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3))
>
> where Pole1,Pole2,Pole3 - complex:
>
> r=2*2*pi
> Pole1=r*exp(I*2*pi/3)
> Pole2=-r
> Pole3=r*exp(-I*2*pi/3)
> Ts=0.1
>
> And I need to make a few replaces:
>
> need to replace "p" with "(2/Ts)*(z-1)/(z+1)", where z is a new
> variable, and then replace "z" with "exp(I*2*pi*Ts*f)". To have H(f)
> function at the end.
>
> I am trying to write:
>
> z=exp(I*2*pi*Ts*f)
> p=(2/Ts)*(z-1)/(z+1)
> H=(p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3))
>
> and now if I want to look at H:
> H
> or
> show(H)
> I've got many errors...
>
> tail of long output:
>
> 
> stdin:16:Incorrect syntax: Syntax error
> _tmp_ : (8000.0(
>               ^
> (%o90)
>
> what is wrong with it?

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] How to replace variables in function?

2008-12-08 Thread Sand Wraith

Hi all! Please help me to replace variables:

I have this function:

H(p)=(p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3))

where Pole1,Pole2,Pole3 - complex:

r=2*2*pi
Pole1=r*exp(I*2*pi/3)
Pole2=-r
Pole3=r*exp(-I*2*pi/3)
Ts=0.1

And I need to make a few replaces:

need to replace "p" with "(2/Ts)*(z-1)/(z+1)", where z is a new
variable, and then replace "z" with "exp(I*2*pi*Ts*f)". To have H(f)
function at the end.

I am trying to write:

z=exp(I*2*pi*Ts*f)
p=(2/Ts)*(z-1)/(z+1)
H=(p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3))

and now if I want to look at H:
H
or
show(H)
I've got many errors...

tail of long output:


stdin:16:Incorrect syntax: Syntax error
_tmp_ : (8000.0(
  ^
(%o90)


what is wrong with it?
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: warning in time installation

2008-12-08 Thread mabshoff



On Dec 8, 8:23 am, a1antonov antonov <[EMAIL PROTECTED]> wrote:

Hi,

> PC Pentium4, Dual threading, Memory 2*256MB,
> OS-Windows2000+Service Pack4
>
> In time install SAGE I receive message:
>
> WARNING! This SAGE install was built on a machine that supports instruction 
> are not available on this computer.
> SAGE will likely fail with ILLEGAL INSTRUCTION errors!
> The following processor flags were on the build machine but are not on this 
> computer:
> nx lm lahf_lm cx16
>
> SAGE version 3.2, release Date:2008-11-20
>
> Please answer me what I must do or I cannot use SAGE?

Just delete $SAGE_ROOT/local/lib/sage-flags.txt - this was a bug in
Sage 3.2, i.e. we only wanted to consider flags like sse and 3dnow,
but by accident we included all flags in the sage-flags.txt.  The
flags that your install is complaining about are irrelevant, so there
is nothing to worry about.

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] warning in time installation

2008-12-08 Thread a1antonov antonov

PC Pentium4, Dual threading, Memory 2*256MB, 
OS-Windows2000+Service Pack4

In time install SAGE I receive message:

WARNING! This SAGE install was built on a machine that supports instruction are 
not available on this computer.
SAGE will likely fail with ILLEGAL INSTRUCTION errors!
The following processor flags were on the build machine but are not on this 
computer:
nx lm lahf_lm cx16

SAGE version 3.2, release Date:2008-11-20

Please answer me what I must do or I cannot use SAGE?





--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: numerical evaluation of integral?

2008-12-08 Thread Stan Schymanski

Dear all,

Thanks a lot for your help. It looks like there is yet another useful
function going to be implemented in sage. Just to give an example
where quad is faster than GSL (sorry for the length):

sage: def insol1(epsilon,ecc,varpi,phi,lambd):
...   S0=1368
...   phirad=phi*pi/180.
...   lambdarad=lambd*pi/180.
...
...   sindelta = sin(epsilon)*sin(lambdarad)
...   cosdelta = sqrt(1-sindelta^2)
...   nu = lambdarad-varpi # true anomaly
...   sin_phi_sin_delta = sin(phirad)*sindelta
...   cos_phi_cos_delta = cos(phirad)*cosdelta
...   tan_phi_tan_delta = min(max(sin_phi_sin_delta /
cos_phi_cos_delta,-1),1)
...   H0 = acos(-tan_phi_tan_delta)# solar time of sunset
...   sin_H0   = sqrt(1-tan_phi_tan_delta*tan_phi_tan_delta)
#2*H0: day length
...   rho = (1-ecc^2)/(1+ecc*cos(nu)) # earth-sun distance in
astronomical units
...   W = S0/(pi*rho^2)*(H0*sin_phi_sin_delta
+cos_phi_cos_delta*sin_H0) # daily mean shortwave down
...   dtdl = rho^2 / sqrt(1-ecc^2) # 1/(dlambda/dt)
...   return W*dtdl

sage: timeit('quad(lambda x: insol(0.3,0.05,0,80,x),0,360)')
5 loops, best of 3: 711 ms per loop
sage: timeit('numerical_integral(lambda x: insol(0.3,0.05,0,80,x),
0,360)')
5 loops, best of 3: 1.06 s per loop

The difference does not seem to be very large, though.

Cheers
Stan

On Dec 5, 6:17 am, Jason Grout <[EMAIL PROTECTED]> wrote:
> William Stein wrote:
> >> Should we phase GSL out of numerical_integral too?  Should we replace it
> >> with the equivalent scipy call (which would make it massively shorter
> >> and simpler)?
>
> > Yes, it is very tempting to do so.   One thing is that each function 
> > evaluation
> > could in theory be much faster with the GSL version, since GSL takes
> > as input a C-level callback function, whereas I think scipy's quadpack
> > wrapper doesn't.
>
> Using the example from this thread:
>
> sage: timeit('quad(ff, 0, 18)')
> 625 loops, best of 3: 157 µs per loop
> sage: timeit('numerical_integral(ff, 0, 18)')
> 625 loops, best of 3: 78.4 µs per loop
>
> So GSL is twice as fast.
>
> A few more examples pulled from thin air:
>
> sage: f=250*cos(pi*x/180)^1.8 + 170.35*sin(x*pi)+log(1+x)
> sage: ff = fast_float(f, 'x')
> sage: timeit('quad(ff, 0, 18)')
> 625 loops, best of 3: 136 µs per loop
> sage: timeit('numerical_integral(ff, 0, 18)')
> 625 loops, best of 3: 104 µs per loop
> sage: f=250*cos(pi*x/180)^1.8 +
> 170.35*sin(x*pi)+log(1+x)+1/sqrt(1+x)+x^(0.3)
> sage: ff = fast_float(f, 'x')
> sage: timeit('quad(ff, 0, 18)')
> 625 loops, best of 3: 699 µs per loop
> sage: timeit('numerical_integral(ff, 0, 18)')
> 625 loops, best of 3: 142 µs per loop
>
> In each case, GSL is better or way better.
>
>
>
> > Jason said:
>
> >> Both GSL and scipy call quadpack.
>
> > I'm not sure exactly what this means, since probably scipy's quadpack
> > is a fortran library, but GSL is definitely built 100% fortran free
> > (there's no fortran code in gsl and no fortran dependencies).   Maybe
> > GSL has a C port of quadpack, or some other sort of translation of the
> > code.  So I suspect GSL and scipy are calling into separate separate
> > code that is compiled using a different compiler, so there could be
> > differences in performance and capabilities.
>
> Sorry; from the GSL docs:
>
> The library reimplements the algorithms used in quadpack, a numerical
> integration package written by Piessens, Doncker-Kapenga, Uberhuber and
> Kahaner. Fortran code for quadpack is available on Netlib.
>
> So you're right, there could be performance differences in the library
> alone.
>
> Jason
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---