You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

Ti-BASIC nSpire CAS issue

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/Calculator Talk publicado por u/geekpersonman November 11, 2017, 10:00:56 PM
Hello,
I have been trying to write a nSpire function in TI-BASIC to automate newton's method, but I have run in to troubles trying to get it to work like a lot of native nspire functions where one argument is an expression and the other is the variable you want the function to look at. It will only accept a variable to look at only if I define it explicitly as a local, but it can choose between all the ones I have created as locals, it is a little hard to explain, so I will put the code below (f is a function (as a string), var is variable, s is the start point, I is the iterations):
Define LibPub nmethd(f,var,s,i)=
Func
:Local g,gg,lin,ni,k
:k:=string(var)
:expr(f)→g
:ni:=floor(i)
:gg:=d(g,var)
:Local x,y,θ,t  © I don't want to have to put every possible variable you can use on this line, if I don't include it, it brings up an error
:#k:=s
:lin:=s-((expr(f))/(expr(string(gg))))
:If i=1 Then
:  Return lin
:Else
:  nmethd(f,var,lin,i-1)
:EndIf
:EndFunc
Last Edit: November 11, 2017, 10:02:37 PM by geekpersonman
Inicia sesión o crea una cuenta para dejar un comentario
u/Dream of Omnimaga November 13, 2017, 01:58:12 PM
Hm I wonder if @Adriweb might know? Not many people ask or do Nspire Basic in the last few years it seems.
Start a Discussion

b/Calculator Talk

Saw a cool TI, HP or Casio program out there? Need help programming or installing a software? This place is for you.

283
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal