2

I whant to replace a variable by some numbers and X's or even a direct equation like 3X+2 = 5

Yeah I'm codding a resolution of equations :D (i'm borred)

This is what i've written right now

Prompt E
Prompt F

while T [not equal to] 1
X+0.01 -> X

If E=F
1 -> T
If E=F
Disp X
End

So what i'm trying to do is say E is 3X+2 and F is 5 I test all the possible solutions by replacing X by every number and when it equals to F (so 5) i stop and print X

It works when I replace directly in the code the E and F but it's long and useless if I whant to use it.

If 3X+2=5
1 -> T
If 3X+2=5
Disp X
End

This works !! So is it possible for the calculator to interpret that i'm saying that E is a long sentence ?

Thanks so much !

Ps : Don't worry if i make mistakes in my orthograph, (i'm french) Ps 2 : Don't just tell me how to do a resolution of equation (Don't tell me what I can't do !! (lost (4 8 15 16 23 42)))

nicobld
  • 131
  • 2
  • 12

2 Answers2

1

Are you asking how to input "3X+2" into the variable E?

In this case, you wouldn't want to use a variable, because variables in TI-84 can only be numbers. You would use strings, which store text instead of numbers. Go to VARS > String... to see the list of strings available.

Now, to find the numerical value of strings, you would use the expr( command. For example, expr("3X+2") where X=1 would return 5. You can find the expr( command in the catalog (2ND + 0).

user3932000
  • 671
  • 8
  • 24
1

You're looking for equation variables.

An expression can be stored into an equation variable such as Y₁; it will be evaluated every time it is encountered.

"3X+2→Y₁
5→X
Disp Y₁
-2→X
Disp Y₁

The above will print

17
-4

Equation variables are easier to use than strings, because they are automatically evaluated. There's no need to use expr(. To find the equation variables, press VARS > ENTER.

lirtosiast
  • 592
  • 4
  • 15
  • Try the u v and w equation variables, that way you won't mess with the Y vars since they're used much more often for graphing. – Timtech Nov 16 '15 at 20:28
  • @Timtech I usually use Y0 (I never scroll down that far) and delete the variable afterwards. Some people use recursion from time to time, so using u/v/w variables can be a problem. – user3932000 Nov 17 '15 at 00:10
  • @user3932000 Good idea to clean up - if you delete the variable afterwards it really isn't a problem. – Timtech Nov 17 '15 at 00:14
  • Actually, using **strings** would be better in this case, chiefly because with `Input` and strings, you don't have to put in the quotation mark at the beginning. With equation variables, not including the quotation mark returns a data type error. – user3932000 Nov 17 '15 at 21:37
  • 1
    @user3932000 Input Str1:String>Equ(... would have the benefits of both, then. – lirtosiast Nov 17 '15 at 22:25
  • or Input Str1:expr(Str1 if you don't need to evaluate it multiple times – Timtech Nov 21 '15 at 22:18