Ask Your Question

j0nr's profile - activity

2020-02-16 15:32:39 +0100 received badge  Famous Question (source)
2019-04-26 07:19:41 +0100 received badge  Famous Question (source)
2017-10-08 21:59:04 +0100 received badge  Notable Question (source)
2017-07-24 11:32:31 +0100 received badge  Popular Question (source)
2017-07-24 11:32:31 +0100 received badge  Notable Question (source)
2016-12-16 02:06:26 +0100 received badge  Popular Question (source)
2016-09-16 00:00:00 +0100 received badge  Nice Question (source)
2016-02-06 20:32:26 +0100 received badge  Famous Question (source)
2015-10-28 09:36:20 +0100 received badge  Popular Question (source)
2015-10-28 09:36:20 +0100 received badge  Notable Question (source)
2015-03-05 20:51:27 +0100 asked a question Import Module from Another File in Cloud


I am using Sage in the cloud. I have a project folder (obviously) and within that I created a worksheet and a sub-dir called "functions". Can I create files within "function" and then import modules from within those files in my main worksheet.

e.g. in top level main file:

import myFunc from functions/

This would help keep things a bit tidier.

Thanks in advance.

2015-02-28 10:08:15 +0100 commented question HTML Input Page

Thanks for the links. I guess I am just asking as you can create nice little HTML segments (%html) and seems a shame that you can't link <input> boxes to vars...

2015-02-27 12:39:47 +0100 commented answer How Do I Create/Plot Array of Calculated Values

Always like tips for neater/minimal code, thanks.

2015-02-27 12:17:51 +0100 asked a question HTML Input Page

I am just starting to look at SageMath and I like it a lot.

I am wondering if it is possible to create a kind of app (I am using the cloud version). I know how to render html (%html or even %md) so I know I could create a nice looking form with some input boxes.

Is it then possible to "submit" the form and then have the input values passed to another worksheet which has all the calculations on it...then the results get posted back to the nice HTML "front GUI" page...mostly in the forms of plots?

I have a worksheet going that is full of code that create the necessary plots...the input variables are just set manually at the top, e.g.:

var1 = 1
var2 = 2

and so on. So I am wondering if I can link the html form input boxes on the front sheet to these vars, run the rest of the code on that worksheet, then present the results (plots) back on the front page?

Very similar to the way one would right HTML, submit it to a PHP file, which in turn would produce HTML results...

Thanks in advance!

2015-02-27 12:12:23 +0100 commented question Formatting Plots (list_plot)

I think the biggest thing I found was that by default, list_plot just plots points. After setting plotjoined=True that helped a lot!

2015-02-26 17:25:46 +0100 received badge  Student (source)
2015-02-26 11:58:20 +0100 asked a question Formatting Plots (list_plot)

Hi All,

Sorry if this is going to be a silly question, but being new to Sage, I am struggling to find answers. I am creating a plot using list_plot (its a zip of two lists). Actually, I have 2 plots overlaid, which works fine.

I just can't figure out how to format the plot. I want to be in control of:

  • Scales of axis (e.g. my x-axis is 0-360, but the divisions by default are in 50s. I want to show 0/90/180/270/360)
  • the divisions of th Y axis, say every 500. Can you control both major and minor ticks?
  • The linestyle of both individual plots

So I am just unsure how to do this formatting, especially with list_plot(), as all the documentation I have found is based on just plot()

Thanks in advance.

2015-02-26 10:50:39 +0100 answered a question How Do I Create/Plot Array of Calculated Values

Ah, excellent, thank you very much. This is very helpful, both of you.

2015-02-25 20:03:05 +0100 asked a question How Do I Create/Plot Array of Calculated Values

Hi All,

First time user of SageMath here. Just trying to find out how to do things.

I wish to calculate the components of a rotating force of an object rotating around a fixed axis. The basic formula is $$mrw^2\cos\theta,$$ where $m$, $r$, $w$ are known values and $\theta$ is a simple angle from 0 to 360 degree, i.e. 1 revolution.

In a spreadsheet I would just have a column with values of $\theta$ (e.g. 0,5,10,15,...,350,355,360) and then in the next column I would have $mrw^2\cos \theta$, copy it down and then I could plot XY ($\theta$ vs $mrw^2$).

In a programmatic way, I would do something like

- create an array,
- for x = 0 to 360 in increments of 5:
      array(x) = m*r*w^2*cos(x)

You see how I'm going. How do I accomplish this in Sagemath? It's just about learning the syntax methinks, as I know what I want to achieve, it's just how.

Love the look of Sagemath, would really like to use it a lot.

Thanks in advance.