TI 83/84
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWARETI 83/84

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old December 11th, 2008, 01:35 PM
Easy Easy is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 4 Easy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m
Reputation Power: 0
Variable X

So I'm working on a program that does certain calculations that require "x" as a variable instead of a stored number.

How can I get the calculator to treat an "x" in something like:

(4x-2)^2

instead of whatever is stored for x?

Reply With Quote
  Trader Rating: 0 · #2  
Old December 11th, 2008, 02:50 PM
Airbard's Avatar
Airbard Airbard is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 7 Airbard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 53 sec
Reputation Power: 0
Use the solve( function under math, to use it solve(equation,variable,guess).

Reply With Quote
  Trader Rating: 0 · #3  
Old December 11th, 2008, 04:41 PM
Easy Easy is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 4 Easy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m
Reputation Power: 0
Quote:
Originally Posted by Airbard
Use the solve( function under math, to use it solve(equation,variable,guess).


I'm looking to use the derivative function, which is:

Code:
nDeriv(x²,x,2)
(The answer should be 4)


a.k.a

Code:
nDeriv(f(x),x,value of x)


Here's my code:

Code:
:ClrHome
:Output(3,5,"Finding")
:Output(4,7,"the")
:Output(5,4,"Derivative")
:Pause
:ClrHome
:Disp "f(x)?"
:Input A
:ClrHome
:Disp "X?"
:Input B
:ClrHome
:solve(nDeriv(A,x,B)→C
:Disp C
:End


I have highlighted the x variable in red, to show what needs to be a variable instead of a variable.

I'm getting syntax at the ")" after B and before the store arrow on line 7. What am I doing wrong?

Reply With Quote
  Trader Rating: 0 · #4  
Old December 11th, 2008, 05:32 PM
Airbard's Avatar
Airbard Airbard is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 7 Airbard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 53 sec
Reputation Power: 0
nDeriv( is used as an equation in the solve function, so that you still have to define the variable and the guess

Reply With Quote
  Trader Rating: 0 · #5  
Old December 11th, 2008, 06:58 PM
Easy Easy is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 4 Easy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m
Reputation Power: 0
So the variable would be X, and the guess would be...?

Reply With Quote
  Trader Rating: 0 · #6  
Old December 11th, 2008, 07:21 PM
Airbard's Avatar
Airbard Airbard is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 7 Airbard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 53 sec
Reputation Power: 0
the guess is what you think the answer is
I just realized that the nderiv( function gives a number so the solve( function uses a number as an equation so my suggestion is that you type out the formula for nderiv(
f'(x)=f(x+E)-f(x+E)/2E

Reply With Quote
  Trader Rating: 0 · #7  
Old December 11th, 2008, 07:29 PM
Easy Easy is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 4 Easy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m
Reputation Power: 0
But the catch is that I'm trying to make this be able to work for any equation, like f(x)=sin(x) @ x=π/2

Sorry for seeming stubborn, but I'm a little noobish/rusty when it comes to stuff like this.

Reply With Quote
  Trader Rating: 0 · #8  
Old December 11th, 2008, 07:35 PM
Airbard's Avatar
Airbard Airbard is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 7 Airbard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 53 sec
Reputation Power: 0
then try using this:
Quote:
:input "EQUATION-"A
:input "GUESS="B
:solve(A,X,B)

where A is an equation
and B is the guess
removing the nderiv( allows any equation to be used

Reply With Quote
  Trader Rating: 0 · #9  
Old April 1st, 2009, 09:28 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 1 h 51 sec
Reputation Power: 95
Quote:
Originally Posted by Airbard
then try using this:

where A is an equation
and B is the guess
removing the nderiv( allows any equation to be used

No, that won't work
A will be stored as a value still. If you put (X+1)^2 in as A, then it would use the value of X it already has, solve it, and then store that as A
You'd have to store it as a String
Code:
:input "EQUATION-",Str1
:input "GUESS=",B
:solve(Str1,X,B)

This may work, but I don't know, because i have never used solve before. Anyways if you don't know already, you access your list of Strings by pressing [VARS], [7], and then choose which of then 10 you want. Here I used number 1.

Reply With Quote
  Trader Rating: 0 · #10  
Old April 16th, 2009, 07:54 PM
gumbee's Avatar
gumbee gumbee is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 gumbee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 18 sec
Reputation Power: 0
Send a message via MSN to gumbee Send a message via Google Talk to gumbee
Quote:
Originally Posted by MufinMcFlufin
No, that won't work
You'd have to store it as a String
Code:
:input "EQUATION-",Str1
:input "GUESS=",B
:solve(Str1,X,B)


Code:
:input "equation ",str1
:input "guess ",B
:solve(string>Equ(str1),X,B)->C

You have to convert the string to an equation first otherwise the calc gives you a nifty little error.

Reply With Quote
  Trader Rating: 0 · #11  
Old April 21st, 2009, 08:20 AM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 1 h 51 sec
Reputation Power: 95
Quote:
Originally Posted by gumbee
Code:
:input "equation ",str1
:input "guess ",B
:solve(string>Equ(str1),X,B)->C

You have to convert the string to an equation first otherwise the calc gives you a nifty little error.

So I'm not the only one who thinks that errors are nifty...
Anyways, I've never actualy done anthing like this, so after looking over my code again before reading yours, I thought something looked wrong, but I never tested it so I just went with it. Does it work now you added that little part?

Reply With Quote
  Trader Rating: 0 · #12  
Old April 22nd, 2009, 11:34 PM
gumbee's Avatar
gumbee gumbee is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 gumbee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 18 sec
Reputation Power: 0
Send a message via MSN to gumbee Send a message via Google Talk to gumbee
no, i had to change some stuff. here's the new code. this is tested and works... well...no errors at least.
Code:
:input "equation ",str1
:input "guess ",B
:string>Equ(str1,Y1)
:solve(Y1,X,A)->C

Y1 is a function variable that can be found buy pushing [VARS] > [->] > [ENTER] > [ENTER]

Last edited by gumbee : April 22nd, 2009 at 11:36 PM. Reason: parentheses mix-up/colors

Reply With Quote
  Trader Rating: 0 · #13  
Old April 24th, 2009, 07:27 PM
legoguy314 legoguy314 is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 38 legoguy314 User rank is Sergeant Major (2000 - 5000 Reputation Level)legoguy314 User rank is Sergeant Major (2000 - 5000 Reputation Level)legoguy314 User rank is Sergeant Major (2000 - 5000 Reputation Level)legoguy314 User rank is Sergeant Major (2000 - 5000 Reputation Level)legoguy314 User rank is Sergeant Major (2000 - 5000 Reputation Level)legoguy314 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 h 4 m 14 sec
Reputation Power: 28
I typicaaly input a string, change it to a Y= and store it as Y1 then use seg(Y1,X,X,X) Seq is under list. That mught not be right right but its close, i don't have my calc. with me now so I apologize if that is incorrect

Reply With Quote
  Trader Rating: 0 · #14  
Old April 24th, 2009, 07:47 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 1 h 51 sec
Reputation Power: 95
Quote:
Originally Posted by gumbee
no, i had to change some stuff. here's the new code. this is tested and works... well...no errors at least.
Code:
:input "equation ",str1
:input "guess ",B
:string>Equ(str1,Y1)
:solve(Y1,X,A)->C

Y1 is a function variable that can be found buy pushing [VARS] > [->] > [ENTER] > [ENTER]

Hold on there, you had it input variable B, but then in the solve code, you used variable A. Was that a typo, or did you intentionally do it? And if so, then why?

Reply With Quote
  Trader Rating: 0 · #15  
Old April 25th, 2009, 02:03 AM
gumbee's Avatar
gumbee gumbee is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 29 gumbee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 18 sec
Reputation Power: 0
Send a message via MSN to gumbee Send a message via Google Talk to gumbee
Just a typo. Haha.

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWARETI 83/84 > Variable X


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
     
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek