Euler's Method on TI nSpire CX CAS?

415 views
Skip to first unread message

Jorge Garcia

unread,
Jan 11, 2018, 1:36:11 PM1/11/18
to tinspire
Dear Hive Mind,

I can usually debug my own code, but I think I need your help this time:

I past years, I've programmed an eulern() function that would estimate points along the solution curve to a given DiffQqu dy/dx=f(x,y) on the TI89/92 like this:

eulern()
Prgm
    Prompt x,y,h,n
    For i,0,n,1
        Disp x
        Disp y
        y+f(x,y)*h => y
        x+h => x
    EndFor
EndPrgm

where (x,y) is the initial condition of the DiffEqu, h is DeltaX in Euler's Method and n is the number of iterations. The function basically calculates DeltaY=f(x,y)*DeltaX.

This worked fine today on our nSpires for small n. The problem I have is what if h is small and n is large? The following works on the TI89/92 but didn't do anything on the nSpire:

eulern()
Prgm
    ClrIO
    Prompt x,y,h,n
    For i,0,n,1
        ClrIO
        Disp x
        Disp y
        Pause
        y+f(x,y)*h => y
        x+h => x
    EndFor
EndPrgm

So, I suppose my question is, does there exist an nSpire TIBASIC equivalent to ClrIO and Pause?

TIA,

A. Jorge Garcia

Baldwin HS & Nassau CC

Applied Math, Physics & CS

http://shadowfaxrant.blogspot.com

http://www.youtube.com/calcpage2009

Continental Mathematics League Advisor

National Computer Science Honor Society Advisor

2013-2017 http://www.paemst.org NYS Mathematics Secondary Nominee

1515085131337_bshs.png

Auto Generated Inline Image 1

John Hanna

unread,
Jan 11, 2018, 3:48:37 PM1/11/18
to tins...@googlegroups.com

This appears to work… but if n is ‘large’…? I tried it with n=50.

 

 

I’ve also attached a TI-84 program that graphs a solution to a DE using Euler’s Method. When use in conjunction with a slopefield program it demonstates a particular solution through the slope field.

 

Regards,

         John

--
--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

image005.png
image001.jpg
image002.jpg
FNINTY1.8xp

Jorge Garcia

unread,
Jan 11, 2018, 3:58:03 PM1/11/18
to tins...@googlegroups.com
Thanx, John, I have TI84 programs like that, those are nice. My problem with the nSpire is we need to pause the output so we can write down results before they scroll off the screen. How do we pause execution of the loop? I also like to clear the screen between iterations. Is there a clear screen command? I couldn't find it in the pull down menus on my emulator.

TIA,
AJG

To unsubscribe send email to tinspire+unsubscribe@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+unsubscribe@googlegroups.com

For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.

John Hanna

unread,
Jan 11, 2018, 5:23:38 PM1/11/18
to tins...@googlegroups.com

I was waiting for that issue!...

 

Store x and y in lists:

At the beginning of the program (before the loop):

   xs:={ }     -- empty lists

   ys:={ }

in the loop:

   xs[i]:=x   -- might be parens instead of brackets here but I’m pretty sure its brackets because

   ys[i]:=y   -- parens are used for functions

 

Then add a spreadsheet and add xs in column A and ys in column B and then browse the lists at your leisure. Also, you can then add a graph app and set up a (connected) scatterplot of the lists!

 

If you insist on Disp, then use a Wait or getKey(1) every 5 lines (If i/5 = int(i/5) then…)

Wait is on the Hub menu. Wait s waits s seconds

getKey(1) on the I/O menu waits until a key is pressed.

 

Regards,

         John

To unsubscribe send email to tinspire+u...@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
To post to this group, send email to tins...@googlegroups.com

To unsubscribe send email to tinspire+u...@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
To post to this group, send email to tins...@googlegroups.com

To unsubscribe send email to tinspire+u...@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.

image001.jpg
image002.jpg
image003.png

Dennis Donovan

