Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 312 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@yangtheary The title of your reply indicates that you are looking for a polynomial answer. My answer is based on seeing a pattern, and is not a polynomial.

A polynomial answer can always be obtained by a trivial formula, so is rather boring. The polynomials produced are usually not obvious or interesting, and their extrapolations usually do not follow the "obvious" and "logical" pattern of the sequence.

CurveFitting:-PolynomialInterpolation([[1,1], [2,3], [3,6], [4,12], [5,24]], n);


 

Say, what is the theme or purpose of your current series of questions?

 

 

@erik10 

Maybe it is a bug that the cursor doesn't stop at the line, where the error occurs - as it did in Maple 16, you say?

I reported it as a bug several months ago.

I haven't been working with modules earlier. I understand it as a kind of collection of procedures created for a special purpose, so it makes a whole and easier to work with.

That's one thing that modules are for.

@erik10 

Maybe it is a bug that the cursor doesn't stop at the line, where the error occurs - as it did in Maple 16, you say?

I reported it as a bug several months ago.

I haven't been working with modules earlier. I understand it as a kind of collection of procedures created for a special purpose, so it makes a whole and easier to work with.

That's one thing that modules are for.

@erik10 Also note that I gave an answer to your question about modules above.

@erik10 Also note that I gave an answer to your question about modules above.

@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,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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?

First 624 625 626 627 628 629 630 Last Page 626 of 708