Ask Your Question

Masacroso's profile - activity

2019-07-31 13:21:50 -0600 commented answer Trying to get the divided differences of a list of points

@JohnPalmieri you are totally right, I didn't see the examples (I dont know why, maybe I was seeing a different doc? I dont know). My bad.

2019-07-27 03:36:04 -0600 asked a question Trying to get the divided differences of a list of points

I was trying to get the divided differences of a list of points, then I had written

divided_difference((0,1), (1,4.5), (3,14.5), (5,28.5), (6,37)) but when I tried to execute it the notebook spit out


NameError Traceback (most recent call last) <ipython-input-1-7581bf64e41a> in <module>() ----> 1 divided_difference((Integer(0),Integer(1)), (Integer(1),RealNumber('4.5')), (Integer(3),RealNumber('14.5')), (Integer(5),RealNumber('28.5')), (Integer(6),Integer(37)))

NameError: name 'divided_difference' is not defined


However the function divided_difference appear in the manual of SAGE related to polynomials. What Im doing wrong?

2019-05-14 20:33:35 -0600 commented question plotting complicated function

well, in first place note that $$T_a(x)=x^{-1}-\lfloor \lfloor x^{-1}\rfloor +\{x^{-1}\}-r\rfloor=\{x^{-1}\}-\lfloor \{x^{-1}\}-r\rfloor=\{x^{-1}\}+[r>\{x^{-1}\}]$$ for $r\in[0,1]$ and where $[\cdot ]$ is an Iverson bracket and $\{x^{-1}\}$ is the fractional part of $x^{-1}$. But then note that $T_a(T_a((x))$ is not defined when $\{ x^{-1} \}=0$ and $r\le \{x^{-1}\}$.

2019-05-13 11:07:26 -0600 commented question plotting complicated function

I suspect that you want to write $|T_a(x)|^k$ instead of $T_a^n(x)$, right? Otherwsie, what means $T^n$ here?

2019-04-24 01:48:04 -0600 received badge  Famous Question (source)
2019-03-18 03:58:03 -0600 received badge  Notable Question (source)
2018-09-22 10:23:46 -0600 received badge  Notable Question (source)
2018-06-08 15:32:12 -0600 received badge  Popular Question (source)
2018-03-13 11:51:41 -0600 received badge  Notable Question (source)
2017-12-08 17:47:49 -0600 received badge  Popular Question (source)
2017-09-26 10:08:23 -0600 asked a question Slight fix of a plot of a discontinuous function

Probably this question must be asked zillion of times but I dont know how to search it properly. So my apologies to repeat something that surely was asked before.

My question: I have defined a piecewise function and it plot with this code

x=var('x'); f1=x^2+2*x;f2=x;f3=-1;f=piecewise([((-oo,-1), f1),([-1,1],f2),((1,oo), f3)]);plot(f,x,-5,5,ymax=2)

Now I want to quit the line that join the jump discontinuity at x=1, or change it by a dashed line, but I dont know how to do it.

2016-11-05 04:42:15 -0600 commented question What is the problem with that integral ?

I tried evaluate the integral with maple and mathematica and the first just dont evaluate it numerically, and the second get timeout. If you get some answer using python it is very fine! But it must be fixed in sage, ofc.

2016-11-05 02:49:01 -0600 commented question What is the problem with that integral ?

@dx6665 you can check the functionality of mathematica here.

2016-11-05 02:46:59 -0600 commented question What is the problem with that integral ?

I think that the problem here is that each integral is evaluated without taking in account the constraints of the other integrals, so it is possible that the inner integral diverges depending in the values of $x$ and $z$. If this is true then putting some constraints before to the integral on $x$ and $z$ probably help in this problem.

2016-11-05 00:43:48 -0600 commented question What is the problem with that integral ?

It seems that the inner integral doesnt converge. Try to do only the inner integral in any CAS (including mathematica).

2016-11-05 00:11:37 -0600 commented question What is the problem with that integral ?

The first integral doesnt work, so the others two integrals neither.

2016-11-04 09:35:14 -0600 commented answer How to add tick marks or control them in the frame of 3d plots?

Yep, this is a very good idea. Unfortunately my programming skills are low, so I cant contribute to sage :(

2016-11-04 04:50:12 -0600 received badge  Nice Answer (source)
2016-11-03 16:52:30 -0600 received badge  Nice Answer (source)
2016-11-03 07:52:06 -0600 commented answer Numerical real solution of derivative

@kcrisman, yes, I noticed. What is fun is that mathematica do the same thing: a numerical computation. But a lazy search on wolframalpha does the exact solution, i.e. a symbolic solution... LOL.

2016-11-03 06:37:27 -0600 received badge  Associate Editor (source)
2016-11-03 05:51:23 -0600 answered a question Numerical real solution of derivative

Ok, I see what is happening. The derivative of your function (the example that you put) is not bounded on the interval $(0,1)$, i.e. it is not defined in the points $-1/2$ and $1/2$ where it is going to infinity.

But sage works fine, it said that the maximum is in $1/2$ because it is an asymptote. In other words

$$\lim_{x\to\frac12^-}\frac{\mathrm d}{\mathrm dx}\left(\frac12(\log(2.02x + 1) + \log( -2x + 1) )\right)=+\infty$$


$$\lim_{x\to\frac12^+}\frac{\mathrm d}{\mathrm dx}\left(\frac12(\log(2.02x + 1) + \log( -2x + 1) )\right)=-\infty$$

Check this:*+x+%2B+1)+%2F+2+%2B+log(+-2+*+x+%2B+1)+%2F+2,x)+when+x-%3E1%2F2

So, Sage is not doing wrong... it is doing the "correct" answer. Well, the correct answer will be to say that there is no maximum in the interval, because the function is not bounded.

But if you change your interval by $(0,1/2)$ then you get the answer of $\approx 0.01$, check this. I tested in all the other major CAS with the same both results ;)

P.S.: the maximum in the interval $(0,1/2)$ is exactly $0.01$. It would be interesting to see how to get this answer directly. From mathematica I get something similar to sage, but maple and wolframalpha let me exactly the correct value. I will test geogebra now.

P.S2: geogebra found the exact value too.

2016-11-03 04:45:38 -0600 commented question Numerical real solution of derivative

Check this. It seems to work fine. If you need precision it is possible you need to use octave or matlab instead of sage.

2016-11-02 23:11:35 -0600 commented answer Sage seems to be improperly computing an infinite sum, and giving an incorrect answer

If you use simplify over the expression for the sum you get some kind of "double fraction" like 1/2/... what is a bit strange. See here. Maybe this is unrelated to the problem and is just some kind of non very standard notation.

2016-11-02 23:11:35 -0600 received badge  Commentator