Back to Forum | View unanswered posts | View active topics
Topic review - computations in a ring of fractions |
Author |
Message |
|
|
Post subject: |
|
|
|
Singular does not really support fields of fractions. But there are two ways to solve your special problem: 1) Multiply by the denominators before the computation. In your example: > ring r=real,(a11,a12,a21,a22),dp; > matrix A[2][2]=a11,a12,a21,a22; > division(det(A)*freemodule(2),A); [1]: _[1,1]=a22 _[1,2]=-a12 _[2,1]=-a21 _[2,2]=a11 ... Here we use the fact that the denominator is known to be det(A). 2) Take the quotient field as basefield. In your example: > ring r=(0,a11,a12,a21,a22),x,dp; > matrix A[2][2]=a11,a12,a21,a22; > list l=division(freemodule(2),A); > l; [1]: _[1,1]=(a22)/(a11*a22-a12*a21) _[1,2]=(-a12)/(a11*a22-a12*a21) _[2,1]=(-a21)/(a11*a22-a12*a21) _[2,2]=(a11)/(a11*a22-a12*a21) ... But it is difficult to use this result for further computations. This can be done as follows: > matrix e[2][2]=1,1,1,1; > e=l[1]*x-e; > e; e[1,1]=(a22)/(a11*a22-a12*a21)*x-1 e[1,2]=(-a12)/(a11*a22-a12*a21)*x-1 e[2,1]=(-a21)/(a11*a22-a12*a21)*x-1 e[2,2]=(a11)/(a11*a22-a12*a21)*x-1 > e[1,1]=cleardenom(e[1,1]); > e[1,2]=cleardenom(e[1,2]); > e[2,1]=cleardenom(e[2,1]); > e[2,2]=cleardenom(e[2,2]); > matrix a1=e/x; > matrix a0=jet(e,0); > a0; a0[1,1]=(-a11*a22+a12*a21) a0[1,2]=(-a11*a22+a12*a21) a0[2,1]=(-a11*a22+a12*a21) a0[2,2]=(-a11*a22+a12*a21) > a1; a1[1,1]=(a22) a1[1,2]=(-a12) a1[2,1]=(-a21) a1[2,2]=(a11) > ring s=0,(a11,a12,a21,a22),dp; > def a0=imap(r,a0); > def a1=imap(r,a1); Now you can proceed to compute derivatives using the diff command and the quotient rule. Singular does not support differentiation of rational expressions at the moment. email: mschulze@mathematik.uni-kl.dePosted in old Singular Forum on: 2002-05-15 12:55:33+02
Singular does not really support fields of fractions. But there are two ways to solve your special problem:
1) Multiply by the denominators before the computation. In your example:
> ring r=real,(a11,a12,a21,a22),dp; > matrix A[2][2]=a11,a12,a21,a22; > division(det(A)*freemodule(2),A); [1]: _[1,1]=a22 _[1,2]=-a12 _[2,1]=-a21 _[2,2]=a11 ...
Here we use the fact that the denominator is known to be det(A).
2) Take the quotient field as basefield. In your example:
> ring r=(0,a11,a12,a21,a22),x,dp; > matrix A[2][2]=a11,a12,a21,a22; > list l=division(freemodule(2),A); > l; [1]: _[1,1]=(a22)/(a11*a22-a12*a21) _[1,2]=(-a12)/(a11*a22-a12*a21) _[2,1]=(-a21)/(a11*a22-a12*a21) _[2,2]=(a11)/(a11*a22-a12*a21) ... But it is difficult to use this result for further computations. This can be done as follows: > matrix e[2][2]=1,1,1,1; > e=l[1]*x-e; > e; e[1,1]=(a22)/(a11*a22-a12*a21)*x-1 e[1,2]=(-a12)/(a11*a22-a12*a21)*x-1 e[2,1]=(-a21)/(a11*a22-a12*a21)*x-1 e[2,2]=(a11)/(a11*a22-a12*a21)*x-1 > e[1,1]=cleardenom(e[1,1]); > e[1,2]=cleardenom(e[1,2]); > e[2,1]=cleardenom(e[2,1]); > e[2,2]=cleardenom(e[2,2]); > matrix a1=e/x; > matrix a0=jet(e,0); > a0; a0[1,1]=(-a11*a22+a12*a21) a0[1,2]=(-a11*a22+a12*a21) a0[2,1]=(-a11*a22+a12*a21) a0[2,2]=(-a11*a22+a12*a21) > a1; a1[1,1]=(a22) a1[1,2]=(-a12) a1[2,1]=(-a21) a1[2,2]=(a11) > ring s=0,(a11,a12,a21,a22),dp; > def a0=imap(r,a0); > def a1=imap(r,a1);
Now you can proceed to compute derivatives using the diff command and the quotient rule. Singular does not support differentiation of rational expressions at the moment.
email: mschulze@mathematik.uni-kl.de Posted in old Singular Forum on: 2002-05-15 12:55:33+02
|
|
|
|
Posted: Wed Sep 21, 2005 8:52 pm |
|
|
|
|
|
Post subject: |
computations in a ring of fractions |
|
|
Can SINGULAR do computations in a ring of fractinos of some polynomial ring? How do I define a ring of fractions? Id like for instance to define a ring r=real,(a11,a12,a21,a22),dp; matrix A[2][2]=a11,a12,a22,a21; then to compute inverse(A). Then take derivatives of A^(-1) with respect to aij. Is this possible with singular? email: minutsil@cps.msu.eduPosted in old Singular Forum on: 2002-03-28 16:28:30+01
Can SINGULAR do computations in a ring of fractinos of some polynomial ring? How do I define a ring of fractions? Id like for instance to define a
ring r=real,(a11,a12,a21,a22),dp; matrix A[2][2]=a11,a12,a22,a21;
then to compute inverse(A). Then take derivatives of A^(-1) with respect to aij. Is this possible with singular?
email: minutsil@cps.msu.edu Posted in old Singular Forum on: 2002-03-28 16:28:30+01
|
|
|
|
Posted: Thu Aug 11, 2005 5:31 pm |
|
|
|
|
|
It is currently Fri May 13, 2022 11:00 am
|
|