Axel Vogt

5936 Reputation

20 Badges

20 years, 252 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

?unapply

  [solve(a*x^2+b*x+c=0, x)]; # a list
  %[1];                      # take the first entry
  f:=unapply(%, x);          # and make it a function of x

Note that this silently assumes a <> 0.

Without being an admin: that sound like a problem of the printer driver (may be related to Java version), since you say it works with an older model

try ?degree or ?lcoeff depending on your needs

As far as I see: 'out' does not have a value and thus the for-loop does not work.

What do you want to process? The elements of your S?

 

PS: Please do not duplicate threads, there is not need to post the same question twice,
http://www.mapleprimes.com/questions/100067-Code-Generation-Query

xi=ln(x); 
newCoord:=isolate(%, x);

                       newCoord := x = exp(xi)
ln(x); eval(%, newCoord); 
plot(%, xi=1 ..3);

Also see ?plots[logplot]
Sorry, I was quite absentminded.
It happens as well in a concurrent test version. And there:
J := 2*sin(Pi*k)/k;
J assuming k::integer;
                                  0
limit(J, k=0);
                                 2 Pi
Which is: no care is taken for the in-definte case.
Moreover:
sol:=int(exp(I*k*x),x);
                                -I exp(k x I)
                         sol := -------------
                                      k
discont(sol, x);
                                  {}

int(exp(I*k*x),x) assuming k::integer;
                            -I exp(k x I)
                            -------------
                                  k
So Maple cares only for the 'generic' case.

Not sure, whether that is the (?) reason.

Hint: what is the root of (x - 7) ?

Do you need to care for leading coefficients, looking at 2*(x-7)?

Do you need to care for degrees, looking at x*(x-7)?

 ?                     

temp:=phi(Lambda(tau, 0), tau, 0)+
((D[1](phi))(Lambda(tau, 0), tau, 0)*(D[2](Lambda))(tau, 0)+
(D[3](phi))(Lambda(tau, 0), tau, 0))*q;
eval(temp, Lambda = '(x,y) -> c[y](x)');
  phi(c[0](tau), tau, 0) + (
        D[1](phi)(c[0](tau), tau, 0) D[2]((x, y) -> c[y](x))(tau, 0)
         + D[3](phi)(c[0](tau), tau, 0)) q
eval(temp, Lambda = '(x,y) -> c[0](x)');

       phi(c[0](tau), tau, 0) + D[3](phi)(c[0](tau), tau, 0) q

As you see, that is 'sensitive' to the interpretation of input
and you may want to think about using indexed variables
(which often are used for 'pretty appearance' only).
# your sheet gives the following integrand E
E:=exp(-B*((1/8)*f/Pi^2+(1/2)*f*x^2));

# you want Int(Int(E, f),x) - interchange variables
Int(Int(E, x),f); value(%); subs(int=Int, %);

# change variables, 0< B, 0 < f assumed for that
Change(%, B*f/4/Pi^2 = y^2, y);

# beautify it
combine(%) assuming 0 < y;
expand(%); lprint(%);

2/B*Pi^(3/2)*2^(1/2)*Int(erf(1/2*y*Pi*x*8^(1/2))*exp(-1/2*y^2),y);

               3/2  1/2   /             1/2          2
           2 Pi    2     |      y Pi x 8            y
           ------------  |  erf(-----------) exp(- ----) dy
                B        |           2              2
                        /

Now 1 +erf ~ cumulative normal distribution cdfN and exp(-1/2*y^2)
is like its derivative, pdfN.

So this is Int( (cdfN - 1) * pdfN ) = Int( cdfN * pdfN ) - Int(pdfN).

The last on the right hand side is cdfN. And for the first one has
to know, that this is a bivariate normal (see Abramowitz & Stegun?):

Int( pdfN(xi)* cdfN((y-rho*xi)/sqrt(1-rho^2)),xi=-infinity..x) is a
way to write the bivariate in x and y with correlation rho.

What remains is to determine the 'settings' to pass from your task
to the bivariate.

Hm ... at least any ranges for your variables and parameters B, x, f?

For me M 9.52 on Windows 7 worked in a test (not very deep and classic worksheets), essentially.

The only problem: exporting things (what kind ever) crashed the application

I have not tested in detail, but that may the reason is, that a conversion from integer ---> float is expensive (even if you cared in your code, that it is smaller than MAX_INT)

A 'brute' way would be: find the polynomial given by the points and Maple can do that (i.e. it depends on what is intended).

1. That code does not work for me (Maple 12: too many recursions)

2. If you want 'exact' values, then do not work with floats. In your case
it should be alpha = 1/2, not 0.5 and the usage evalf(Pi) instead of Pi.

First 47 48 49 50 51 52 53 Last Page 49 of 93