π
<-

Barycentre

Pour le TI-Basic sur Nspire

Barycentre

Unread postby marcoz » 15 Feb 2014, 12:30

I would like to do this program but I am stuck on a few things ... Can anyone help me? Items can be three, four, five, etc ...

baricent()
Prgm
InputStr "How many elements ?",str1
If str1="" Then
.............................. Place a cycle for to say: If the items are five then enter this data .....

InputStr "Enter A1",str2
InputStr "Enter A2",str3
InputStr "Enter A3",str4
InputStr "Enter A4",str5
InputStr "Enter A5",str6
InputStr "Enter D1",str7
InputStr "Enter D2",str8
InputStr "Enter D3",str9
InputStr "Enter D4",str10
InputStr "Enter D5",str11


Pause "M1=A1*D1"
Pause str2*str7
.....................

Mtot= .......

xG=....
yG=....
zG=...
You do not have the required permissions to view the files attached to this post.
User avatar
marcoz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 20%
 
Posts: 11
Joined: 11 Dec 2011, 14:58
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ingegneria

Re: Barycentre

Unread postby pierrotdu18 » 15 Feb 2014, 12:37

You have to do a for loop :

Code: Select all
baricent()
Prgm

A:={}  -- The list which is gonna contain the A elements
D:={}  -- The list which is gonna contain the D elements

InputStr "How many elements ?",str1

For k,1,str1
InputStr "Enter A"&string(k),str2
A:=augment(A,{str2})
EndFor

For k,1,str1
InputStr "Enter D"&string(k),str2
D:=augment(D,{str2})
EndFor

EndPgrm



Then, I didn't really understand what you wanted to do ;)
Bonjour
User avatar
pierrotdu18Premium
Niveau 15: CC (Chevalier des Calculatrices)
Niveau 15: CC (Chevalier des Calculatrices)
Level up: 40.5%
 
Posts: 975
Joined: 07 Nov 2013, 20:18
Location: Paris V
Gender: Male
Calculator(s):
MyCalcs profile
Class: MP* Lycée Henri IV

Re: Barycentre

Unread postby marcoz » 15 Feb 2014, 12:40

I want to calculate the center of gravity of a structure in three dimensions...
Now I try and I'll know
User avatar
marcoz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 20%
 
Posts: 11
Joined: 11 Dec 2011, 14:58
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ingegneria

Re: Barycentre

Unread postby pierrotdu18 » 15 Feb 2014, 12:45

A structure un three dimensions? Defined by what? Your A points and your D points?...
Bonjour
User avatar
pierrotdu18Premium
Niveau 15: CC (Chevalier des Calculatrices)
Niveau 15: CC (Chevalier des Calculatrices)
Level up: 40.5%
 
Posts: 975
Joined: 07 Nov 2013, 20:18
Location: Paris V
Gender: Male
Calculator(s):
MyCalcs profile
Class: MP* Lycée Henri IV

Re: Barycentre

Unread postby marcoz » 15 Feb 2014, 12:55

A represents the length / surface
D represents the density

A and D are data of the problem


I want to insert A and D according to the number of elements that have the structure (may be two, three or four, etc. ...)

I want him to calculate the mass of each element, knowing that the mass is given by M = D / A


Then I want to calculate the total mass .... What is given by M1 + M2 + M3 ......


and after this calculation the center of gravity
User avatar
marcoz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 20%
 
Posts: 11
Joined: 11 Dec 2011, 14:58
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ingegneria

Re: Barycentre

Unread postby pierrotdu18 » 15 Feb 2014, 13:02

EDIT : It is not InputStr but Input, you must enter numbers, don't you?

Code: Select all
baricent()
Prgm

A:={}  -- The list which is gonna contain the A elements
D:={}  -- The list which is gonna contain the D elements
M:={} -- The list which is gonna contain the M elements
result:=0 -- The result

InputStr "How many elements ?",str1

For k,1,str1
Input "Enter A"&string(k),str2
A:=augment(A,{str2})
EndFor

For k,1,str1
Input "Enter D"&string(k),str2
D:=augment(D,{str2})
EndFor

For k,1,str1
temp:=D[k]*A[k]
M:=augment(M,{temp})
EndFor

For k,1,dim(M)
result:=result+M[k]
EndFor

Disp result -- The sum of the Mk elements

EndPgrm
Last edited by pierrotdu18 on 15 Feb 2014, 13:26, edited 1 time in total.
Bonjour
User avatar
pierrotdu18Premium
Niveau 15: CC (Chevalier des Calculatrices)
Niveau 15: CC (Chevalier des Calculatrices)
Level up: 40.5%
 
Posts: 975
Joined: 07 Nov 2013, 20:18
Location: Paris V
Gender: Male
Calculator(s):
MyCalcs profile
Class: MP* Lycée Henri IV

Re: Barycentre

Unread postby marcoz » 15 Feb 2014, 13:05

The center of gravity

Xg=[somm(xg^i* M^i) ] / M(total)
Yg=[somm(yg^i* M^i) ] / M(total)
Zg=[somm(zg^i* M^i) ] / M(total)

I only as data density and the length / surface of each single element of the structure
User avatar
marcoz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 20%
 
Posts: 11
Joined: 11 Dec 2011, 14:58
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ingegneria

Re: Barycentre

Unread postby marcoz » 15 Feb 2014, 13:12

I wanted to ask this program:

How many elements are there?
ANSWER: for example, 5

If there are five elements creates a 2x5 matrix and enter the data

A1 D1
A2 D2
A3 D3
A4 D4
A5 D5

When I ask the program:

Calculate the mass of each element:

A1 * D1 = M1
A2 * D2 = M2
A3 * A3 = M3
A4 * D4 = M4
A5 * D5 = M5

I ask the program calculate the total mass

M (tot) = M1 + M2 + M3 + M4 + M5

I ask the program to insert an array always 3 x n.elementi and insert the centroid of each element


xg1 yg1 zg1
xg2 yg2 zg2
xg3 yg3 zg3
xg4 yg4 zg4
xg5 yg5 zg5


After I asked him: Now compute the centroid

Xg=[somm(xg^i* M^i) ] / M(total)= xg1*m1+xg2*m2+xg3*m3+xg4*m4+xg5*m5 / M(tot)
Yg=[somm(yg^i* M^i) ] / M(total)= .................
Zg=[somm(zg^i* M^i) ] / M(total)=.................
Last edited by marcoz on 15 Feb 2014, 13:27, edited 1 time in total.
User avatar
marcoz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 20%
 
Posts: 11
Joined: 11 Dec 2011, 14:58
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ingegneria

Re: Barycentre

Unread postby pierrotdu18 » 15 Feb 2014, 13:27

Did you try the code I wrote for you?

It gives you M(total), I think you would be able to do the end as there is only one step left.
Bonjour
User avatar
pierrotdu18Premium
Niveau 15: CC (Chevalier des Calculatrices)
Niveau 15: CC (Chevalier des Calculatrices)
Level up: 40.5%
 
Posts: 975
Joined: 07 Nov 2013, 20:18
Location: Paris V
Gender: Male
Calculator(s):
MyCalcs profile
Class: MP* Lycée Henri IV

Re: Barycentre

Unread postby marcoz » 15 Feb 2014, 13:30

Thank you very much .... After I try and I'll know ... Now we all go to eat ...
User avatar
marcoz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 20%
 
Posts: 11
Joined: 11 Dec 2011, 14:58
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: Ingegneria

Next

Return to Nspire-Basic

Who is online

Users browsing this forum: ClaudeBot [spider] and 1 guest

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
813 utilisateurs:
>746 invités
>59 membres
>8 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)