Adept Scientific - English
The world's best software and hardware for research, science and engineering.
flag arrow
clearclear

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Watch Maple Video Demonstrations
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request a Brochure
• Request an Evaluation
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 16 Overview
Maple 16 Professional
Maple 16 Academic
Maple 16 Student Use
What's New in Maple 16
Maple New Features
Datasheet

Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes

Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
Maple Features
The Maple Reporter Online

Service & Support

Maple Primes
blogs, forums etc

Elite Maintenance Program
Application Centre
Powertools
Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] Variables in an array

Search email archive for  

[MUG] Variables in an array
Author: Jonathan Dentch    Posted: 28/03/2000 22:04:00 GDT
>> From: Jonathan Dentch

I need to create an array of values. However, Maple
won't store the values when I use the variable q[].

C:=array(1..11,1..1,[[500.],[q[1]],[q[2]],[q[3]],[q[4]],[q[5]],[q[6]],[q[7]],[q[
8]],[q[9]],[123.23]]);
[ 500. ]
[ ]
[ q[1] ]
[ ]
[ q[2] ]
[ ]
[ q[3] ]
[ ]
[ q[4] ]
[ ]
C := [ q[5] ]
[ ]
[ q[6] ]
[ ]
[ q[7] ]
[ ]
[ q[8] ]
[ ]
[ q[9] ]
[ ]
[123.23]

> q:=seq(100./(360*i*0.25),i=1..9);

q := 1.111111111, .5555555555, .3703703703,
.2777777778,.2222222222, .1851851852, .1587301587,
.1388888889,.1234567901

> print(C);

[ 500. ]
[ ]
[ q[1] ]
[ ]
[ q[2] ]
[ ]
[ q[3] ]
[ ]
[ q[4] ]
[ ]
[ q[5] ]
[ ]
[ q[6] ]
[ ]
[ q[7] ]
[ ]
[ q[8] ]
[ ]
[ q[9] ]
[ ]
[123.23]

I wish C to be all numerics, not variables. Please
advise.

Thanks,
Jonathan Dentch
Rensselaer at Hartford



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

[MUG] Re: Variables in an array
Author: Maple Group    Posted: 31/03/2000 15:10:42 GDT
>> From: Maple Group

On Tue, 28 Mar 2000, Jonathan Dentch wrote:

|> I need to create an array of values. However, Maple
|> won't store the values when I use the variable q[].

|>
C:=array(1..11,1..1,[[500.],[q[1]],[q[2]],[q[3]],[q[4]],[q[5]],[q[6]],[q[7]],[q[
8]],[q[9]],[123.23]]);
|> > q:=seq(100./(360*i*0.25),i=1..9);

|> I wish C to be all numerics, not variables. Please
|> advise.

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Wed, 29 Mar 2000 14:34:18 -0500 (EST)
From: Edwin Clark
To: Jonathan Dentch
Subject: Variables in an array


Try this, which, by the way, is an easier way to
set up the matrix:

restart:
> with(linalg):Warning, new definition for norm
Warning, new definition for trace
> C:=transpose(matrix([[500.,seq(q[i],i=1..9),123.23]]));

Now you want to substitute certain values for
the variables q[i]. This can be done thusly:


qvalues:=seq(100./(360*i*0.25),i=1..9);

> subs(seq(q[i]=qvalues[i],i=1..9){},eval(C));


------------------------------------------------------
W. Edwin Clark
Department of Mathematics, University of South Florida,
4202 East Fowler Avenue, PHY 114, Tampa, FL 33620-5700
http://www.math.usf.edu/~eclark/
------------------------------------------------------



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Wed, 29 Mar 2000 14:55:06 -0800 (PST)
From: Robert Israel
To: Maple Users Group
Subject: Variables in an array




Try this (after assigning C and q as above):

> C:= map(eval,C);

Robert Israel
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 30 Mar 2000 10:54:40 +0200
From: Preben Alsholm
To:
Subject: Variables in an array

The following should do it:

C1:=map(eval,C);

Preben Alsholm
Technical University of Denmark


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 30 Mar 2000 12:04:45 +0200
From: Barsuhn
Subject: Variables in an array
To:

Dear Jonathan,
assignments outside an array, table or matrix do not directly cause
alterations inside these data structures. By redefining your array C via

C:=map(eval,C);
your values of the q[i] have entered C, as you may see by the
statements
print(C); or eval(C);
All the best Jurgen
--
-------------------
Prof. Dr. Jurgen Barsuhn
Fachhochschule Bielefeld
University of Applied Sciences
Fachbereich Elektrotechnik und Informationstechnik
D-33511 Bielefeld
-----------




-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 30 Mar 2000 13:26:01 +0200
From: Adri van der Meer
To:
Subject: Variables in an array

This is an instance of the "last name evaluation" in
arrays and tables. You can force the evaluation of the
elements of C to values by:

> C := map(eval,C):


--
A. van der Meer
Dept. Applied Mathematics
University of Twente Phone +31 (53) 4893427
P.O. Box 217 Fax +31 (53) 4894824
7500 AE Enschede




-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 30 Mar 2000 09:58:02 -0500
From: Gyrya Pavel
To:
Subject: Variables in an array

Use

> q:=[seq(100./(360*i*0.25),i=1..9)];





Previous by date: [MUG] Maple r4 ->Maple r5 ->Maple r4 problems, Ron Grimmer
Next by date: [MUG]Svd for complex matrix,  Yaxun Liu
Previous thread: [MUG] invztrans question, Ray Vickson
Next thread: [MUG]Svd for complex matrix,  Yaxun Liu



Ready to buy?

For more pricing information:
Visit our webstore, call us on +1 800 724 8380 or email us at info@adeptscience.com

Featured Downloads

Maple 16 & MapleSim 5 Professional Brochure
Maple 16 Academic Datasheet
Maple 16 & MapleSim 5 Academic Brochure
Maple 16 What is New datasheet
Maple 16 Professional Datasheet
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper - Technological Superiority in Multi-Domain Physical Modelling and Simulation

Latest Downloads

Maple 16 Programming Guide
Maple 16 User Manual
Maple 16 Academic Datasheet
Maple 16 Professional Datasheet
Maple 16 & MapleSim 5 Academic Brochure

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks

Latest News

Connectivity to major CAD systems extended in Maple 16
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
Maths software usability reaches new heights with Maple 16
"MapleSim was an eye-opener for us.
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2012, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055