dharr

Dr. David Harrington

8205 Reputation

22 Badges

20 years, 336 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

msolve doesn't work here, since in modulo 2 arithmetic, 1+1+1=1, which allows x1=1,x2=1,x3=1, etc. If your row and column sums are always going to be 1, then the permutation matrices are the answer, since they have one 1 and the rest zeroes in every row and column. There will be 6 solutions in the 3x3 case. Choose where to put the 1 in the first row (3 choices). For your second row, you can choose any of the two other positions, and then for the third row you must use the last postion, for a total of 3x2=6 possibilities.

If you will be doing other row and column sums, then it is a harder problem.

restart:with(PDEtools):
q:=12*(diff(u(x),x$7))^(3/2)*(diff(u(x),x$2))^3;

q := 12*(diff(u(x), x, x, x, x, x, x, x))^(3/2)*(diff(u(x), x, x))^3

1. To get the non-derivative coefficient (12) of this term

remove(has,q,diff);

12

2. To get the third factor, it is easier to remove the 12 and the 2nd factor. dcoeffs considers the second factor to be part of the coefficient, presumably because it deals only with polynomials of derivatives, and the second factor has a non-integral degree

q2:=dcoeffs(q,u(x));
q3:=q/q2;

q2 := 12*(diff(u(x), x, x, x, x, x, x, x))^(3/2)

q3 := (diff(u(x), x, x))^3

 

3. To get the order of this, use difforder

difforder(q3);
difforder(q2);

2

7

 4. To get the degree of this, I would probably use op, but one needs to know that the degree isn't one or treat this case separately

op(2,q3); #dangerous
if type(q3,`^`) then op(2,q3) else 1 end if;

3

3

 

shift-enter inserts a line without the arrow prompt appearing.

use display to combine the two plots, each with their own ranges.

with(plots):

p1:=plot(f,1..3,color=blue):

p2:=plot(g,-2..1,color=red):

display(p1,p2);

Well to get arccosh(3) without evalf, use arccosh(3.0). But that isn't what you need to solve your plot problem.

F:=(x,y)->x*y;
plot(sin(int(F(x,z), x=arccosh(z)...0)), z=1..2);

produces a plot for me (Maple 10), so there must besomething specific about the functions that you are using.

break is for within loops, and yours is not. I think you want "return" here, for premature exit from the procedure. 

Maple has a command for this. It gives the single solution that Alec found above

d:=diff(y(x),x)*diff(y(x),x$3)-diff(y(x),x$2):

DEtools[polysols](d,y(x));

gives

[y(x) = _C3+_C4*x]

 

Since you want the functions T(x1) and T(y1), you should set these up before the loop, e.g.,

h:=solve(x1*exp (T) -1,T); gives h1:=-ln(x1) and then you can turn it into a function by using unapply

Tx1:=unapply(h,x1);

makes a function that is the same as if you had gone

Tx1:=x1->-ln(x1)

and to use it you do  Tx1(3); to get -ln(3)
 

and now your loop is easier (but I'm not sure what you want to do with y1).

To prevent all lines in the loop being output, end your "end do" with a ":", and then use print to force output of the lines you do want to print, e.g,

for i from 1 to 10 do
 x1:=1*i:
 T1:=Tx1(x1);
 print(T=T1);
 print(y1=3*T1);
end do:

 and you can plot the functions by plot(Tx1(x),x=2..5);

 

Just put the commands in a procedure with no arguments - use print to force output of the individual commands. This can be used with the debugger, e.g.,

dothem:=proc()
   print(plot(x^2,x=0..2));
   print("Yo ho ho");
   DEBUG();
   print(int(sin(x),x=0..Pi));
end proc;

(the last "print" is redundant). To invoke it:

dothem();

I not sure what you mean. You wanted "one time fixed , vary x in a especific range"? But if you want to vary x and t, just use the other form of value (see the help page for pdsolve,numeric)

ut:=sol:-value(u(x,t),output=listprocedure);
for tt from 0 to 1 by 0.2 do
   for xx from -5 to 5 by 2 do
      print(tt,xx,rhs(ut[3])(xx,tt));
   end do;
end do;

gives values of t,x and u, e.g., 

                 0, -5, -1.00011793431098361

                  0, -3, -0.995054753686730464

                  0, -1, -0.653755734133799948

                   0, 1, 0.653755734133799948

                   0, 3, 0.995054753686730464

                   0, 5, 1.00011793431098361

etc.

(You can also do a 3D plot to see the data:

sol:-plot3d(t=0..1,x=-15..15,axes=boxed);
)

 

 

To get time, x, u values at a fixed time, e.g., t=1 use

u1:=sol:-value(u(x,t),t=1,output=listprocedure);

for x from -15 to 15 by 2 do rhs(u1[2]),x,rhs(u1[3])(x) end do;

gives:

                 1., -15, -0.99999999999995826

                 1., -13, -1.00000000159796176

                 1., -11, -1.00000001778633862

                  1., -9, -0.99999990540129812

                  1., -7, -1.00000347942147538

etc

 

Georgios has slipped the 2 into the wrong place; you want

polarplot([2*sin(theta),theta,theta=0..2*Pi]);

 

&* can be used as a non-commutative operator. You can have this and similar operators and assign them various properties. See ?neutral and ?define

you have z31x*31 where you mean z31*x31 and z32x*21 where you mean z32*x21.

When I correct those, I get 346 solutions.

Cheers,

David.

 

I'm not a mathtype user, but the web site suggests you can input in latex. Since Maple can generate latex with the latex command, in principle this should work. Perhaps someone else has tried this?

First 72 73 74 75 76 77 78 Page 74 of 81