turns out that I had to move the negative over on the udot and vdot 
equations. then it worked. However I am having difficulties now on using a 
graphics_array with 3dplots.

code:
 
pcl1=plot3d(L1(0.5,k,m), (k, -0.5, 0.5), (m, -0.5, 0.5), 
axes_labels=['k','m','L1'], frame=True)

pcl2=plot3d(L2(0.5,k,m), (k, -0.5, 0.5), (m, -0.5, 0.5), 
axes_labels=['k','m','L2'], frame=True)

pkl1=plot3d(L1(c,0.5,m), (c, -0.5, 0.5), (m, -0.5, 0.5), 
axes_labels=['c','m','L1'], frame=True)

pkl2=plot3d(L2(c,0.5,m), (c, -0.5, 0.5), (m, -0.5, 0.5), 
axes_labels=['c','m','L2'], frame=True)

pml1=plot3d(L1(c,k,0.5), (c, -0.5, 0.5), (k, -0.5, 0.5), 
axes_labels=['c','k','L1'], frame=True)

pml2=plot3d(L2(c,k,0.5), (c, -0.5, 0.5), (k, -0.5, 0.5), 
axes_labels=['c','k','L2'], frame=True) 

show(graphics_array([pcl1,pcl2,pkl1,pkl2,pml1,pml2],3,2), frame = True, 
axes = True)


error:
 
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

/home/eric/<ipython console> in <module>()

/home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/plot/plot.pyc
 
in graphics_array(array, n, m)
2149 n = int(n)
2150 m = int(m)
-> 2151 array = reshape(array, n, m)
2152 return GraphicsArray(array)
2153 

/home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/plot/plot.pyc
 
in reshape(v, n, m)
2068 if not isinstance(v[0], Graphics):
2069 # a list of lists -- flatten it
-> 2070 v = sum([list(x) for x in v], [])
2071 
2072 # Now v should be a single list.

TypeError: 'sage.plot.plot3d.parametric_surface.ParametricSurface' object 
is not iterable


On Wednesday, January 16, 2013 4:01:29 AM UTC-8, David Joyner wrote:
>
> On Tue, Jan 15, 2013 at 7:32 PM, Eric Kangas 
> <eric.c...@gmail.com<javascript:>> 
> wrote: 
> > Hi, 
> > 
> >      I am using sage 5.6 on cantor 0.3. I am working on trying to find 
> the 
> > eigenvalues, and vectors for a damped harmonic oscillator. I am using 
> the 
> > form using the undamped angular frequency of the oscillator, and damping 
> > ratio. 
> > 
> > code: 
> > 'define in variables' 
> > 
> > c,k,l,m,x,y,u,v,xdot,ydot,udot,vdot = 
> > var('c,k,l,m,x,y,u,v,xdot,ydot,udot,vdot', domain = RR) 
> > 
> > I = var('I', domain = QQ) 
> > 
> > 
> > 'undamped angular frequency' 
> > 
> > s = c/(2*sqrt(m*k)) 
> > 
> > 
> > 'damping ratio' 
> > 
> > wo=sqrt(k/m) 
> > 
> > 
> > 'first ode equations for the damping oscillator' 
> > 
> > xdot = u; 
> > 
> > ydot = v; 
> > 
> > -udot = 2*s*wo*u+(wo^2)*x; 
> > 
> > -vdot = 2*s*wo*v+(wo^2)*y; 
> > 
>
>
> sage: 'define in variables' 
> 'define in variables' 
> sage: c,k,l,m,x,y,u,v,xdot,ydot,udot,vdot = 
> var('c,k,l,m,x,y,u,v,xdot,ydot,udot,vdot', domain = RR) 
> sage: I = var('I', domain = QQ) 
> sage: 
> sage: 'undamped angular frequency' 
> 'undamped angular frequency' 
> sage: s = c/(2*sqrt(m*k)) 
> sage: 
> sage: 'damping ratio' 
> 'damping ratio' 
> sage: wo=sqrt(k/m) 
> sage: 
> sage: 'first ode equations for the damping oscillator' 
> 'first ode equations for the damping oscillator' 
> sage: xdot = u; 
> sage: ydot = v; 
> sage: -udot == 2*s*wo*u+(wo^2)*x; 
> sage: -vdot == 2*s*wo*v+(wo^2)*y; 
>
> worked for me. Did you know that you do not need semi-colons in Python? 
> That is maple notation and GAP notation. Also, in Python, = 
> is an assignment operator. == is used if you want to write down an 
> equation, 
> eg 
>
> sage: eqn = 1==2 
> sage: bool(eqn) 
> False 
>
>
> > 
> > I get an error at this point: 
> > 
> > ------------------------------------------------------------ 
> > File "<ipython console>", line 1 
> > SyntaxError: can't assign to operator (<ipython console>, line 1) 
> > ------------------------------------------------------------ 
> > File "<ipython console>", line 1 
> > SyntaxError: can't assign to operator (<ipython console>, line 1) 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-support" group. 
> > To post to this group, send email to 
> > sage-s...@googlegroups.com<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > sage-support...@googlegroups.com <javascript:>. 
> > Visit this group at http://groups.google.com/group/sage-support?hl=en. 
> > 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to