Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 28 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@erik10 

The code editor in Maple 16, while it did not have colors, did place your cursor a the point of a syntax error! It is very frustrating to find a missing parenthesis sometimes. Sometimes I cut-and-paste the code out to the regular GUI to find an error.

A module is essentially a procedure. It usually has procedures that are local to it, but the locals can be anything, just as with a procedure. If you want a group of procedures to share access to the locals of their parent procedure, you might as well make it a module. A module can have some locals which are visible outside of the module. These are called the exports of the module. In this way, a module is like a class in C++. If a module has a procedure named ModuleApply, then that procedure is called when the module's name is invoked as a procedure call. 

@erik10 

The code editor in Maple 16, while it did not have colors, did place your cursor a the point of a syntax error! It is very frustrating to find a missing parenthesis sometimes. Sometimes I cut-and-paste the code out to the regular GUI to find an error.

A module is essentially a procedure. It usually has procedures that are local to it, but the locals can be anything, just as with a procedure. If you want a group of procedures to share access to the locals of their parent procedure, you might as well make it a module. A module can have some locals which are visible outside of the module. These are called the exports of the module. In this way, a module is like a class in C++. If a module has a procedure named ModuleApply, then that procedure is called when the module's name is invoked as a procedure call. 

@abbeykabir The algorithms are not in packages. They are all accessible via the method option: dsolve(..., numeric, method= ...). They are documented on the help pages ?dsolve,numeric,IVP , ?dsolve,numeric,BVP , and ?dsolve,numeric,classical .

@abbeykabir The algorithms are not in packages. They are all accessible via the method option: dsolve(..., numeric, method= ...). They are documented on the help pages ?dsolve,numeric,IVP , ?dsolve,numeric,BVP , and ?dsolve,numeric,classical .

Under the rules, why is p(2014) = 30? Shouldn't it be 8?

@Markiyan Hirnyk I didn't feel like looking at or printing out a long number. Also, it's nice to be able to assign the answer to a variable.

@Markiyan Hirnyk I didn't feel like looking at or printing out a long number. Also, it's nice to be able to assign the answer to a variable.

@Vladimir K. Here it is. But there is nothing "wrong" in M14. As Markiyan suggests, such results are to be expected when you use simplify(..., symbolic).


(**)

restart:

(**)

Za:=simplify(int(((c-x)/x)^n,x=a..c),symbolic) assuming a>0,c>a,n>-1;

(Pi*n^2*c+c^n*a^(-n+1)*hypergeom([-n, -n+1], [2-n], a/c)*sin(n*Pi)-Pi*n*c)/((n-1)*sin(n*Pi))

(**)

Zb:=simplify(int(((x-c)/x)^n,x=c..b),symbolic) assuming c>0,b>c,n>-1;

-(1/2)*(n^2*c^2*hypergeom([1, 1, 2-n], [2, 3], c/b)*sin(n*Pi)+2*cos(n*Pi)*Pi*b*c*n-2*sin(n*Pi)*gamma*b*c*n+2*sin(n*Pi)*ln(b)*b*c*n-2*sin(n*Pi)*ln(c)*b*c*n-2*sin(n*Pi)*Psi(-n+1)*b*c*n-n*c^2*hypergeom([1, 1, 2-n], [2, 3], c/b)*sin(n*Pi)+2*sin(n*Pi)*n*c*b-2*sin(n*Pi)*b^2)/(b*sin(n*Pi))

(**)

Z2:=(A,B,C)->subs(a=A,c=C,Za)-subs(b=B,c=C,Zb);

proc (A, B, C) options operator, arrow; subs(a = A, c = C, Za)-subs(b = B, c = C, Zb) end proc

(**)

INT:=simplify(Z2(A,B,(A+B)/2)) assuming A>0,B>0,C>0,C>A,B>C,n>0;

