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