[sage-support] Re: Integration of piecewise function
Does anyone know is this issue only for newest version? (may be I should use older version of sage) On 8 дек, 21:47, David Joyner wrote: > Unfortunately, the piecewise class was written before the symbolic > expressions class and has not kept pace. > > The obvious solution produced this: > > sage: signal = Piecewise([[(0,1), cos(2*pi*1*x)], [(-1, 0), 0*x]]) > sage: signal.integral(definite=True) > --- > TypeError Traceback (most recent call last) > > /Users/wdj/.sage/temp/jeeves.home/2806/_Users_wdj__sage_init_sage_0.py > in () > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/functions/piecewise.pyc > in integral(self, x, a, b, definite) > 787 fun_integrated = fun.integral(x, end, x) > 788 else: > --> 789 fun_integrated = fun.integral(x, start, x) + area > 790 if definite or end != infinity: > 791 area += fun.integral(x, start, end) > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/symbolic/expression.so > in sage.symbolic.expression.Expression.integral > (sage/symbolic/expression.cpp:25344)() > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/calculus/calculus.pyc > in integral(expression, v, a, b, algorithm) > 635 else: > 636 try: > --> 637 result = expression._maxima_().integrate(v, a, b) > 638 except TypeError, error: > 639 s = str(error) > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/maxima.pyc > in integral(self, var, min, max) > 2023 if max is None: > 2024 raise ValueError, "neither or both of min/max > must be specified." > -> 2025 return I(var, min, max) > 2026 > 2027 integrate = integral > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc > in __call__(self, *args, **kwds) > 1402 > 1403 def __call__(self, *args, **kwds): > -> 1404 return self._obj.parent().function_call(self._name, > [self._obj] + list(args), kwds) > 1405 > 1406 def help(self): > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc > in function_call(self, function, args, kwds) > 1310 [s.name() for s in args], > 1311 > ['%s=%s'%(key,value.name()) for key, value in kwds.items()]) > -> 1312 return self.new(s) > 1313 > 1314 def _function_call_string(self, function, args, kwds): > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc > in new(self, code) > 1094 > 1095 def new(self, code): > -> 1096 return self(code) > 1097 > 1098 > ### > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc > in __call__(self, x, name) > 1029 > 1030 if isinstance(x, basestring): > -> 1031 return cls(self, x, name=name) > 1032 try: > 1033 return self._coerce_from_special_method(x) > > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc > in __init__(self, parent, value, is_name, name) > 1445 except (TypeError, KeyboardInterrupt, > RuntimeError, ValueError), x: > 1446 self._session_number = -1 > -> 1447 raise TypeError, x > 1448 self._session_number = parent._session_number > 1449 > > TypeError: Computation failed since Maxima requested additional > constraints (try the command 'assume(x>0)' before integral or limit > evaluation, for example): > Is x positive, negative, or zero? > > On Tue, Dec 8, 2009 at 4:28 PM, Sand Wraith wrote: > > Hello, > > > there is signal function: > > signal = Piecewise([ > > [(0,5), cos(2*pi*1*x) ], > > [(5,10), cos(2*pi*2.5*x) ], > > ]) > > > And window function: > > window = Piecewise([[(-1,1),1]]) > > > And the result function: > > r=window*signal > > > How can I integrate it now? I'am trying: > > r.integral(definite=True) > > > but it leads to error: "TypeError: integral() takes no arguments (3 > > given)" > > > -- > > 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 > > athttp://groups.google.com/group/sage-support > > URL:http://www.sagemath.org -- 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] Integration of piecewise function
Hello, there is signal function: signal = Piecewise([ [(0,5), cos(2*pi*1*x) ], [(5,10), cos(2*pi*2.5*x) ], ]) And window function: window = Piecewise([[(-1,1),1]]) And the result function: r=window*signal How can I integrate it now? I'am trying: r.integral(definite=True) but it leads to error: "TypeError: integral() takes no arguments (3 given)" -- 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] Error: symbolic Ring still using old coercion framework
Hi all! I am trying to do simple convolution: x = PolynomialRing(QQ,'x').gen() f=piecewise([((-1,3),1*x^0)]) g=piecewise([((0,5),exp(-x))]) r=g.convolution(f) and got this error message: RuntimeError: Symbolic Ring still using old coercion framework 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 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] Building problems on ArchLinux
Hi all! I'am trying to use sage on ArchLinux server. There is not enough space on /home, so i create a directory /ubin/sage and unpack sage in there: drwxr-xr-x 3 operator users 4.0K 2009-09-14 22:33 sage then i'am trying to run "make" command, and of this it's output here: Machine: Linux heaviside 2.6.30-ARCH #1 SMP PREEMPT Mon Aug 17 18:04:53 CEST 2009 i686 Intel(R) Celeron(R) CPU 1.70GHz GenuineIntel GNU/Linux sage: polytopes_db-20080430 is already installed sage-spkg dsage-1.0.1.p0 2>&1 You must set the SAGE_ROOT environment variable or run this script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory. dsage-1.0.1.p0 Machine: Linux heaviside 2.6.30-ARCH #1 SMP PREEMPT Mon Aug 17 18:04:53 CEST 2009 i686 Intel(R) Celeron(R) CPU 1.70GHz GenuineIntel GNU/Linux sage: dsage-1.0.1.p0 is already installed cd /ubin/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux && . local/bin/ sage-env && cd local/bin/ && ./sage-make_relative Making script relocatable make[1]: Leaving directory `/ubin/sage/sage-4.1.1-linux-Ubuntu_9.04- i686-Linux/spkg' real0m11.046s user0m4.976s sys 0m3.186s /ubin/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/local/bin/sage- sage: line 869: 8932 Illegal instruction python "$SAGE_ROOT"/ devel/sage/doc/common/builder.py $@ And then sage won't run: $ ./sage -- | Sage Version 4.1.1, Release Date: 2009-08-14 | | Type notebook() for the GUI, and license() for information.| -- The Sage install tree may have moved. Regenerating Python.pyo and .pyc files that hardcode the install PATH (please wait at most a few minutes)... Do not interrupt this. /ubin/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/local/bin/sage- sage: line 199: 8966 Illegal instruction sage-ipython "$@" -i - any suggestions?.. help please.. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Find maximum on interval for result of diff() function.
f(x)=exp(-x^2) g=diff(f) then I'd like to find maximum of g function on interval: find_maximum_on_interval(g,0,1) (-1.30156325204e-08, 6.5078162602101728e-09) but for: find_maximum_on_interval(g,0,3) I've got error: Traceback (click to the left for traceback) ... TypeError: cannot coerce type '' into a SymbolicExpression. what is wrong? --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] More marks on axes?
Hello, plot(lambda f:f,0.0003,0.0004) The graph has only two signed marks on the axes. How can I tell sage to make more? There are still a lot of free space. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: question about solve() function
thank you! On Jan 9, 7:27 pm, "William Stein" wrote: > On Fri, Jan 9, 2009 at 3:49 AM, Sand Wraith wrote: > > > Hi! > > > Is it possible to get order of root of equation? For example equation: > > > f(x)=(x+1)^2 > > and it's solution "solve(f,x)" will be "[x == -1]", but this is not > > perfect clear, because x==-1 have second order. This equation actually > > must have two same roots: [x == -1,x == -1]. > > Use the roots command: > > sage: f = (x + 1)^2 > sage: f.roots() > [(-1, 2)] > > The 2 is the multiplicity. > > William --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] question about solve() function
Hi! Is it possible to get order of root of equation? For example equation: f(x)=(x+1)^2 and it's solution "solve(f,x)" will be "[x == -1]", but this is not perfect clear, because x==-1 have second order. This equation actually must have two same roots: [x == -1,x == -1]. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Using HTML and plot function
Hi all! How to use both html and graphics? for example insert plot(sin,0,4) in html-tabe? i am trying: html('sin(x):') html(myimage) html('') but it gives table with text "sin: Graphics object consisting of 1 graphics primitive".. i'd like to see image, not text. Thank you. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] show(P,xmin=0) shows area below Y=0 line
Hi! I want to plot a few lines: Line=line([]) for i in [-10..3]: Line+=line([[0,0],[1.1+i/10,1.1]]) and show it: show(Line,xmin=0) but output contains area below X axis. :-\ --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: How to replace variables in function?
Thank you! Than you all so much! It was so difficult to continue my research without it! And I am so glad Sage project have real support :-) --~--~-~--~~~---~--~~ 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?
this round(H.substitute(f=4).abs(),4) give same error again... then this: round(RDF(H.substitute(f=4).abs()),4) takes so much time, can't wait... On Dec 9, 10:42 pm, Sand Wraith <[EMAIL PROTECTED]> wrote: > you mean for f? this: > > round(H.substitute(f=1),4) > > gives type error again :-( > > On Dec 9, 9:51 pm, Tim Lahey <[EMAIL PROTECTED]> wrote: > > > On Dec 9, 2008, at 1:46 PM, Sand Wraith wrote: > > > > thank you! )) > > > > but I need to use my values, now just variables (Ts,Pole1 etc) > > > > I was trying this: > > > > r=2*2*pi > > > Pole1=r*exp(I*2*pi/3) > > > Pole2=-r > > > Pole3=r*exp(-I*2*pi/3) > > > Ts=0.1 > > > > z = exp(I*2*pi*Ts*f) > > > p = (2/Ts)*(z-1)/(z+1) > > > H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) > > > show(H) > > > > show() works fine, but if i want to use H function now: > > > > round(H(4).abs(),5) > > > > a have got "Type error" message :-\ > > > H as you've defined it isn't a function, it's an expression. Check > > the type so H(4) doesn't mean anything. You could try subs and > > substitute for p (I assume that's what you want evaluated at 4. > > > Cheers, > > > Tim. > > > --- > > Tim Lahey > > PhD Candidate, Systems Design Engineering > > University of Waterloohttp://www.linkedin.com/in/timlahey --~--~-~--~~~---~--~~ 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?
you mean for f? this: round(H.substitute(f=1),4) gives type error again :-( On Dec 9, 9:51 pm, Tim Lahey <[EMAIL PROTECTED]> wrote: > On Dec 9, 2008, at 1:46 PM, Sand Wraith wrote: > > > > > > > thank you! )) > > > but I need to use my values, now just variables (Ts,Pole1 etc) > > > I was trying this: > > > r=2*2*pi > > Pole1=r*exp(I*2*pi/3) > > Pole2=-r > > Pole3=r*exp(-I*2*pi/3) > > Ts=0.1 > > > z = exp(I*2*pi*Ts*f) > > p = (2/Ts)*(z-1)/(z+1) > > H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) > > show(H) > > > show() works fine, but if i want to use H function now: > > > round(H(4).abs(),5) > > > a have got "Type error" message :-\ > > H as you've defined it isn't a function, it's an expression. Check > the type so H(4) doesn't mean anything. You could try subs and > substitute for p (I assume that's what you want evaluated at 4. > > Cheers, > > Tim. > > --- > Tim Lahey > PhD Candidate, Systems Design Engineering > University of Waterloohttp://www.linkedin.com/in/timlahey --~--~-~--~~~---~--~~ 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?
thank you! )) but I need to use my values, now just variables (Ts,Pole1 etc) I was trying this: r=2*2*pi Pole1=r*exp(I*2*pi/3) Pole2=-r Pole3=r*exp(-I*2*pi/3) Ts=0.1 z = exp(I*2*pi*Ts*f) p = (2/Ts)*(z-1)/(z+1) H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) show(H) show() works fine, but if i want to use H function now: round(H(4).abs(),5) a have got "Type error" message :-\ On Dec 9, 2:11 am, bsdz <[EMAIL PROTECTED]> wrote: > (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?
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] Cool firefox extensions?
Hi all! Does anyone know any cool extensions for firefox? I know only ItIsAllText... For example i'd like to have syntax highlighting? (into the firefox text areas) --~--~-~--~~~---~--~~ 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] jsMath failed to set up properly (error code -7)
Hi all! I am running SAGE Version 3.1.4 on my XUbuntu ( 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:20 UTC 2008 i686 GNU/Linux), and then executing show("Test") in sage notebook i have this error message: >It looks like jsMath failed to set up properly (error code -7). I will try to >keep going, but it could get ugly. what is wrong with jsMath? --~--~-~--~~~---~--~~ 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: Unexpected changes in worksheet name.
So am i wrong? or it is a bug --~--~-~--~~~---~--~~ 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] Unexpected changes in worksheet name.
Hi! Here is my problem: 1. Creating a new worksheet, 2. Clicking at "Unnamed" in the title of page and entering new name "Test & Test: Test" 3. Save&Quit 4. Entering to "Test & Test: Test" worksheet 5. Save&Quit again 6 And name of this worksheet changed to:"Test & Test : Test" What is wrong with it? Now i am using sage: SAGE Version 3.1.2, Release Date: 2008-09-19 but in the older version of sage AFAIR i've used symbols "&" and ":" in the names of worksheet and it was ok. Thank you. --~--~-~--~~~---~--~~ 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: Can not delete worksheet.
Thank you )) now its OK On Sep 21, 5:25 pm, "Timothy Clemans" <[EMAIL PROTECTED]> wrote: > Hi, > > This and other bugs have been fixed in the latest release, 3.1.2. > > Timothy > > On Sun, Sep 21, 2008 at 7:23 AM, Sand Wraith <[EMAIL PROTECTED]> wrote: > > > Hi! > > > Using sage: > > SAGE Version 3.1.1, Release Date: 2008-08-17 > > > and can not delete worksheet: > > > 1) select worksheet "test" > > 2) press "delete" > > 3) now i can see "test" worksheet in Trash, > > 4) press "sign out" > > 5) stop sage > > 6) launch sage again > > 7) and now i see "test" worksheet in active section again! --~--~-~--~~~---~--~~ 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: Using Fourier transform in sage.
Thank you! :-) > sage: v = vector(CDF,[1..10]); v > (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0) > sage: w = v.fft(); w > (55.0, -5.0 + 15.3884176859*I, -5.0 + 6.88190960236*I, -5.0 + > 3.63271264003*I, -5.0 + 1.62459848116*I, -5.0, -5.0 - 1.62459848116*I, > -5.0 - 3.63271264003*I, -5.0 - 6.88190960236*I, -5.0 - > 15.3884176859*I) > sage: w.inv_fft() > (1.0 - 8.881784197e-17*I, 2.0 - 3.7437131288e-16*I, 3.0 + > 4.15667297272e-18*I, 4.0 + 4.46859877911e-16*I, 5.0 + > 4.33797144802e-16*I, 6.0 - 8.881784197e-17*I, 7.0 + > 4.61256576967e-17*I, 8.0 + 2.04083553579e-16*I, 9.0 - > 3.67679530233e-16*I, 10.0 - 2.15336379908e-16*I) > > > Thanks. > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ 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] Can not delete worksheet.
Hi! Using sage: SAGE Version 3.1.1, Release Date: 2008-08-17 and can not delete worksheet: 1) select worksheet "test" 2) press "delete" 3) now i can see "test" worksheet in Trash, 4) press "sign out" 5) stop sage 6) launch sage again 7) and now i see "test" worksheet in active section again! --~--~-~--~~~---~--~~ 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] Using Fourier transform in sage.
Hi all! Does anyone know where to find guide or example how to use Fourier transform and inverse Fourier transform in sage? Thanks. --~--~-~--~~~---~--~~ 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: Integral problems
i've find anothe way to solve my problems with rect-function: rect=lambda x: Piecewise([ [(-infinity,-1),(lambda x:0)], [(- 1, 1),(lambda x:1)], [( 1, infinity),(lambda x:0)] ])(x); now: plot(rect,-4,4) works, and: f=lambda x: rect(x)*x^2; plot(f,-4,4) works too :-) but now if want to use my function again, i can not: g(x)=1+f(x) so i must use only: g=lambda x:1+f(x) (and show(plot(g,-4,4),ymin=0) or numerical_integral(g,-4,4) works fine). definition like "g(x)=1+f(x)" is more comfort for me ( On Sep 15, 8:25 pm, "David Joyner" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 11:10 AM, Sand Wraith <[EMAIL PROTECTED]> wrote: > > > On Sep 13, 2:35 am, Jason Merrill <[EMAIL PROTECTED]> wrote: > >> On Sep 12, 4:48 pm, Sand Wraith <[EMAIL PROTECTED]> wrote: > > >> > Hi all! Help please again :-) > > >> > here is worksheet describes my problem: > > >> >http://75.75.6.176/home/pub/8/ > > >> > so, at the last stem i have wrong result: 0 instead of 2/3. > > >> > what i am doing wrong? > > >> It looks like there are a few problems here, but the main thing is > >> that when you call myrect(x), it just returns 0. > > >> def rect(tau=0,t=0): > >> if (t==tau) or (t==-tau): > >> return 0.5 > >> elif (t>-tau) and (t >> return 1 > >> else: > >> return 0; > > >> def myrect(x): > >> return rect(1,x); > > >> sage: myrect(x) > >> 0 > > >> The reason is that when you compare a symbolic variable, x, to a > >> number, 1, and force sage to come up with a True or False answer, as > >> if and elif do, the answer is basically always False. > > >> sage: bool(x == 1) > >> False > >> sage: bool(x < 1) > >> False > >> sage: bool(x > 1) > >> False > >> sage: bool(x < -1) > >> False > > >> etc. > > >> Because of this, when you call myrect(x), things fall down to the last > >> branch of your definition. When an expression appears as an argument > >> to a function, it is evaluated *before* the function is called. For > >> instance, look at > > >> sage: plot(myrect(x),(x,-3,3)) # The line segment y == 0 > > >> In this case, myrect(x) evaluates to 0 *before* plot has a chance to > >> pass in any values, and the same thing is happening to integral. > > >> I'd like to tell you that you can do what you want using piecewise, or > >> something like that, but actually I don't see any way at all to make > >> integral, which needs something that can act like a SymbolicExpression > >> as its first argument, do what you want. Maybe someone else will > >> know. > > >> Regards, > > >> JM > > > I have redefine rect function: > > rect=Piecewise([ > > [(-10,-1),(lambda x:0)], > > [(- 1, 1),(lambda x:1)], > > [( 1, 10),(lambda x:0)] > > ]); > > > and i have another two questions: > > > 1) rect.plot() - is it the only way of plotting? i'd like to use > > Yes, this is the only way to plot rect at the moment. > > > plot(rect,-4,4), but it leads to error: > > >>verbose 0 (3729: plot.py, __call__) there were 4 extra arguments > >>(besides at 0xa9382cc>) > >>Traceback (click to the left for traceback) > >>... > >>UnboundLocalError: local variable 'G' referenced before assignment > > > 2)How can i define another function like rect*f(x) ? and plot it? > > For some reason, * is not working. You can just redefine your > function: for example, > > rect2 = Piecewise([[(-10,-1),(lambda x:0)], [(- 1, 1),(lambda > x:sin(x))], [( 1, 10),(lambda x:0)]]) > > --~--~-~--~~~---~--~~ 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: Integral problems
On Sep 13, 2:35 am, Jason Merrill <[EMAIL PROTECTED]> wrote: > On Sep 12, 4:48 pm, Sand Wraith <[EMAIL PROTECTED]> wrote: > > > Hi all! Help please again :-) > > > here is worksheet describes my problem: > > >http://75.75.6.176/home/pub/8/ > > > so, at the last stem i have wrong result: 0 instead of 2/3. > > > what i am doing wrong? > > It looks like there are a few problems here, but the main thing is > that when you call myrect(x), it just returns 0. > > def rect(tau=0,t=0): > if (t==tau) or (t==-tau): > return 0.5 > elif (t>-tau) and (t return 1 > else: > return 0; > > def myrect(x): > return rect(1,x); > > sage: myrect(x) > 0 > > The reason is that when you compare a symbolic variable, x, to a > number, 1, and force sage to come up with a True or False answer, as > if and elif do, the answer is basically always False. > > sage: bool(x == 1) > False > sage: bool(x < 1) > False > sage: bool(x > 1) > False > sage: bool(x < -1) > False > > etc. > > Because of this, when you call myrect(x), things fall down to the last > branch of your definition. When an expression appears as an argument > to a function, it is evaluated *before* the function is called. For > instance, look at > > sage: plot(myrect(x),(x,-3,3)) # The line segment y == 0 > > In this case, myrect(x) evaluates to 0 *before* plot has a chance to > pass in any values, and the same thing is happening to integral. > > I'd like to tell you that you can do what you want using piecewise, or > something like that, but actually I don't see any way at all to make > integral, which needs something that can act like a SymbolicExpression > as its first argument, do what you want. Maybe someone else will > know. > > Regards, > > JM I have redefine rect function: rect=Piecewise([ [(-10,-1),(lambda x:0)], [(- 1, 1),(lambda x:1)], [( 1, 10),(lambda x:0)] ]); and i have another two questions: 1) rect.plot() - is it the only way of plotting? i'd like to use plot(rect,-4,4), but it leads to error: >verbose 0 (3729: plot.py, __call__) there were 4 extra arguments >(besides at 0xa9382cc>) >Traceback (click to the left for traceback) >... >UnboundLocalError: local variable 'G' referenced before assignment 2)How can i define another function like rect*f(x) ? and plot 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] Accessing spline like function?
Hello, tell please, how to access spline like function? for example i have: p=list(); p.append([1,1]); p.append([2,1.5]); p.append([3,2]); p.append([4,0]); s=spline(p) and i can get value of s in any point: s(1) or s(3) etc. so, i want to use this spline like function: g(x)=s(x)+1; or def g(x): return s(x)*sin(x); or for example what should i do to integrate s? --~--~-~--~~~---~--~~ 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: Integral problems
Thank you, i shell read more about piecewise, :-) --~--~-~--~~~---~--~~ 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] Integral problems
Hi all! Help please again :-) here is worksheet describes my problem: http://75.75.6.176/home/pub/8/ so, at the last stem i have wrong result: 0 instead of 2/3. what i am doing wrong? --~--~-~--~~~---~--~~ 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: Wrong plotting!
On Sep 9, 1:29 am, Jason Merrill <[EMAIL PROTECTED]> wrote: > On Sep 8, 4:12 pm, Sand Wraith <[EMAIL PROTECTED]> wrote: > > > > > Hi all! > > > I do not know - it is an bug, or my mistake. I am trying to plot sum > > of a few same functions: > > > This is my function: > > B=10*sqrt( pi)/7; > > b=pi/7; > > c(f)=B*exp(-(b*f)^2); > > plot(c(f),(f,-5,5)); > > > in the output i see correct graphic. > > > Then i have define a function to calculate sum: > > > def specsum(x,Fdesc): > > result=0; > > for i in range(-2,3): > > xi=i*Fdesc; > > result+=c(x-xi); > > return result; > > > then plotting... > > > p1=plot(specsum(x,5),(x,-2.5,2.5)); > > > show(p1) > > > i see graphic, and i think its wrong, because then x -3..-1 it cross > > the X-Axis. then i thought that it is wrong axis, ... > > This graphic is fine. It's just that the horizontal axis is not at > y==0, which you can see by reading the values off of the y axis. You > can do > > sage: show(p1,ymin=0) > > if you want the horizontal axis drawn at y==0. There may be a way to > set the position of the axes origin more directly. If not, maybe > there should be. > > Regards, > > JM Thank you!! --~--~-~--~~~---~--~~ 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] Wrong plotting!
Hi all! I do not know - it is an bug, or my mistake. I am trying to plot sum of a few same functions: This is my function: B=10*sqrt( pi)/7; b=pi/7; c(f)=B*exp(-(b*f)^2); plot(c(f),(f,-5,5)); in the output i see correct graphic. Then i have define a function to calculate sum: def specsum(x,Fdesc): result=0; for i in range(-2,3): xi=i*Fdesc; result+=c(x-xi); return result; then plotting... p1=plot(specsum(x,5),(x,-2.5,2.5)); show(p1) i see graphic, and i think its wrong, because then x -3..-1 it cross the X-Axis. then i thought that it is wrong axis, so trying to plot my own zero-line: p2=line([[-10,0],[10,0]]); show(p2) and then trying to plot both graphics: show(p1+p2) only now i see correct graphic. so... is it bug or my mistake (and what can i do to avoid it in future?) Sage worksheet: http://75.75.6.176/home/pub/2/ --~--~-~--~~~---~--~~ 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: X range (plotting).
William Stein wrote: > On Thu, May 1, 2008 at 8:31 AM, Sand Wraith <[EMAIL PROTECTED]> wrote: > > > > > > Hi! I use notebooks, and for example i want to plot cosine function: > > > > plot(cos(x),1,2) > > > > in output i see graphic which have x in range near [-1.5,2.5]. but > > there is no information for me when x is in interval [-1.5,1] and > > [2,2.5], so i do not want to see it in output graphic. > > > > and another example: i have hight-frequency cosine function, and i > > want to see it on interval x in [1,1.1]: > > plot(cos(x*20),1,1.1) > > and i see x in [-1,1.25] so i can not "zoom" cosine function. > > > > This is a *bug* in the plotting function that we are tracking here: >http://trac.sagemath.org/sage_trac/ticket/2754 > > There is fortunately a workaround, which is to explicitly > specify the ranges in the show command: > > sage: plot(cos(x),1,2).show(xmin=1,xmax=2) > > sage: > plot(cos(x*20),1,1.1,plot_points=1,thickness=.1).show(xmin=1,xmax=1.1) > > -- William thank you! at least it is works now )) and i have another question: can image resolution be changed? (all images now are 600*370) --~--~-~--~~~---~--~~ 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] X range (plotting).
Hi! I use notebooks, and for example i want to plot cosine function: plot(cos(x),1,2) in output i see graphic which have x in range near [-1.5,2.5]. but there is no information for me when x is in interval [-1.5,1] and [2,2.5], so i do not want to see it in output graphic. and another example: i have hight-frequency cosine function, and i want to see it on interval x in [1,1.1]: plot(cos(x*20),1,1.1) and i see x in [-1,1.25] so i can not "zoom" cosine function. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---