(1/8)*(-4*B^2*hypergeom([-n, -n], [-n+1], 2*A/(A+B))*A^(-n+1)*sin(n*Pi)*2^(-n)*(A+B)^n-4*A^(2-n)*B*hypergeom([-n, -n], [-n+1], 2*A/(A+B))*sin(n*Pi)*2^(-n)*(A+B)^n+4*B^2*A^(-n+1)*sin(n*Pi)*(-2/(A-B))^(-n)-4*A^(2-n)*B*sin(n*Pi)*(-(1/2)*A+(1/2)*B)^n+A^3*hypergeom([1, 1, 2-n], [2, 3], (1/2)*(A+B)/B)*sin(n*Pi)*n^2-A^3*hypergeom([1, 1, 2-n], [2, 3], (1/2)*(A+B)/B)*sin(n*Pi)*n+4*A^2*B*Pi*n+4*A^2*B*sin(n*Pi)*n+4*A*B^2*Pi*n+4*A*B^2*sin(n*Pi)*n+4*A*B^2*sin(n*Pi)*n*ln(2)-4*A^2*B*sin(n*Pi)*n*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Pi)*n*ln(A+B)+4*A^2*B*sin(n*Pi)*n*ln(2)-4*A*B^2*sin(n*Pi)*n*ln(A+B)+2*A^2*B*hypergeom([1, 1, 2-n], [2, 3], (1/2)*(A+B)/B)*sin(n*Pi)*n^2+A*B^2*hypergeom([1, 1, 2-n], [2, 3], (1/2)*(A+B)/B)*sin(n*Pi)*n^2-4*A^2*B*gamma*sin(n*Pi)*n+4*A^2*B*Pi*cos(n*Pi)*n-4*A^2*B*Psi(-n+1)*sin(n*Pi)*n-2*A^2*B*hypergeom([1, 1, 2-n], [2, 3], (1/2)*(A+B)/B)*sin(n*Pi)*n+4*A^2*B*sin(n*Pi)*ln(B)*n-4*A*B^2*gamma*sin(n*Pi)*n+4*A*B^2*Pi*cos(n*Pi)*n-4*A*B^2*Psi(-n+1)*sin(n*Pi)*n-A*B^2*hypergeom([1, 1, 2-n], [2, 3], (1/2)*(A+B)/B)*sin(n*Pi)*n+4*A*B^2*sin(n*Pi)*ln(B)*n-8*A*B^2*sin(n*Pi))/(B*sin(n*Pi)*A)

(**)

II:=simplify(evalc(Im(INT))) assuming A>0,B>0,C>0,C>A,B>C,n>0;

0

(**)

 


Download symbolic.mw

@abbeykabir Dividing by a matrix is equivalent to multiplying by its inverse. Let J(x) represent the Jacobian matrix evaluated at the vector x. Then the Newton iteration becomes

x[i+1]:= x[i] - J(x[1])^(-1)*F(x[i]).

But recall what I called The first rule of numerical linear algebra: Never invert a matrix; always solve a linear system instead. Computing A^(-1)*B is equivalent to solving A*X=B. This is accomplished in Maple with the command LinearAlgebra:-LinearSolve(A,B).

Now let's step back for a moment to the single-variable Newton iteration:

x[i+1]:= x[i] - f(x[i])/f'(x[i]).

How do we know when to stop iterating?

@abbeykabir Dividing by a matrix is equivalent to multiplying by its inverse. Let J(x) represent the Jacobian matrix evaluated at the vector x. Then the Newton iteration becomes

x[i+1]:= x[i] - J(x[1])^(-1)*F(x[i]).

But recall what I called The first rule of numerical linear algebra: Never invert a matrix; always solve a linear system instead. Computing A^(-1)*B is equivalent to solving A*X=B. This is accomplished in Maple with the command LinearAlgebra:-LinearSolve(A,B).

Now let's step back for a moment to the single-variable Newton iteration:

x[i+1]:= x[i] - f(x[i])/f'(x[i]).

How do we know when to stop iterating?

Are the entries rational functions? How many parameters? Are you looking for a particular eigenvalue?

Try LinearAlgebra:-CharacteristicPolynomial.

Try setting one parameter to 0 or 1.

 

@mvcr15 Wikipedia has good information. Let's start with Euler's method for a single equation. That's the easiest case. You should be able to find a discussion of it in any serious calculus textbook. Or see the Wikipedia article "Euler method".

@abbeykabir Okay, good. Yes, the Jacobian matrix is the derivative of a multivariate function. The single-variable Newton's method divides by the derivative. In the multivariate case the derivative is a matrix. How can we divide by a matrix?

@abbeykabir Okay, good. Yes, the Jacobian matrix is the derivative of a multivariate function. The single-variable Newton's method divides by the derivative. In the multivariate case the derivative is a matrix. How can we divide by a matrix?

Do you need the methods to solve a single first-order differential equation, or do you need it for a system of equations?

First 625 626 627 628 629 630 631 Last Page 627 of 709