Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joe Riel Newsgroups: comp.soft-sys.math.maple Subject: Re: Multiple plots with stepped parameters Date: Sun, 19 Jun 2011 13:46:03 -0700 Organization: A noiseless patient Spider Lines: 45 Message-ID: <874o3lim7o.fsf@san.rr.com> References: <9671hcFjfmU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="7daQ3AF9ALJlnU9jGWSG5Q"; logging-data="14785"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+37zjdYRxFHF3Ty0Nqnnr1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:+1S0yXUDI97QsAX63oZ1pp45Y3Q= sha1:p4KMyeAX2yQaAuEHq+abl2mpxAQ= Xref: x330-a1.tempe.blueboxinc.net comp.soft-sys.math.maple:186 Axel Vogt <&noreply@axelvogt.de> writes: > On 19.06.2011 20:21, Salmon Egg wrote: >> My example will based upon blackbody radiation. Suppose the emission at >> a frequency nu at various temperatures goes like >> >> J := 1/(exp(nu/T)-1) >> >> How do I plot J against nu for all T in a list like >> >> {0.5, 1.0. 2.0, 5.0, 10.0}? >> >> I think I see how to do that if I listed separate functions in the plot >> command. ie >> >> 1/(exp(nu/0.5)-1), 1/(exp(nu/1.0)-1), ... >> > > You may have a scaling problem for showing it, but for example: > > L:=[0.5, 1.0. 2.0, 5.0, 10.0]; # use an ordered list, not a set > > P:=NULL; > for t in L do # run through the list > eval(J, nu=t); # evaluate expression > plot(%, T=0 .. 1); # plot for each > P:=P, %; # remember it > end do: > > plots[display](P); # print A minor comment. Axel's solution is fine for this application, but building a list like that, term by term, is an O(n^2) process, so that if L gets long enough, you could have issues. Fortunately, the list building can be done in O(n) by using seq: plots:-display(seq(plot(eval(J,nu=t),T=0..1), t in L)); That is unlikely to be an issue here since the number of plots one is likely to create in one graph is presumably fairly small. Because most of the time is in the plot building (and that is O(n) with either approach), Axel's method is suitable. -- Joe Riel