Using Solve( in basic
5 posts
• Page 1 of 1
- hayzel
- Member
- Posts: 43
- Joined: Thu May 31, 2012 5:45 pm
- Location: Greece
- Calculators: Casio fx-9860G 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( ?????
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( ?????
- aapman55
- 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
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.
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.
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->C
5->D
Solve(AX^3+BX^2+CX+D,X,0)
- hayzel
- Member
- Posts: 43
- Joined: Thu May 31, 2012 5:45 pm
- Location: Greece
- Calculators: Casio fx-9860G 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.
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.
if you want a code to know all the solution, just say it
Here it is :
The solution are in List 1

- Code: Select all
ClrText
"Entrez l'equation"?->[b]Y[/b]1
1ÞDim List 1
ClrText
Locate 1,1,"Resolution en cours.."
Locate 3,3,"[- ]"
1->D
0->Q
Locate 5,3,"-"
Abs Int Solve([b]Y[/b]1,-10^6)->A
Locate 6,3,"--"
Int A/10->S
Locate 7,3,"-"
For -A->C To A Step S
Solve([b]Y[/b]1,C)->R
Locate 8+Int (10(C+A)/2A),3,"-"
If R-Qâ10^-9 Or Not Q
Then R->Q
R->List 1[D]
Isz D
IfEnd
Next
The solution are in List 1
5 posts
• Page 1 of 1
Return to Casio Basic Development
Who is online
Users browsing this forum: No registered users and 5 guests