Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Joe Riel Newsgroups: comp.soft-sys.math.maple Subject: Re: Vectors in the Physics package Date: Fri, 14 Nov 2014 07:38:35 -0800 Organization: A noiseless patient Spider Lines: 65 Message-ID: <87sihldc78.fsf@san.rr.com> References: <87oasakjdd.fsf@san.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="15591ad2607da309a0d1a78a1d632bc7"; logging-data="19133"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4GrQxArWO/mDV4x8dJyao" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:59rOGqqHQfC6FoISwSV0WRasNiE= sha1:uPLn1+E1DFWnLJr2NPPKx020sjI= Xref: csiph.com comp.soft-sys.math.maple:1029 rouben@shadow.(none) (Rouben Rostamian) writes: > In article , > none) (Rouben Rostamian wrote: >>In article <87oasakjdd.fsf@san.rr.com>, Joe Riel wrote: >>>rouben@shadow.(none) (Rouben Rostamian) writes: >>> >>>> This is a question about Physics[Vectors] package. >>>> >>>> Let's say we want to plot the helix v = [ cos(t), sin((t), t], where >>>> v is given as a Physics Vector. Here is what I do: >>>> >>>> restart; >>>> with(Physics[Vectors]): >>>> Setup(mathematicalnotation=true): >>>> with(plots): >>>> v_ := cos(t)*_i + sin(t)*_j + t*_k; >>>> spacecurve( [ Component(v_,1), Component(v_,2), Component(v_,3) ], >>>> t=0..4*Pi); >>>> >>>> This works fine, but the extraction of the components in the last >>>> line looks too clunky to me. Alternatively we may do >>>> >>>> spacecurve( [ v_ . _i, v_ . _j, v_ . _k ], t=0..4*Pi); >>>> >>>> which is a bit shorter, but I suspect that I am missing something >>>> more basic. I tried convert(v_, list) and convert(v_, Vector) >>>> but did not get anything useful. >>>> >>>> So the question is one of: >>>> a) Is there a command to convert v_ to a list or a Vector? >>>> b) Is there some other way to plot the spacecurve given by v_? >>> >>>You could do >>> >>> basis := [_i,_j,_k]: >>> >>>then >>> >>> spacecurve( v_.basis, t=0..4*Pi); >>> >>>does what you want. >> >>Perfect! Thanks for your valuable help, as always. > > Oops, I spoke too soon. Actually I spoke before trying > the suggested solution. In Maple 17 and 18 I get: > > restart; > with(Physics[Vectors]): > Setup(mathematicalnotation=true): > with(plots): > v_ := cos(t)*_i + sin(t)*_j + t*_k: > basis := [_i,_j,_k]: > spacecurve( v_.basis, t=0..4*Pi); > > Error, (in plots/spacecurv) first argument must be array, rtable, list or set > > Perhaps there is a typo in the suggested solution. Not a typo, but I only tested it on a beta version of Maple. In 18 you can can do map(`.`,basis,v_), which isn't as nice. -- Joe Riel