Jump to content



Photo
- - - - -

solve()


  • Please log in to reply
8 replies to this topic

#1 Gerard

Gerard

    Newbie

  • Members
  • Pip
  • 5 posts

  • Calculators:
    classpad 300

Posted 19 February 2004 - 09:08 PM

?'m really new in this about calculators (2 weeks) then:
have been trying to make a program and I need to isolate the result of a solve function, i get a result as {x=0.020615} to put it into a variable ant then make some operations, with this result I cant operate.
Is there any other function as eval() or similar to get only the expression? or any trick?
I've been trying to convert to a string eliminate "x=" and then use the strtoexp() but it doesn't change the type... :banghead:

excuse my english, thankyou!

P.S. :What is the difference in use this [(-)] and this [-]

#2 Daniel (CZE)

Daniel (CZE)

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts
  • Location:Milevsko - Czech Republic
  • Interests:Support for Pocket Viewer and ClassPad for Czech Republic.

  • Calculators:
    ClassPad 300, TI-92 Plus, FX-6300G, CFX-9850GB Plus

Posted 19 February 2004 - 10:20 PM

As you can see, result is given as list type. So you can do something like this:

solve(x=1,x)=>y

In var. y is the result {x=1}

now you can operate with expr. in var. y as with list.

You can access to result by this command: y1

If you have more expressions ({x=1,x=-1}), you can use y1, y2, ...

"(-)" and "-" is same, I think.

#3 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 19 February 2004 - 10:25 PM

"(-)" and "-" is same, I think.

yes i belive they are:

<span class=3' /> [+] [-] <span class=2' /> = 1

<span class=3' /> [+] [(-)] <span class=2' /> = 1

aswell, with no syn errors, so i guess they are the same

#4 Daniel (CZE)

Daniel (CZE)

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts
  • Location:Milevsko - Czech Republic
  • Interests:Support for Pocket Viewer and ClassPad for Czech Republic.

  • Calculators:
    ClassPad 300, TI-92 Plus, FX-6300G, CFX-9850GB Plus

Posted 19 February 2004 - 10:47 PM

I've been trying to convert to a string eliminate "x=" and then use the strtoexp() but it doesn't change the type...

You can get left or right part of expression ("=" is center) by these commands:

getLeft(EXPR)
getRight(EXPR)

so for "x=1" you'll get number 1 as: getRight(x=1) :)

#5 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 19 February 2004 - 11:09 PM

another way you could do it is like this:

solve(EQU,x)=>y
ExpToStr y,y //y is now a string
StrFind y,"=",smin
StrFind y,"}",smax
StrMid y,smin+1,y,smin-1 //the # part the y is stored in y
strToExp(y)=>y //y is a number

this is the programming method, in this case the mathmatical way is better.

#6 mkanter

mkanter

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts

  • Calculators:
    CFX9850G, ClassPad 300

Posted 20 February 2004 - 11:15 AM

To get the expression (the right side of the solution you can use getRight and need not to look for the =)

solve(f(x),x)=>sol
'to make expr the same size as sol
sol=>expr
'The first expression
getRight(sol1)=>expr1
'The 2nd expression - if there is one check it with dim(sol)
getRight(sol2)=>expr2
'The 3rd expression- if there is one check it with dim(sol)
getRight(sol3)=>expr3

#7 Gerard

Gerard

    Newbie

  • Members
  • Pip
  • 5 posts

  • Calculators:
    classpad 300

Posted 20 February 2004 - 03:38 PM

It's great to have an answer as wide as this :thumbsup:
Ive been trying the getright() and it's what I needed.

Thankyou.Best regards :D

#8 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 20 February 2004 - 04:28 PM

good luck :)

#9 tonyp

tonyp

    Casio Fan

  • Members
  • PipPip
  • 34 posts

  • Calculators:
    TI89, TI89 Titanium, TI-nspire CAS, Casio ClassPad300, Casio fx-6300g, Casio GFX9850GB, Casio 82ES, more

Posted 25 February 2004 - 05:46 PM

solve(x=1,x)=>y

In var. y is the result {x=1}

now you can operate with expr. in var. y as with list.

You can access to result by this command: y1


By the way, this also works with ANS so you don't have to save the result to a variable, if it's to be used only once afterwards.

ANS1 will return the first list item. ANS2 the second, and so on.

tonyp AT acm.org




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users