## Programming with function solve

3 posts
• Page

**1**of**1**- Ghostfighter
- Junior Member
**Posts:**1**Joined:**Fri May 18, 2018 5:10 pm**Calculators:**Casio Classpad 300, Casio Classpad 300 plus, Casio Classpad 330, Casio Classpad 330 plus, Casio Classpad fx-cp400

### Programming with function solve

Hello,

i want to write a programm wich uses a solve command and using its Result

Programm

-----------------------------------------------

Name: test1 N: f,f1,f2,f3

ClrText

Local f,f1,f2,f3

solve(0=f)=>fn

Print "f(x)=0"

Print .....

Print fn

solve(0=f1)=>ef1

Print "f'(x)=0"

Print .....

Print ef1

........

-----------------------------------------------

f(x)= x^3+1.5x^2-2.25x => f

f'(x)=3x^2+3x-2.25 => f1

solve(0=3x^2+3x-2.25)

(x=-1.5,x=0.5) => ef1

now i want to use x=-1.5 and x=0.5 in the f(x) function like the following

f(-1.5)= x^3+1.5x^2-2.25x => np1

and

f(0.5)= x^3+1.5x^2-2.25x => np2

in the programm, but i dont know how i can do this.

It should look like this on the screen if it is possible. I dont know how to get the underlined things the other stuff is working

"

f(x)=0

0 = x^3+1.5x^2-2.25x

(fn)

f'(x)=0

0 = 3x^2+3x-2.25

(x=-1.5,x=0.5)

f(-1,5)=np1

f(0.5)=np2

"

i want to write a programm wich uses a solve command and using its Result

Programm

-----------------------------------------------

Name: test1 N: f,f1,f2,f3

ClrText

Local f,f1,f2,f3

solve(0=f)=>fn

Print "f(x)=0"

Print .....

Print fn

solve(0=f1)=>ef1

Print "f'(x)=0"

Print .....

Print ef1

........

-----------------------------------------------

f(x)= x^3+1.5x^2-2.25x => f

f'(x)=3x^2+3x-2.25 => f1

solve(0=3x^2+3x-2.25)

(x=-1.5,x=0.5) => ef1

now i want to use x=-1.5 and x=0.5 in the f(x) function like the following

f(-1.5)= x^3+1.5x^2-2.25x => np1

and

f(0.5)= x^3+1.5x^2-2.25x => np2

in the programm, but i dont know how i can do this.

It should look like this on the screen if it is possible. I dont know how to get the underlined things the other stuff is working

"

f(x)=0

0 = x^3+1.5x^2-2.25x

(fn)

f'(x)=0

0 = 3x^2+3x-2.25

(x=-1.5,x=0.5)

f(-1,5)=np1

f(0.5)=np2

"

- 3.141592
- Junior Member
**Posts:**5**Joined:**Sun Aug 13, 2017 5:59 am**Calculators:**Casio fx-9860 GII SD Power Graphic 2

### Re: Programming with function solve

if you want to set app as add_in {*.g1a located on main menu } , you must use c/c++. all input data for equation must turn to string and separate string with functions on string.h to get parameters of equation;

and solve equation.

or

you can write a pro. (C/C++) that at 1st ask the kind of equation;

and get the equation's parameters from user separately.

unfortunately 9860's sdk has not good method in its lib."fxlib.h" for getting variable from keyboard, just GetKey(&key); so use revolution-fxv0.3.2_setup

and solve equation.

or

you can write a pro. (C/C++) that at 1st ask the kind of equation;

and get the equation's parameters from user separately.

unfortunately 9860's sdk has not good method in its lib."fxlib.h" for getting variable from keyboard, just GetKey(&key); so use revolution-fxv0.3.2_setup

- DavidSV
- Junior Member
**Posts:**1**Joined:**Sat Jun 09, 2018 4:33 am**Calculators:**Casio Afx 2.0, Casio Classpad 300 plus, Casio Classpad 330 plus, Casio Classpad fx-cp400

### Re: Programming with function solve

Ghostfighter wrote:Hello,

i want to write a programm wich uses a solve command and using its Result

Programm

-----------------------------------------------

Name: test1 N: f,f1,f2,f3

ClrText

Local f,f1,f2,f3

solve(0=f)=>fn

Print "f(x)=0"

Print .....

Print fn

solve(0=f1)=>ef1

Print "f'(x)=0"

Print .....

Print ef1

........

-----------------------------------------------

f(x)= x^3+1.5x^2-2.25x => f

f'(x)=3x^2+3x-2.25 => f1

solve(0=3x^2+3x-2.25)

(x=-1.5,x=0.5) => ef1

now i want to use x=-1.5 and x=0.5 in the f(x) function like the following

f(-1.5)= x^3+1.5x^2-2.25x => np1

and

f(0.5)= x^3+1.5x^2-2.25x => np2

in the programm, but i dont know how i can do this.

It should look like this on the screen if it is possible. I dont know how to get the underlined things the other stuff is working

"

f(x)=0

0 = x^3+1.5x^2-2.25x

(fn)

f'(x)=0

0 = 3x^2+3x-2.25

(x=-1.5,x=0.5)

f(-1,5)=np1

f(0.5)=np2

"

Let's go see:

solve(0=3x^2+3x-2.25)

(x=-1.5,x=0.5)=> ef1

ef1 is a list ok? so, ef1 store {x=-1.5,x=0.5} not (x=-1.5,x=0.5), being a list you can get the values separately, how?

ef1[1] and ef1[2]

ef1[1] retrieve x=-1.5 and

ef1[2] retrieve x=0.5

If do yo need only the numerical value without the "x=" you can use the getRight function.

getRight(ef1[1]) to get -1.5 only.

3 posts
• Page

**1**of**1**### Who is online

Users browsing this forum: No registered users and 11 guests