Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168756
Image: ubuntu2004
# MATHEMATICAL METHODS OF Science and Engineering # FORTRAN codes / Matlab codes #http://www1.uprh.edu/rbaretti #http://www1.uprh.edu/rbaretti/Methodsoftheoreticalphysics.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart2.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart3.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart4.htm #http://www1.uprh.edu/rbaretti/MethodsoftheoreticalphysicsPart5.htm # Lectures on Quantum Mechanics http://www1.uprh.edu/rbaretti/LQMIntro.htm # http://www1.uprh.edu/rbaretti/LQMch1.htm #http://www1.uprh.edu/rbaretti/LQMch2.htm # http://www1.uprh.edu/rbaretti/LQMch3.htm # http://www1.uprh.edu/rbaretti/LQMch4.htm # http://www1.uprh.edu/rbaretti/LQMch5.htm #..
sage: g = Bessel(2); g J_{2} sage: print g J-Bessel function of order 2 sage: g.plot(0,10)
J-Bessel function of order 2
a=2/3 print n(a)
0.666666666666667
print n(pi)
3.14159265358979
var('y,x'); integral(y*exp(-y),y)
-(y + 1)*e^(-y)
var('x,y'); f=(1+x*y)*sin(y); integral(f,y,0,x)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/sage/sagenb/sage_notebook/worksheets/reibaretti/1/code/2.py", line 8, in <module> exec compile(ur'integral(f,y,_sage_const_0 ,x)' + '\n', '', 'single') File "", line 1, in <module> File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/misc/functional.py", line 416, in integral return x.integral(*args, **kwds) File "expression.pyx", line 5962, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:24542) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py", line 566, in integral result = expression._maxima_().integrate(v, a, b) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py", line 2003, in integral return I(var, min, max) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1390, in __call__ return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1298, in function_call return self.new(s) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1094, in new return self(code) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1029, in __call__ return cls(self, x, name=name) File "/home/sage/sage_install/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1433, in __init__ raise TypeError, x TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(x>0)' before integral or limit evaluation, for example): Is x positive, negative, or zero?
f(x)= x*(sin(x)-x*cos(x))-cos(x) +1 ; diff(f,x)
x |--> x^2*sin(x) - x*cos(x) + 2*sin(x)
var('x'); f2=x-1/2; integral(f2^2,x,0,1)
1/12
phi1=(12)^(1/2)*(x-1/2);integral(phi1^2,x,0,1)
1
f2=x^2; phi0=1; phi1=(12)^(1/2)*(x-1/2); #integral(f2*phi0,x,0,1) phi2=x^2-(1/3)*phi0-(sqrt(3)/6)*phi1; #phi2=sqrt(540/23)*(x^2-(1/3)*phi0-(1/(6*sqrt(3)))*phi1 ); #integral(phi1*phi2,x,0,1) phi2=sqrt(180)*(x^2-(sqrt(3)/6)*phi1-1/3); integral(phi1*phi2,x,0,1)
0
a=1/6*sqrt(3); n(a)
0.288675134594813
#data g0,g1,g2 ,t0,t1,t2/8.,14.,8.,0.,50.,100./ var('t');g0=8;g1=14;g2=8;t0=0;t1=50;t2=100; gama=g0*(t-t1)*(t-t2)/((t0-t1)*(t0-t2))+g1*(t-t0)*(t-t2)/((t1-t0)*(t1-t2))+g2*(t-t0)*(t-t1)/((t2-t0)*(t2-t1)); y=plot(gama,t,0,100) show(y)
var('r'); integral(4*pi*exp(-2*r)*r^2,r,0,oo)
pi
var('a , b ,c, d'); f(x)=a*x^3 + b*x^2 + c*x +d ; d2f(x)=diff(f(x),x,2); x=2; d2f(x)
12*a + 2*b
z=2; phi(p)=(2^(3/2)/pi)*z^(5/2)/(p^2+z^2)^2; integral(phi(p)^2*4*pi*p^2,p,0,oo);
1