dharr

Dr. David Harrington

8552 Reputation

22 Badges

21 years, 54 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@sand15 I agree that the modified third kind is just what is usually called the modified second kind. 2.14 and 2.15  in Garcia are the same as 10.27.4 and 10.27.5 in DLMF. 2.14 and 10.27.4 are for any index; 10.27.5 doesn't have the limit, but says below it take the limit if necessary. Then 2.15 and 10.27.5 are for integers, just written in slightly different ways.

It is interesting tha Garcia doesn't mention any modified second kind, so there must be some historical reason for this.

The DLMF lists Bessel functions of 1st, 2nd and 3rd kinds, the last being Hankel functions, but for the modified Bessel functions there are only the two kinds. So your notation seems non-standard, but can probably be related to the others. Do you have a definition?

@Andiguys As far as I can see, it looks OK.

@Andiguys You have set lambda to something with w in it. Then you try to set w to something with lambda in it, which has w in it, so we have a problem. Not sure what was intended here but you can't define w in terms of w.

I agree that there is that tendency not to acknowledge, and it is disappointing. There might be different reasons for this. The question was asked 2 minutes before the assignment is due (of course I'm exaggerating), and an answer wasn't forthcoming in 10 seconds.

On a slower timescale a more complicated question may be asked and if there is not an answer in a day or two, the person doesn't check back (and didn't subscribe).

Then there is the question where the asker expects you to read 27 literature papers and generate 5 worksheets, and is unhappy that you only generated one worksheet on one aspect.

I'm fine with some indication that a vote has been given by the asker.

However, the status quo has the blissful ignorance advantage: if it was a vote from someone else in the community and not the asker I'm happier than if I actually knew the asker ignored me.

@lemelinm You're welcome. I aimed at your objective to assign values to c etc, but @acer's point about eval is a good one (I voted up). So I would urge you not to assign. If you assign at the beginning, then it is very hard to debug rearrangements and manipulations of symbolic formulas which just output numbers. Almost all my worksheets derive things symbolically and then put numbers in at the end using eval(.., params). So I think the extra work of eval is offset by the ability to debug and "really see what is happening".

@salim-barzani One aspect is that solving for lambda[0] must give a constant (independent of xi) otherwise when substituted into the ode for G(xi), we are not respecting the conditions it was derived for.

As for the paper's lambda[0] not working for the ode for G(xi), that suggests that it is not the ode that corresponds to F.

In your problem-.mw, the value of lambda[0] does not matter.

I randomly looked at W[2] and it has an extra term with Z[2] (the last term) that is not in the paper. So is it some earlier part that is incorrect that you want to correct? If so please be more specific about where it goes wrong and what you want done.

You should not use the deprecated package linalg. If you just had that for jacobian, the new Jacobian is in VectorCalculus.

It seems like it is a bug. I played around with the first one trying for a workaround but didn't find one. For given numerical values of u__p and x you can numerically estimate the limit by giving a small value to u__m, e.g., -1e-30 with Digits:=50;

@Math-dashti Perhaps this is what you want. It finds the equilibrium points and the Jacobian.

bifur.mw

This version returns the quadratic form in a sum-of-squares form:

restart;

SumSquares takes a quadratic form with real coefficients and returns an explicitly positive sum of squares form if possible, i.e., if the matrix is positive semidefinite.

Set infolevel[SumSquares]:=2 to output the Matrix and its eigenvalues.

SumSquares:=proc(p::polynom)  # polynomial with names as variables and constants as coefficients
  local i,j,term,p1,terms,nvars,vars,tvars,A,a,tf,L,v2,P;
  uses LinearAlgebra;
  p1:=expand(p);
  vars:=[indets(p1,assignable(name))[]];
  nvars:=nops(vars);
  A:=Matrix(nvars,nvars,shape=symmetric);
  if type(p1,`+`) then terms:=[op(p1)] else terms:=[p1] end if; # make list of terms
  for term in terms do
    if degree(term)<>2 then error "not a quadratic form" end if;
    tvars:=indets(term,assignable(name));  # one indet for a*x^2; two for a*x*y
    if nops(tvars)=1 then
      member(tvars[1],vars,'i');
      a:=eval(term,tvars[1]=1);
      if is(Im(a)=0) then
        A[i,i]:=a;
      else
        error "coefficient %1 may have imaginary part",a
      end if;
    else
      member(tvars[1],vars,'i');
      member(tvars[2],vars,'j');
      a:=eval(term,{tvars[1]=1,tvars[2]=1});
      if is(Im(a)=0) then
        A[i,j]:=a/2;
      else
        error "coefficient %1 may have imaginary part",a
      end if;    
    end if;    
  end do;
  if ormap(type,[entries(A,'nolist')],float) then
    WARNING("result may be unreliable for floating point coefficients");
    if Rank(A)<nvars then WARNING("floating point singular matrix increases probability of unreliable result") end if;
  end if;
  userinfo(2,'procname',"Matrix and Eigenvalues:",print(A),Eigenvalues(A,output='list')[]);
  tf:=IsDefinite(A, query = 'positive_semidefinite'); # eigenvalues non-negative
print(tf);
  if not type(tf,truefalse) then error "Matrix is only positive semidefinite if %1",tf end if;
  if not tf then error "Matrix is not positive semidefinite" end if;
  L:=LUDecomposition(A, method='Cholesky');
  v2:=L^+.Vector(vars);
  P:=v2^+.v2;
  if type(P,`+`) then map(simplify,P) else P end if;
end proc:

P:=2*x^2-2*x*y-2*x*z+2*y^2-2*y*z+2*z^2;

2*x^2-2*x*y-2*x*z+2*y^2-2*y*z+2*z^2

SumSquares(P);

true

Warning, Matrix is not positive-definite

(1/2)*(2*x-y-z)^2+(3/2)*(y-z)^2

NULL

Download SumSquares.mw

@Alfred_F The routine I gave here writes a quadratic form in the sum of squares form. I'm not aware of a specific Maple command that does that. But your polynomial is not a quadratic form, so that wouldn't help here.

If by "same line" you mean "in the same execution group (same > prompt) but on the next line" then try shift-enter. If you really mean same line, then don't press enter, just keep typing, separating your commands with semicolons.

Otherwise, please provide a more detailed description of the problem and what you want.

@Suryakanth Did you make those changes?

@salim-barzani I think you want to get rid of z:=0; and later put eval(eqt1, z = 0).

1 2 3 4 5 6 7 Last Page 2 of 90