Re: sage

14 views
Skip to first unread message

William Stein

unread,
Feb 9, 2012, 10:29:57 AM2/9/12
to yogesh gupta, sage-support

Forwarded to sage-support...

On Feb 9, 2012 3:54 AM, "yogesh gupta" <gupta...@gmail.com> wrote:
Hello sir,
          I am currently working on SAGE as my final year B.Tech. project. I am trying to add some libraries in SAGE.
          First I want to add these libraries in my copy of SAGE.  But I am facing  problems in this.I read documentation but I can't get it,so plz give me step     by step procedure for this.
          Second I am trying following code but this gives me wrong answer because integral() function doesn't work correctly:-
         
    Definition of function:-     
   def length(w,res,ll,ul,p):
    q=w.diff(x)
    r=w.diff(y)
    if(res==x):
        w=q/r
    else:
        w=r/q
    w=sqrt(w*w+1)
  
    flength=p*integral(w,res,ll,ul)
    return flength
 
calling of function:-  
var('x y a')
w=y^2-4*a*x
length(w,x,0,a,2)

Answer given by this:-2*sqrt(4*a^2/y^2 + 1)*a
which is incorrect so plz have a look on integral() function. and plz help me to resolve this problem.

More description about first problem:--
i have a file sage/devel/sage-main/sage/curve/assymptote.py  , where curve is a directory made by me. in this directory __init__.py and all.py is also present . the file is having only a function called assymp() and i want to include this file in my sage's copy so i can directly call this function like, we can call  solve() etc . from console or from anywhere in the sage. so plz help me with stepwise solution.


thank you.

P Purkayastha

unread,
Feb 11, 2012, 9:08:02 AM2/11/12
to sage-s...@googlegroups.com, yogesh gupta
You  probably need to add a line like:

from sage.curve.all import *

to sage/devel/sage-main/sage/all.py

I am not sure if you need to rebuild sage, but to be sure just rebuild it using:

sage -b

Reply all
Reply to author
Forward
0 new messages