Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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. So the basic formula is:

$mrw^2*cos\theta$

where $mrw$ 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(adjacent \theta)$ copy it down and then I could plot XY ($\theta$ vs $mrw^2$)

In a programatic way, I would do something like create an array, for x = 0 to 360 in increments of 5 array(x) = mrw^2cos(x)

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

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

Thanks in advance.

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. So the basic formula is:

$mrw^2*cos\theta$$mrw^2\cos\theta$

where $mrw$ $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) 0,5,10,15,...,350,355,360) and then in the next column I would have $mrw^2*cos(adjacent \theta)$ $mrw^2\cos \theta$, copy it down and then I could plot XY ($\theta$ vs $mrw^2$)$mrw^2$).

In a programatic programmatic way, I would do something like like
-
create an array, array,
-
for x = 0 to 360 in increments of 5 array(x) 5:
      array(x)
= mrw^2cos(x)mrw^2*cos(x)

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

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

Thanks in advance.

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, object rotating around a fixed axis. So the The basic formula is:

$mrw^2\cos\theta$

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,
array, - for x = 0 to 360 in increments of 5:
      array(x)
5: array(x) = mrw^2*cos(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.