Ask Your Question

G B's profile - activity

2022-07-08 15:16:59 +0200 received badge  Notable Question (source)
2021-05-18 16:06:54 +0200 received badge  Notable Question (source)
2020-06-06 07:43:36 +0200 received badge  Popular Question (source)
2020-04-19 15:29:27 +0200 received badge  Notable Question (source)
2019-11-30 10:11:47 +0200 received badge  Famous Question (source)
2016-06-01 13:58:17 +0200 received badge  Popular Question (source)
2016-04-26 13:24:54 +0200 received badge  Nice Question (source)
2016-04-20 01:14:14 +0200 asked a question laplace(heaviside(t),t,s) doesn't return 1/s
var('s')
var('t',domain='positive')
laplace(heaviside(t),t,s)

returns an unevaluated function object in stead of returning 1/s. Other functions such as sin(t) and dirac_delta(t) seem to give the correct results. Is this just a blind spot in laplace, or do I need to refine my domains on s or t?

If this transform just isn't implemented, is there an easy way for me to patch it locally?

2015-11-02 20:22:36 +0200 received badge  Notable Question (source)
2015-10-16 02:33:06 +0200 received badge  Taxonomist
2015-02-28 07:35:48 +0200 received badge  Popular Question (source)
2013-08-28 05:13:37 +0200 received badge  Popular Question (source)
2012-12-05 23:41:45 +0200 received badge  Nice Question (source)
2012-03-17 15:41:07 +0200 received badge  Student (source)
2012-03-16 18:44:12 +0200 asked a question css print stylesheet

What stylesheet is used when printing? It doesn't seem to be notebook.css.

Background: Originally I wanted the text size to scale depending on whether I was inside or outside a notebook cell (make the text big when I'm editing, small when I'm not) but I can't seem to make that work.

Now I'm taking a new tack-- make input cell text small relative to text cell text when printing. The problem is that the notebook seems to use a different stylesheet when printing, so @media selectors aren't working.

Thanks--

2011-12-05 02:27:53 +0200 commented answer cell_resizer and the notebook CSS

It's been a while since I posted this, but I'm annoyed by my broken formatting again and making another attempt to get this to work. I made a few changes directly to that file to see if I could fix it, and never saw any impact. I then changed the return value of cell_blur to "false" which, according to the comments should be really bad, but it had no effect. Is that the right notebook_lib.js file?

2011-12-05 02:20:49 +0200 received badge  Scholar (source)
2011-12-05 02:20:49 +0200 marked best answer "and zero everywhere else"

This can be accomplished with the Heaviside step function, something that should be familiar in engineering (especially electrical engineering) contexts. Try sage: heaviside? to see the docsting. I'll give a one variable example that you can easily turn into a two variable example for your application:

sage: g(x) = (1-heaviside(x-pi/2)) * heaviside(x + pi/2)
sage: plot(g(x), (x, -pi, pi))
sage: plot( g(x) * cos(x), (x, -pi, pi))
2011-09-07 23:32:43 +0200 received badge  Editor (source)
2011-09-07 22:23:39 +0200 asked a question cell_resizer and the notebook CSS

I'm changing font sizes depending on whether a text area is being edited or not, and the enclosing text area height is being programmatically set wrong somewhere. I'm trying to figure out the right way of fixing this-- do I need to start editing javascript, and how do I do so in a way that doesn't break anything else or make updating Sage a nightmare.

Here's some more detail on the problem:

I've created a notebook.css (inserted at the bottom of this post) to reduce the font size on the input cells, because I want most of the focus on the text cells and result cells. That's a pain when I edit, so I increase the font size when the cell is being edited (I'm realizing it would be best to increase the font under a hover, but first things first).

The problem I'm having is that the font is changing as I'd hoped, but the size of the surrounding textarea is sized to hold the larger font even when the smaller font is displayed. It looks like this is happening because the "height" style is being set explicitly on a cell by cell basis, and it looks like that's happening in some javascript routine.

I've dug a bit into the javascript files, but I'm quickly getting lost. I'm not sure this is where the issue is, but it's my best guess so far. If someone could point me at the right file and where they reside in a Sage.app install, that would be a great help already.

Ideally I'd like a way to adjust this without having to modify the standard install. notebook.css is nice because it's local, but I'm not sure I can overload a javascript function in the same way.

My overall objective:

I'm trying to customize my notebook styling to further my goal of using Sage as a live documentation tool. I'm an engineer, and I want to use Sage to both help develop new designs and to document them-- as such, the math is essentially a means to an end. I want the emphasis on the results, but I want to retain the math/Python both so I can reconstruct my logic later, and to assist in peer review.

Here's my notebook.css:

h1 {font-size:32pt; color:rgb(50,200,200);}

div.text_cell p {font-size:14pt;}

textarea.cell_input {font-size:8pt; color:rgb(75,75,75);}

div.worksheet * {background-color:rgb(240,240,240);}

div.worksheet textarea.cell_input_active {background-color:transparent;}

div.worksheet span.typeset * {background-color:transparent;}

tr {border-color:rgb(240,240,240);}

td {border-left-color: rgb(240,240,240);}

Thanks-- Greg

2011-09-07 21:17:15 +0200 commented answer "and zero everywhere else"

That did it! Thanks!

2011-09-07 21:16:34 +0200 received badge  Supporter (source)
2011-08-26 21:47:47 +0200 commented question "and zero everywhere else"

It's only "doom" because I'd feel like I failed. I'm documenting a new algorithm, and I'm giving Sage another go as a means of doing live documentation. I've been trying to keep as much of the flow symbolic as possible because a sequence of equations is easier for the audience to follow than Python. I could, of course, simply typeset equations for documentation and implement them in Python, but executing the symbolics directly minimizes the chance that the math and the execution diverge. For this particular equation, I'm modeling an antenna pattern, and the model really only fits for the main lobe. The back lobe should be modeled as zero.

2011-08-25 23:08:03 +0200 commented question "and zero everywhere else"

What I mean by 3pi/2==-pi/2 is that I want to accommodate the periodicity of the cosine. I have rotational symmetry in my problem, and don't want to concern myself with whether the input allows negative angles, or allows angles greater than 2pi. I suppose that's a separate problem from the question I asked...

2011-08-25 20:52:32 +0200 asked a question "and zero everywhere else"

I'm trying to create a symbolic function in two variables that returns cos(x)cos(y) for -pi/2<=x<=pi/2 and -pi/2<=y<=pi/2, and zero everywhere else.

I've dug around in the piecewise documentation and I'm running up against a few limitations:

-- no infinite intervals prevents the "everywhere else" construct.

-- I don't think there's a way to express the fact that 3*pi/2 == -pi/2

-- I haven't had much luck defining a piecewise function in two variables.

Is there a way to do this, or am I doomed to a python function and if/else statements?

Thanks--

Greg