Robert Israel

6577 Reputation

21 Badges

18 years, 213 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are answers submitted by Robert Israel

> asympt( (ln(1+x))/x, x);

ln(x)/x+1/(x^2)-1/(2*x^3)+1/(3*x^4)-1/(4*x^5)+O(1/(x^6))

There is no way to avoid the logarithmic term.

 

The Logic package uses &or instead of V.  The procedure Equivalent checks whether two expressions are equivalent.  So: what two statements do you want to check for equivalence?

> f := r^4*s^7*t*exp(-alpha*r-gamma*r-beta*s-lambda*s);
    g := simplify(eval(f, {gamma=A-alpha, lambda = B - beta}));
   eval(int(int(int(g, t=r-s .. r+s), s=r .. infinity), 
      r = 0 .. infinity), {A=alpha+gamma, B=beta+lambda})
    assuming positive;

 

I assume you mean

> J := int(erfc((R+3*t)/(6*t^(1/2))),t=0..1);
J:=int(erfc((R+3*t)/(6*sqrt(t))), t = 0 .. 1)

Take the derivative wrt R (for R > 0), and simplify

> Jp := combine(expand(diff(J,R))) assuming R > 0; 

Jp := 1/3-1/3*exp(-1/3*R)-1/3*erf(1/2+1/6*R)+1/3*exp(-1/3*R)*erf(-1/2+1/6*R)

Now integrate term by term

> J1:= map(int,Jp, R);

J1 := 1/3*R+exp(-1/3*R)-2*(1/2+1/6*R)*erf(1/2+1/6*R)-2/Pi^(1/2)*exp(-(1/2+1/6*R)^2)+int(1/3*exp(-1/3*R)*erf(-1/2+1/6*R),R)

The last one has to be handled separately.

> J2:= op(-1,J1);

J2 := int(1/3*exp(-1/3*R)*erf(-1/2+1/6*R),R)

We can do this with an integration by parts.

 > with(IntegrationTools):
    Parts(J2, erf(-1/2+R/6));

-exp(-1/3*R)*erf(-1/2+1/6*R)+erf(1/2+1/6*R)

> J1:= subs(J2=%, J1);

J1 := 1/3*R+exp(-1/3*R)-2*(1/2+1/6*R)*erf(1/2+1/6*R)-2/Pi^(1/2)*exp(-(1/2+1/6*R)^2)-exp(-1/3*R)*erf(-1/2+1/6*R)+erf(1/2+1/6*R)

Now take care of the constant term.

> ans:= simplify(J1 + eval(J - J1,R=0));

ans := -1/3*(-R*Pi^(1/2)-3*exp(-1/3*R)*Pi^(1/2)+erf(1/2+1/6*R)*Pi^(1/2)*R+6*exp(-1/36*(3+R)^2)+3*exp(-1/3*R)*erf(-1/2+1/6*R)*Pi^(1/2))/Pi^(1/2)

Actually, this seems to work for R < 0 as well as R > 0.

 

For a closer look at this bug, consider these (in Standard GUI, Windows Vista):

This one is OK, there is a red dot pretty well centred at [0,0]:

> plot([[-1,1],[0,0],[1,1]],style=point);

This one is not OK: the red dot is definitely higher than [0,0]:

> plot([[-1,1],[0,1e-4],[1,1]],style=point);

Here the red dot is definitely higher than [0,0] (considerably higher than y=1e-4 should be).
  Click on the pictures (which are exported gifs) for a closer look.

The right side is diff(x(t),t), which with x(t) = 10*exp(-3*t) is -30*exp(-3*t).  And the Laplace transform of that is -30/(s+3).

I think what's confusing you is this.  The general formula for Laplace transform of a derivative is

laplace(diff(x(t),t),t,s) = s*laplace(x(t),t,s)-x(0)

In this case x(0) = 10, and the Laplace transform of x(t) is 10/(s+3), and so the result should be

10*s/(s+3)-10 = -30/(s+3)

 

You can use the Laplace transform for this one.

> with(inttrans):
  laplace(DV,t,s);

s*laplace(y(t), t, s)-y(0)+5*laplace(y(t), t, s)*s/(s^2+1) = 10/s

> invlaplace(solve(%, laplace(y(t),t,s)), s, t);

25*sqrt(6)*sin(sqrt(6)*t)*(1/18)+5*t*(1/3)+(1/6)*y(0)*(1+5*cos(sqrt(6)*t))

To test it out:

> eval(DV, y = unapply(%,t));

10=10

I'm a bit disappointed that

> intsolve(DV, y(t), method=Laplace);

doesn't work.  While this is not one of the types of equations listed in the help page for intsolve, it should be easy to make
intsolve(..., method=Laplace) handle equations of the type

P(D)(y)(t) + int(g(t-tau)*y(tau), tau = 0 .. t) = 0

where P is a polynomial with constant coefficients.

 

As Jean-Marc said, it would be best if you posted your system of equations.  But as a general remark, I might point out that the complexity of (symbolically) solving systems of nonlinear equations can go up very rapidly as the number of variables and equations increases, and even 8 quadratic equations in 8 unknowns may turn out to be very difficult.  Moreover, the size of the solution may end up being very large, maybe even too large for your computer's memory. 
 

You might try using Solve in the Groebner package rather than solve.  Or if you're looking for an approximate numerical solution, you might try fsolve.

There are basically two ways to make a function in Maple:

1) a direct definition using -> or proc ... end proc, and

2) unapply

The direct definition requires you to type in the function definition, while unapply allows you to use an already-existing expression.  In the case of solutions to equations, you have that expression, so you use unapply.

I don't know what solutions you say you can't obtain.  Maple can and does solve the cubic

> solve(x^3 = 15*x + 4);

 4, -2+sqrt(3), -2-sqrt(3)

Maple also solved your system {e1=2, e2=11}, obtaining the answer {a=2,b=1} you were looking for as well as others where a and b were not integers
(assuming does not restrict the results of solve).

 

You must be using parentheses () rather than brackets [].   To assign a value to an entry of a matrix, the normal syntax is

> A[2,3] := 4;

not

> A(2,3) := 4;

 

This works fine if you use 1D input (which I highly recommend that you do).  You must be using 2D input, which I do not recommend.

Go to Tools, Options, Display, and change Input Display to "Maple Notation".  Then click "Apply Globally".

 

For your first question, you might look up the hypergeometric distribution.  In Maple,

?Statistics,Distributions,Hypergeometric

 

 

For example:

> data := [[1,2], [3,5], [2,4], [3, 8], [4, 9]];  # replace with your list of points.
  xdata:= map2(op,1,data); 
  ydata:= map2(op,2,data);

> F:= Statistics[Fit](a+b*x,xdata,ydata,x);

F := -.499999999999997612+2.34615384615384582*x

> with(plots):
  display([plot(F,x=0..5), pointplot(data)]);


  

 

 


  

Use the makehelp command.  See the help page ?makehelp.

First 84 85 86 87 88 89 90 Last Page 86 of 138