Path: news.mathworks.com!newsfeed-00.mathworks.com!oleane.net!oleane!news.ecp.fr!news.germany.com!newsfeed-0.progon.net!progon.net!feeder1.cambrium.nl!feed.tweaknews.nl!138.199.65.86.MISMATCH!sn-xt-ams-06!sn-xt-ams-04!sn-post-ams-02!sn-post-sjc-01!supernews.com!corp.supernews.com!dialup-4.232.0.59.dial1.losangeles1.level3.net!user
From: ellieandrogerxyzzy@mindspring.com.invalid (Roger Stafford)
Newsgroups: comp.soft-sys.matlab
Subject: Re: syms and vpa problem
Date: Tue, 07 Aug 2007 15:30:17 -0700
Organization: -
Message-ID: <ellieandrogerxyzzy-0708071530170001@dialup-4.232.0.59.dial1.losangeles1.level3.net>
References: <1186516859.503046.118710@22g2000hsm.googlegroups.com>
X-Complaints-To: abuse@supernews.com
Lines: 68
Xref: news.mathworks.com comp.soft-sys.matlab:422843


In article <1186516859.503046.118710@22g2000hsm.googlegroups.com>, P
<prashanthramu@gmail.com> wrote:

> Hi all,
> 
> I have a variable called
> 
> sym_dPhi =
> -282270057375923/2361183241434822606848*cos(phis
>
+2835403426559781/1125899906842624)-5849622991223293/18889465931478580854784*cos(phis
>
+1649123417284613/281474976710656)+8867307977828847/75557863725914323419136*cos(phis
>
+1667188769632673/281474976710656)-6776253911855553/18889465931478580854784*cos(phis
>
+5867111522062989/9007199254740992)+7154406299740559/75557863725914323419136*cos(phis
> +6355945788037667/1125899906842624)
> 
> where phis is created as syms phis.
> 
> vpa(sym_dyPhi,5) yields me
> ans =
> 
> [ empty sym ]
> 
> Why ?
> 
> 
> On a parallel line ...
> 
> >> syms B
> >> syms c; B = 1 + pi + c
> 
> B =
> 1165754695714211/281474976710656+c
> 
> >> vpa(B,2)
> ans =
>  4.1+c
> 
> Works !
> 
> How come ? What am I doing wrong ? Any suggestions ?
> 
> Thanks,
> ethnicatom
----------------------
  With my ancient version of matlab (4a), 'sym' variables are simply
strings.  When I copy your string with its five cosine functions into a
single long string on the command line to define a symbolic variable,
matlab complains that it can't see the end of the string.  When I break it
up into five separate command line strings and then concatenate them into
a single string, it works fine.  The answer is:

vpa(f,5)

ans =

-.11955e-6*cos(phis+2.5183)-.30968e-6*cos(phis+5.8589)+.11736e-6*cos(phis+5.9230)-.35873e-6*cos(phis+.65138)+.94688e-7*cos(phis+5.6452)

  So, at least in my case, the trouble seems to be due to the allowable
length of the command line string, not the length of string matlab's Maple
can handle.  It seems possible that your trouble may also be due to some
such limitation on the command line string length, even if your Symbolic
Toolbox itself may be very different from mine.

Roger Stafford