We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC & Discord main room

If you have a forum account, have more than 4 posts and are not part of a restricted usergroup, then you can chat in our main Discord server room directly from here and continue using the forums at the same time. Or you can join our server directly and access many more discussion rooms!

Author Topic: Ti-BASIC nSpire CAS issue  (Read 1109 times)

0 Members and 1 Guest are viewing this topic.

Offline geekpersonman

  • New User
  • Join Date: Nov 2017
  • Location:
  • Posts: 1
  • Post Rating Ratio: +0/-0
Ti-BASIC nSpire CAS issue
« on: 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):
Code: [Select]
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 »



Online xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19071
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Ti-BASIC nSpire CAS issue
« Reply #1 on: 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.
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games