Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 360 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

dsolve({ode1, bcs1}, T(z)) returns a fairly compact solution in terms of erf. Presumably you already know that. So, what's wrong with that solution?

@brian bovril Thank you for your interest in the Logic Problem package, Brian. The problem needs to be "massaged" somewhat before it can be coded into the package. In order to use the package, the "variables" EN, Dept, and Sport each need to have the same number of possible values---eight in this case. But there are only three values for Dept. If we knew how many people worked in each department, then we could add extra values to Dept. For example, if we knew that there were three in personnel, three in marketing, and two in administration then we could make the values person||(1..3), market||(1..3), and admin||(1..2). But we don't know the breakdown between the departments.

However, we do know that there are only three possible breakdowns because there are "not more than three of them in any department". By the pigeonhole principle, the breakdown must be 3-3-2, 3-2-3, or 2-3-3. Furthermore, we know "Fay works in Personnel with only Alex". So, there are two in personnel and three in the other two. So we set

Dept:= [person||(1..2), market||(1..3), admin||(1..3)];

I'll work on coding the rest of problem later.

@pepegna90 I don't see the screenshot.

@pepegna90 To get the sum of the ith row of Matrix M, use add(x, x in M[i, ..]);

Note that style=line is only appropriate if the points are sorted. It is better to vary the symbol (as noted by Christopher).

plot(
     [[seq([n, sin((1/10)*n)], n=0..30)], [seq([n, cos((1/10)*n)], n=0..30)]],
     style= point, symbol= [cross, diamond]
);

@jerbertz In your implementation of RLopez's method, you have print~([TestList])[]. The TestList should be TestSeq, the same TestSeq that you used with the other methods. Then it will work as advertised.

@Andriy Sorry, the file is not attached.

@Alejandro Jakubi That's a good question, Alejandro. It is based on my experiments. So, the validity of this might be limited to Windows.

restart:
st:= kernelopts(cputime):  t:= st:
while t = st do  t:= kernelopts(cputime)  end do:
t - st;
                        0.0156250000000000
convert(%, rational);
                               1
                               --
                               64

If you use time(), that value will be reported as 0.016.

@Andriy Your file did not attach. This is a bug in MaplePrimes. Please try attaching it again.

That's enough information about H. It seems big enough to make using Grid worthwhile.

Your problem with using Grid is probably due to the use of global variables. Consider one of our previous examples with Threads:-Seq:

N:= 4:
elem:= `*`:
A:= Matrix(N, N, shape= symmetric):
for i to N do
     A[i, i..N]:= < Threads:-Seq(elem(i,j), j= i..N) >
end do
:

If we replace Threads with Grid, it seems to object to the global variable N. To make it work, change N to a parameter by changing the key line to

     A[i, i..N]:= (N-> < Grid:-Seq(elem(i,j), j= 1..N) >)(N)

I do not know why it does not similarly object to global variable i.

@Andriy You can still use Grid:-Seq, which does parallel processing without a shared-memory environment, hence there are no "safety" issues. But Grid has a much higher overhead. It definitely wouldn't be worth it for something as trivial as that Bessel example. How big is the matrix H? And how complex are psi1 and psi2?

@Axel Vogt Don't worry about hijacking.

WolframAlpha seems able to handle this situation gracefully, with no special operators needed. I would guess that the same is true of Mathematica, but I don't have it to test.

@Markiyan Hirnyk 

I am sorry, MaplePrimes will not let me edit the messed up Replies. This time, I'll just give the Maple input, and you can generate the output on your own.

diff(f(u(x,y),v(x,y)), x);
convert(%, Diff);

diff(f(u(x,y),v(x,y)), x, x);
convert(%, Diff);

@Markiyan Hirnyk 

I cannot edit the last Reply, which MaplePrimes really messed up. Trying the upload again.

diff(f(u(x,y),v(x,y)), x);

(D[1](f))(u(x, y), v(x, y))*(diff(u(x, y), x))+(D[2](f))(u(x, y), v(x, y))*(diff(v(x, y), x))

convert(%, Diff);

(eval(Diff(f(t1, v(x, y)), t1), {t1 = u(x, y)}))*(Diff(u(x, y), x))+(eval(Diff(f(u(x, y), t2), t2), {t2 = v(x, y)}))*(Diff(v(x, y), x))

diff(f(u(x,y),v(x,y)), x$2);

((D[1, 1](f))(u(x, y), v(x, y))*(diff(u(x, y), x))+(D[1, 2](f))(u(x, y), v(x, y))*(diff(v(x, y), x)))*(diff(u(x, y), x))+(D[1](f))(u(x, y), v(x, y))*(diff(diff(u(x, y), x), x))+((D[1, 2](f))(u(x, y), v(x, y))*(diff(u(x, y), x))+(D[2, 2](f))(u(x, y), v(x, y))*(diff(v(x, y), x)))*(diff(v(x, y), x))+(D[2](f))(u(x, y), v(x, y))*(diff(diff(v(x, y), x), x))

convert(%, Diff);

((eval(Diff(f(t1, v(x, y)), t1, t1), {t1 = u(x, y)}))*(Diff(u(x, y), x))+(eval(Diff(f(t1, t2), t1, t2), {t1 = u(x, y), t2 = v(x, y)}))*(Diff(v(x, y), x)))*(Diff(u(x, y), x))+(eval(Diff(f(t1, v(x, y)), t1), {t1 = u(x, y)}))*(Diff(Diff(u(x, y), x), x))+((eval(Diff(f(t1, t2), t1, t2), {t1 = u(x, y), t2 = v(x, y)}))*(Diff(u(x, y), x))+(eval(Diff(f(u(x, y), t2), t2, t2), {t2 = v(x, y)}))*(Diff(v(x, y), x)))*(Diff(v(x, y), x))+(eval(Diff(f(u(x, y), t2), t2), {t2 = v(x, y)}))*(Diff(Diff(v(x, y), x), x))

 


Download convertDiff.mw

 

@Markiyan Hirnyk 

Agreed, it is untidy.

In your transcription of the example at ?convert,diff , you missed the [2] in the last term.

Here is what the OP meant as input (although I don't know whether he will be pleased with the voluminous output).


diff(f(u(x,y),v(x,y)), x);

(D[1](f))(u(x, y), v(x, y))*(diff(u(x, y), x))+(D[2](f))(u(x, y), v(x, y))*(diff(v(x, y), x))

convert(%, Diff);

(eval(Diff(f(t1, v(x, y)), t1), {t1 = u(x, y)}))*(Diff(u(x, y), x))+(eval(Diff(f(u(x, y), t2), t2), {t2 = v(x, y)}))*(Diff(v(x, y), x))

diff(f(u(x,y),v(x,y)), x$2);

((D[1, 1](f))(u(x, y), v(x, y))*(diff(u(x, y), x))+(D[1, 2](f))(u(x, y), v(x, y))*(diff(v(x, y), x)))*(diff(u(x, y), x))+(D[1](f))(u(x, y), v(x, y))*(diff(diff(u(x, y), x), x))+((D[1, 2](f))(u(x, y), v(x, y))*(diff(u(x, y), x))+(D[2, 2](f))(u(x, y), v(x, y))*(diff(v(x, y), x)))*(diff(v(x, y), x))+(D[2](f))(u(x, y), v(x, y))*(diff(diff(v(x, y), x), x))

convert(%, Diff);

((eval(Diff(f(t1, v(x, y)), t1, t1), {t1 = u(x, y)}))*(Diff(u(x, y), x))+(eval(Diff(f(t1, t2), t1, t2), {t1 = u(x, y), t2 = v(x, y)}))*(Diff(v(x, y), x)))*(Diff(u(x, y), x))+(eval(Diff(f(t1, v(x, y)), t1), {t1 = u(x, y)}))*(Diff(Diff(u(x, y), x), x))+((eval(Diff(f(t1, t2), t1, t2), {t1 = u(x, y), t2 = v(x, y)}))*(Diff(u(x, y), x))+(eval(Diff(f(u(x, y), t2), t2, t2), {t2 = v(x, y)}))*(Diff(v(x, y), x)))*(Diff(v(x, y), x))+(eval(Diff(f(u(x, y), t2), t2), {t2 = v(x, y)}))*(Diff(Diff(v(x, y), x), x))

 


Download convertDiff.mw

@Markiyan Hirnyk In your first example, f is a function of two variables, and you have not specified the variables with respect to which to take its derivatives. Perhaps such a situation should generate an error message. Regardless, the situation is different than the one the OP is asking about, for which convert(..., Diff) does work fine.

In your second example, D1 is just a meaningless symbol to Maple.

In your third example, the convert(..., Diff) works fine for me. You might need to do a restart; it seems as if f is already defined for you.

First 569 570 571 572 573 574 575 Last Page 571 of 709