Ask Your Question

j0nr's profile - activity

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

Hi,

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/function_file.py

This would help keep things a bit tidier.

Thanks in advance.

2015-02-28 03:08:15 -0500 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 05:39:47 -0500 commented answer How Do I Create/Plot Array of Calculated Values

Always like tips for neater/minimal code, thanks.

2015-02-27 05:17:51 -0500 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 05:12:23 -0500 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 10:25:46 -0500 received badge  Student (source)
2015-02-26 04:58:20 -0500 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 03:50:39 -0500 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 13:03:05 -0500 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.