0

I am trying to write a program for calculating the instantenious voltage of an inductor. I want to take the function of current (a function of t). I am also trying to run this on Ti-nspire CX instead of CAS if it matters

I first tried this.

Define LibPub indvoltage()=
Prgm
:Request "Inductance", L
:RequestStr "Current Function (I(t))",it
:Request "Time (t)",time
:Local derresult,result
:derresult:=nDeriv(it,t,time)
:result:=l*derresult
:Disp "Instantenious Voltage = ",resultres
:Disp res
:EndPrgm

This doesn't work, then I staered using expr, which didnt work either.

Define LibPub indvoltage()=
Prgm
:Request "Inductance", L
:RequestStr "Current Function (I(t))",it
:Request "Time (t)",time
:Local derresult,result
:expr(it)->it
:derresult:=nDeriv(it,t,time)
:result:=l*derresult
:Disp "Instantenious Voltage = ",resultres
:Disp res
:EndPrgm

expr doesn't work because it directly tried to evaluate the inside. I then tried

Define LibPub indvoltage()=
Prgm
:Request "Inductance (L)",l
:RequestStr "Current Function (I(t))",it
:Request "Time (t)",time
:Local res
:"nDeriv("&it&",t,time)"→res
:expr(res)→res
:res:= res * l
:Disp res
:EndPrgm

now it is raising an error when I try to run it. I am at my wits end. Please help

1 Answers1

0

You simply cannot. If you are interested in writing complex programs (this classifies as a complex program), you should look into writing them in Lua. You can't start writing a Lua program on your calculator directly, but you can use the (rather limited) Lua IDE of the Student Software on your PC. You can also install an on-calc IDE (I'd recommend Jens' Lua IDE).

Also, if I remember correctly, in one of the latest updates they added support for python. If you are more familiar with python, go for it. But I am not so sure it will integrate very well with the CAS server, so you may not have access to all the cool maths features. (Also its way slower than Lua, and doesn't have as many features, but you don't appear to need them anyway).

Promitheas Nikou
  • 511
  • 4
  • 14