Register

## Using Solve( in basic

Discuss issues related to the Casio Basic Language
Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860 G SD

### Using Solve( in basic

Is there a way to use the builtin Solve( in my casio basic program ?
I want to solve a simple polynomial equation of the form:
A X^3+ B X^2 + C X + D =0

A simple code example would be great:
1->A
-2->B
-3->C
5->D
Solve( ?????

Senior Member
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G
if you have the equation 3X^2+2X-3=5 and you would like to determine the x values.
then you can write
Code: Select all
`Solve(3X^2+2X-3=5,0)`

with 0 the initial value. As this equations has 2 solutions be carefull how you choose the initial value. f.i. if you choose the initial value to be -20, the answer will be -2 and if you choose it to be 0 it gives you 1.33333.

If you have used matlab, it is comparable to what you do with fzero, where you also need to "guess" the right initial.

Member
Posts: 31
Joined: Wed Apr 18, 2012 4:48 pm
hayzel wrote:Is there a way to use the builtin Solve( in my casio basic program ?
I want to solve a simple polynomial equation of the form:
A X^3+ B X^2 + C X + D =0

A simple code example would be great:
1->A
-2->B
-3->C
5->D
Solve( ?????

Code: Select all
`1->A-2->B-3->C5->DSolve(AX^3+BX^2+CX+D,X,0)`

Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860 G SD
Doesn't help. I was hoping something like the polynomial solver inside EQUA, that gives all the solutions.
I wanted all the three solutions.
I found a trig formula to solve the cubic function for only real solutions. So I used that.

Thanks.

Member
Posts: 31
Joined: Wed Apr 18, 2012 4:48 pm
if you want a code to know all the solution, just say it Here it is :
Code: Select all
`ClrText"Entrez l'equation"?->[b]Y[/b]11ÞDim List 1ClrTextLocate 1,1,"Resolution en cours.."Locate 3,3,"[-              ]"1->D0->QLocate 5,3,"-"Abs Int Solve([b]Y[/b]1,-10^6)->ALocate 6,3,"--"Int A/10->SLocate 7,3,"-"For -A->C To A Step SSolve([b]Y[/b]1,C)->RLocate 8+Int (10(C+A)/2A),3,"-"If R-Qâ10^-9 Or Not QThen R->QR->List 1[D]Isz DIfEndNext`

The solution are in List 1