Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

November 17th, 2012, 05:08 PM
 physics83
n00b DevH'er

Join Date: Nov 2012
Posts: 1
Time spent in forums: 1 h 2 m 19 sec
Reputation Power: 0

Hello,

I am attempting to write code for a somewhat complex Physics problem, and was wondering if someone could lend a few TI programming tips. I am a beginner at calc programming, so any advice is greatly appreciated. Thanks!

The problem involves a cart of a certain mass traveling at a certain velocity. In the cart, there are 20 blocks, each with an equal mass. The blocks are thrown off the front of the cart 1 at a time at 10 m/s in addition to the carts velocity. I am trying to make the program solve for the final velocity of the cart after each brick has been thrown off. (In this case, the final velocity would be much less.)

Here is what I have so far...

:Input "Mass of System",M
:Input "Initial Cart Velocity",V
:Input "Mass of 1 Block",B
:Input "Initial Block Velocity",I
:M*V→P
:B*I→D
:P-D→E
:M-B→G
:E/G→X

I realized that this problem requires a function that allows the equation to repeat itself for an additional 19 times, using the resulting velocity from each previous equation. Does such a function or set of functions exist?

Scott

November 19th, 2012, 02:11 PM
 Weregoose
Contributing User

Join Date: Dec 2011
Posts: 40
Time spent in forums: 16 h 2 m 21 sec
Reputation Power: 2
An expression that stores to a variable while simultaneously adopting that variable as a component of the expression.

Using T for practice, if you initialize with zero then iterate 3√(T)+1→T, you'll get 1, 4, 7, …, eventually converging on 29√6. To let a program do this for you six times and display only the last value, you can write:

:0→T
:For(K,1,6)
:3√(T)+1→T
:End
:Disp T

Another option—probably more of what you're looking for—is playing with sequence variables, which are primarily reserved for recurrence equations. Select SEQ from the [MODE] screen then press [Y=]. Set nMin=0, u(n)=3√(u(n-1))+1, and u(nMin)={0}. Here, u(n-1) is better understood as the previous term in the sequence, or by interpreting what's inside the parentheses as subscripts.

You can then return to the home screen and type u(6) for the sixth value in that sequence, which should match the program's response.

If you need more help, keep asking.

 Viewing: Dev Hardware Forums > SOFTWARE > TI 83/84 > TI-83+ programming advice?