Register

XtrmCAS

Topics on released projects. Only the author of a program should start a topic on it.
Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

XtrmCAS

Postby xtrm0 » Tue Apr 17, 2012 10:21 pm

Hi I'm developing an open-source CAS, in C.
Project Tittle: XtrmCAS
Description: A CAS easy to port to all calculators.
Languages: C
Project Leader: Xtrm0
Members: None (YET)
Github: https://github.com/xtrm0/XtrmCAS
Download Links:
V0.2.0.2:
Casio fx9860 series -> [ATTACH]44[/ATTACH]
The source code is all availble at github.
Supported Opperations:
*(A)(B)
Answers: A*B
+(A)(B)
Answer: A+B
-(A)(B)
Answer: A-B
/(A)(B)
Answer: A/B
R(A)(B)
Answer: Remaining of (A/B)
Ex:
*(x-1)(x+1)
*(2x^2-14x^8-1+13*x)(-x^2+7)

Regz,
Xtrm0

BTW, if you find any bugs, please post them in here.
Attachments
XTRMCAS.zip
(0 Bytes) Downloaded 869 times

Member
User avatar
Posts: 27
Joined: Mon Apr 09, 2012 7:09 pm
Location: France

Postby PierrotLL » Tue Apr 17, 2012 11:03 pm

What's wrong with the interface ? I attached a file with a simple implementation of some standard functions to make a console interface on fx-9860 (getchar, printf, clear) : [ATTACH]37[/ATTACH]

About your code, don't put functions code in header files.
Attachments
console.zip
(0 Bytes) Downloaded 806 times

Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

Postby xtrm0 » Tue Apr 17, 2012 11:09 pm

Thanks. Right now I have got to get some sleep. But tomorow, or te day after, I will try to put here te first release.
If you got any sugestions, or would like to join the project (this is an invitation), please say (bruno7 told me you had already builded a CAS but that you lost the source. And that you wanted to build one again for the prizm).

Regz,
Xtrm0

Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

Postby xtrm0 » Tue Apr 17, 2012 11:12 pm

Rigt now it only supports the folowing operation:
*(A)(B)
-(A)(B)
+(A)(B)
Ex:
*(x*2^4-x^4+2-x)(2*x+16x^3-1)

When I have time I will add division.
Then derivation and antiderivation.
Then factoring.
(...)

Member
User avatar
Posts: 27
Joined: Mon Apr 09, 2012 7:09 pm
Location: France

Postby PierrotLL » Wed Apr 18, 2012 2:35 pm

The syntax interpreter is the "childish" part of a real CAS. Derivation is easy too. Simplification, factorization, integration, equations solving, that's another story.

Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

Postby xtrm0 » Wed Apr 18, 2012 6:06 pm

Im working on simplification, but I'm unable to set the priorities for operations. Solving can be done easily testing all the possíble solutions (in complexity O((logN)^2), beeing N the biggest number in the first and last quoeficients). Ill create a piece of code explaining how in a moment.
After knowing how to solve its easy to factorize.
At last, I dont have integration in school, so it's not a priority to me.

If you know a way of easing the interpretion process, please help. After that, all of the obter operations would be a peace of cake.

Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

Postby xtrm0 » Wed Apr 18, 2012 7:18 pm

Just finished it:

Code: Select all
#include "stdio.h"
#include "poly.h" //my polynomials class, /
//this method is based on the fact that all real rational must be in the form (a/b), where a is a divisor
//of the the highest rank poly, and b is a dividor of the lowest rank one.
//Afte that we know that the remaining root are irational, and we use some method, such as tat described in
//this page to solve: ([url]http://en.wikipedia.org/wiki/Root-finding_algorithm#Algorithm[/url])

double x_pow(double a, int b) {
   int i;
   double ans=a;
   if (b==0) return 1;
   for (i=1; i<b; i++) {
      ans = a*ans;
   }
   return ans;
}
void printandfind(poly * a) {
   int fst, lst, i,j,k;
   double sum;
   for (i=0; i<MAXS && a->quof[i]==0; i++); //MAXS is the maximum number of factor as defined in poly.h
   fst=i;
   for (i=MAXS; i>=0 && a->quof[i]==0; i--);
   lst=i;
   sum=0;
   printf ("%d,%d\n",fst, lst);
   for (i=1; i<=a->quof[fst]; i++) {
      if (a->quof[fst]%i==0) {
         for (j=1; j<=a->quof[lst]; j++) {
            if (a->quof[lst]%j==0) {
               sum=0;
               for (k=0; k<MAXS; k++) {
                  sum += a->quof[k]*x_pow((double(i) / double(j)), k);
               }
               if (fabs(sum)<=0.0001) printf("%d/%d is a zero\n",i,j); //Once poly_division is done, this can be upated to find factors 
            }
         }
      }
   }
   //aplly wikipedia's method to a equations with no real roots(reduces time)
   //TD
   return;
}

int main() {
   poly a, b, c;
   init_poly(&a); init_poly(&b); init_poly(&c); //inits the polys
   a.quof[4]=2; a.quof[3]=-11; a.quof[2]=-6; a.quof[1]=64; a.quof[0]=32; //set a to someting;
   printandfind(&a);
   init_poly(&a);
   a.quof[2]=1; a.quof[1]=-7; a.quof[0]=12;
   printandfind(&a);
   return 0;
}

File: findroot.c on my github

It still neads the implementation of the wikipedia method to find irrational and complex roots. Do you think that algorithm (the wikipedia, for complex roots) would work or should I use another one? Do you remember the one you used?


Regz,
Xtrm0

Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

Postby xtrm0 » Wed Apr 18, 2012 8:29 pm

Sorry, wrong algoritm, I meant by using te intermediate value teorem, alongside with bruteforce for the irrational roots. But how did you did it to find the complex roots?

Member
User avatar
Posts: 27
Joined: Mon Apr 09, 2012 7:09 pm
Location: France

Postby PierrotLL » Thu Apr 19, 2012 8:08 pm

I didn't made the equation solver. But your CAS must correctly manage complex numbers first.

Member
Posts: 36
Joined: Tue Apr 17, 2012 9:22 pm

Postby xtrm0 » Thu Apr 19, 2012 10:31 pm

Please delete this, wrong post

Next

Return to Released Projects

Who is online

Users browsing this forum: No registered users and 40 guests