Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are answers submitted by Robert Israel

It worked for me, but of course I don't know what your someproc() is.  My guess is you're catching some exception other than "time expired".

It's the same in Maple 13.  This is a bug, and I'm submitting an SCR.  The problem is in curry.  Consider:

> curry(f, p)(x);

  f(f, x)

which should be f(p, x).

The bug is rather subtle, I think, and I don't understand how it happens, but it's related to the fact that p is used as a formal parameter in the code for curry

 

Maple won't ask, but I think you do get a remember table assignment.  Thus:

> D(f)(a1):= 0;
  D(f)(x);

unknown(x)

I haven't had any trouble opening Maple 12 files with Maple 13.  If you can post the file here (or a link to the online file), someone might be able to see what might be wrong.

It's a really bad idea to use Matrix as the name of your Matrix.  The name Matrix is protected in order to prevent this.  Maple needs to use this name for its Matrix type. 

Four pieces of data, so they should determine a polynomial of degree 3.

PolynomialInterpolation, which answered your last question, won't let you specify a derivative directly.  However, you can write your cubic as f(x0) + (x-x0)*g(x) where f'(x0) = g(x0) and f(xi) = f(x0) + (xi - x0)*g(xi) for i = 1,2.  So

 

> g:= CurveFitting:-PolynomialInterpolation(
    [[x0, D(f)(x0)], [x1, (f(x1) - f(x0))/(x1 - x0)],
     [x2, (f(x2) - f(x0))/(x1 - x0)]], x);
  P:= f(x0) + (x-x0)*g;

Set your typesetting level to Extended, and it should work.

I might do it like this:

> A:= Statistics:-Sample(Uniform(-8,8), 100);
  plots:-pointplot(map(t -> <t | t^2>, A));

 

 

Only three f values?  You could interpolate a quadratic to these:

> P:= CurveFitting[PolynomialInterpolation]([[x0,f(x0)],
[x1,f(x1)],[x2,f(x2)]],x);

Then use the appropriate derivatives of P.  Since it's a quadratic, the second derivative will be constant, and the third and higher will be 0.

 

> frontend(curry(subs,A),[B]);

Yes, it's quite a nice programming exercise, and there are many ways to do it.
You might look at en.wikipedia.org/wiki/N_queens_problem

 

You might try using patmatch.

> pattern:= a::algebraic*x[1]+b::algebraic*x[2]+c::algebraic*x[3]
     +d::algebraic;
  expr:= (q/r-sqrt(2))*x[1] + x[2] - (w*r+4)*x[3] + D(G)(x[1]) 
     - D(G)(x[3]);
  patmatch(expr, pattern, 'subst');

          true

> subst;

[a = q/r-2^(1/2), b = 1, c = -w*r-4, d = -D(G)(x[3])+D(G)(x[1])]

Or use frontend.

> seq(frontend(coeff, [expr, v]), v = [x[1], x[2], x[3]]);

q/r-2^(1/2), 1, -w*r-4

 

OK, your equation will likely have multiple solutions for each k.  So, what is an "appropriate" or "satisfactory" one?  If you know an interval you'd like l to be in, you can supply that interval to fsolve, e.g.

> fsolve(subs(l=k, A2), sigma = -100 .. 100);

If you want all the roots in an interval, you could try RootFinding:-Analytic.

While typing text (in a Standard worksheet), switch to embedded math by clicking on Math in the Context Bar. Go back to text mode by clicking Text.

I think your memory is faulty.  I don't think there was ever a Maple command plot2D.
The command for finding a coefficient of a polynomial is and was coeff, not Coefficient.  Diff is and was the inert version of diff, and the syntax of these have not changed in many years, certainly not since I first got acquainted with Maple V Release 2, at least 16 years ago.

First 53 54 55 56 57 58 59 Last Page 55 of 138