unread,
Jan 11, 2018, 5:52:10 PM1/11/18
to tins...@googlegroups.com
Attached is my take.  For the Nspire I like the to have an input page (Notes page) and run the program on the Notes page.  Changes to the variables that the program depends on triggers the program to run when done like this. 

There is a notes page for the input. Usually I design it so that all the input can be done on the visible screen without scrolling nad then at the bottom of the screen I add several lines and then put the running program (they don't see it on the screen).

I'm creating lists in the program and displaying them on a L&S page.  I also added a graph page showing the slope field and the points generated from the Euler's method.

Hope you can use this.

Dennis Donovan
TI Regional Instructor

AP Calculus & AP Statistics
Xaverian Brothers High School


From: Jorge Garcia <calc...@gmail.com>
To: tins...@googlegroups.com
Sent: Thursday, January 11, 2018 3:58 PM
Subject: RE: [tinspire] Euler's Method on TI nSpire CX CAS?

Thanx, John, I have TI84 programs like that, those are nice. My problem with the nSpire is we need to pause the output so we can write down results before they scroll off the screen. How do we pause execution of the loop? I also like to clear the screen between iterations. Is there a clear screen command? I couldn't find it in the pull down menus on my emulator.

TIA,
AJG
On Jan 11, 2018 3:48 PM, "John Hanna" <jeh...@optonline.net> wrote:
This appears to work… but if n is ‘large’…? I tried it with n=50.
 
 
I’ve also attached a TI-84 program that graphs a solution to a DE using Euler’s Method. When use in conjunction with a slopefield program it demonstates a particular solution through the slope field.
 
Regards,
         John
 
2013-2017 http://www.paemst. org NYS Mathematics Secondary Nominee
1515085131337_bshs.png
To unsubscribe send email to tinspire+u...@googlegroups.com

For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.
EulersMethodListGraph.tns

Jorge Garcia

unread,
Jan 11, 2018, 6:13:44 PM1/11/18
to tins...@googlegroups.com
Oh, the kids will like the list idea as we do a lot of python programming in SAGE which is based on lists! Still  we would like to see output as it's generated on the screen, so I'll do a Wait too! Thanx, Great idea!

To unsubscribe send email to tinspire+unsubscribe@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
To post to this group, send email to tins...@googlegroups.com

To unsubscribe send email to tinspire+unsubscribe@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
To post to this group, send email to tins...@googlegroups.com

To unsubscribe send email to tinspire+unsubscribe@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+unsubscribe@googlegroups.com

For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+unsubscribe@googlegroups.com.

Kim Thomas

unread,
Jan 14, 2018, 1:33:38 PM1/14/18
to tinspire

I also want to remind you of two Euler activities on Math Nspired
https://education.ti.com/en/timathnspired/us/calculus/differential-equations
I use both of these with great sucess in class.

Jorge Garcia

unread,
Jan 14, 2018, 1:49:26 PM1/14/18
to tins...@googlegroups.com
What about clear screen?

John Hanna

unread,
Jan 14, 2018, 7:35:45 PM1/14/18
to tins...@googlegroups.com

Use the following code chunk to clear the Calculator app screen:

 

For I,1,8

  DispAt I,” ”

EndFor

 

 

Regards,

         John

 

From: tins...@googlegroups.com [mailto:tins...@googlegroups.com] On Behalf Of Jorge Garcia
Sent: Sunday, January 14, 2018 1:49 PM
To: tins...@googlegroups.com
Subject: Re: [tinspire] Re: Euler's Method on TI nSpire CX CAS?

 

What about clear screen?

On Jan 14, 2018 1:33 PM, "Kim Thomas" <kim.tho...@gmail.com> wrote:


I also want to remind you of two Euler activities on Math Nspired
https://education.ti.com/en/timathnspired/us/calculus/differential-equations
I use both of these with great sucess in class.

--
--
To post to this group, send email to tins...@googlegroups.com

To unsubscribe send email to tinspire+u...@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--

--
To post to this group, send email to tins...@googlegroups.com

To unsubscribe send email to tinspire+u...@googlegroups.com


For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.

To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages