Carl Love

Carl Love

28110 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Alejandro Jakubi FWIW, lprint shows that the 2D if in prefix form is translated to 1D `if` as an automatic simplification.
 

@Andriy It is allowed without the quotes in 2d input. In 1d input (Maple Input), it is an immediate syntax error to use if in prefix form without the quotes, because if is a ?keyword . The prefix form `if` means the same thing as if it were defined thus

`if`:= proc(condition, expression1::uneval, expression2::uneval)
local B;
     B:= evalb(condition);
     if B=true or B=false then
          if B then  return eval(expression1)  else  return eval(expression2)  end if
     else
          return '`if`(condition, expression1, expression2)'  #return unevaluated
     fi
end proc

But, it is a builtin, or kernel, procedure, so it isn't actually written in Maple code as above.    

@Andriy It is allowed without the quotes in 2d input. In 1d input (Maple Input), it is an immediate syntax error to use if in prefix form without the quotes, because if is a ?keyword . The prefix form `if` means the same thing as if it were defined thus

`if`:= proc(condition, expression1::uneval, expression2::uneval)
local B;
     B:= evalb(condition);
     if B=true or B=false then
          if B then  return eval(expression1)  else  return eval(expression2)  end if
     else
          return '`if`(condition, expression1, expression2)'  #return unevaluated
     fi
end proc

But, it is a builtin, or kernel, procedure, so it isn't actually written in Maple code as above.    

@Alejandro Jakubi Very nice trick: computing series with respect to two different variables in the same computation.

@Alejandro Jakubi Very nice trick: computing series with respect to two different variables in the same computation.

Perhaps the information that you seek can be found on the help pages ?pdsolve,numeric,pdemethods and ?pdsolve,numeric,education .

@yangtheary There is no aspect of the problem statement or diagram that distinguishes the up-down dimension from the left-right dimension. Therefore, the outer lattice and the inner lattice are each squares. Therefore, the answer is a sum of two squares.

@yangtheary There is no aspect of the problem statement or diagram that distinguishes the up-down dimension from the left-right dimension. Therefore, the outer lattice and the inner lattice are each squares. Therefore, the answer is a sum of two squares.

@casperyc I haven't looked at it yet, but when you say "failed" do you mean that the answer is wrong or that it takes too long to get?

The reverse order trick only worked becuase of a special form of the relations: Each one was the previous one essentially to a higher power (except that first one was independent of the rest). In general, if the relations are applied sequentially, the results will be wrong, i.e., not as simplified as if they were applied all together.

Please make this a separate Question thread. It is some trouble to dig up old threads.

@casperyc I haven't looked at it yet, but when you say "failed" do you mean that the answer is wrong or that it takes too long to get?

The reverse order trick only worked becuase of a special form of the relations: Each one was the previous one essentially to a higher power (except that first one was independent of the rest). In general, if the relations are applied sequentially, the results will be wrong, i.e., not as simplified as if they were applied all together.

Please make this a separate Question thread. It is some trouble to dig up old threads.

@Alejandro Jakubi I guess that it is too much to hope for at this point. But solve or allvalues will sometimes show a general pattern for a trancendental equation (with, _Zn~_Bn~, _NNn~) that allows you to compute as many of an infinite sequence of roots as you want.

Something for future development: For the equation tan(x)=x, it could tell you that there is exactly one root in each interval (2*_Z1~-1)*Pi/2..(2*_Z1~+1)*Pi/2. Note that the notation for this already exists in RootOf: The second argument can be a range.

@Alejandro Jakubi I guess that it is too much to hope for at this point. But solve or allvalues will sometimes show a general pattern for a trancendental equation (with, _Zn~_Bn~, _NNn~) that allows you to compute as many of an infinite sequence of roots as you want.

Something for future development: For the equation tan(x)=x, it could tell you that there is exactly one root in each interval (2*_Z1~-1)*Pi/2..(2*_Z1~+1)*Pi/2. Note that the notation for this already exists in RootOf: The second argument can be a range.

@Andriy It means the same thing as

nn:= proc(i,j,sigma)
     if type(i,integer) and type(j,integer) and type(sigma,integer) then
          return ap(i,j,sigma) . am(i,j,sigma)
     else
          return 'nn'(i,j,sigma) #return unevaluated
     end if
end proc;

@Andriy It means the same thing as

nn:= proc(i,j,sigma)
     if type(i,integer) and type(j,integer) and type(sigma,integer) then
          return ap(i,j,sigma) . am(i,j,sigma)
     else
          return 'nn'(i,j,sigma) #return unevaluated
     end if
end proc;

@Mathematix The answer will be a function for i(t). Are you sure that there is not some other equation in the problem? possibly an equation with a derivative of q? Now, I can use the above as the value of q(t) and get a solution for i(t), but I have a feeling that that is not what was intended.

Also, please clarify if the term is (1/C)*q(t) or 1/(C*q(t)). By default it would be the former.

With the information provided so far, the answer will be

ode:= L*D(i)(t) + (R[1]+R[2])*i(t) + 1/C*q(t) = U;

dsolve(
     eval(
          {ode, i(0)=0},
          [L= 2, R[1]= 2, R[2]= 8, C= 1/12,
           U= 4*exp(-t),
           q(t) = -3*exp(-3) + 4*exp(-2*t) + exp(-t)
          ]
     )
);

First 619 620 621 622 623 624 625 Last Page 621 of 710