Carl Love

Carl Love

28045 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@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*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+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*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?

@abbeykabir Ok, that's good. Now let's generalize that to the multivariate case, where x is an n-vector, and f is a vector-valued function on n-vectors (i.e., f: R^n -> R^n). In particluar, what corresponds to the derivative in the multivariable case?

@abbeykabir Ok, that's good. Now let's generalize that to the multivariate case, where x is an n-vector, and f is a vector-valued function on n-vectors (i.e., f: R^n -> R^n). In particluar, what corresponds to the derivative in the multivariable case?

laplace suffers from a severe case of "floating-point contagion"---the phenomenon that an expression with some floats acquires more floats after a transformation. You can see what's going on from lines 10-15 of showstat(inttrans[laplace]): If the original has any floats, then all rationals (including integers) in the result are converted to floats. The cure is as ThU says: Apply convert(..., rational) before calling laplace. Of course, as ThU said, laplace is not going to be of much help in solving this differential equation.

laplace suffers from a severe case of "floating-point contagion"---the phenomenon that an expression with some floats acquires more floats after a transformation. You can see what's going on from lines 10-15 of showstat(inttrans[laplace]): If the original has any floats, then all rationals (including integers) in the result are converted to floats. The cure is as ThU says: Apply convert(..., rational) before calling laplace. Of course, as ThU said, laplace is not going to be of much help in solving this differential equation.

@abbeykabir Let's start with what you do know. What do you know about Newton's method? Let's start with the single-variable case.

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