dharr

Dr. David Harrington

8270 Reputation

22 Badges

20 years, 359 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

Hard to follow, but I get a message that some variables are in the equations but are not solved for, because you missed them in your set of variables. The easiest way to prevent this is to use

vars:=indets(Eqs1);

In Maple 16 (not Classic), if you want 1-D Maple input as the default (instead of ctrl-M every line), go to tools/options/display/and set Input Display to "Maple Notation".

 

One thing to check is that if autosave is too frequent, then for a long save or long calculation, one autosave starts before the previous one has finished. Try setting the autosave to a less frequent interval.

As far as I know, the numerical solver doesn't accept conditions involving integrals.

I'm not sure I understand the question. Since the solution is not unique, you can't choose which solution the numeric solver will get unless you change the way you specify the boundary conditions, say, by specifiying a first derivative at 0 (say D(f)(0)=1 ) and not the boundary condition at infinity. Then each slope you choose will give you a different (correct) solution.

 

Just using dsolve(eq1) gives a complicated answer with too much freedom. Try  ans:=dsolve(eq1,f(0)=0) (I am assuming you wanted a=0), which gives four answers, the f(x)=0 one, the tanh one you want and two others:

f(x) = 0, f(x) = tanh((1/2)*x*2^(1/2)/_C1)*2^(1/2)/_C1, f(x) = -2*tan((x+_C2)*Pi/_C2)*Pi/_C2, f(x) = -2^(2/3)*_C1*(3^(1/2)*AiryAi(1, -(1/2)*2^(2/3)*_C1*x)+AiryBi(1, -(1/2)*2^(2/3)*_C1*x))/(3^(1/2)*AiryAi(-(1/2)*2^(2/3)*_C1*x)+AiryBi(-(1/2)*2^(2/3)*_C1*x))

The limit of the derivative is zero for any _C1:

limit(diff(rhs(ans[2]),x),x=infinity) assuming positive; gives 0

tans:=eval(ans[2],_C1=sqrt(2)); gives f(x)=tanh(x/2) and odetest verifies everything is OK:

odetest(tans, [eq1, f(0) = 0, (D(f))(infinity) = 0, (D(D(f)))(0) = 0]); gives [0,0,0,0]

Using other _C1 values also gives OK solutions.

 

 

ToeplitzMatrix in the LinearAlgebra package can do this

with(LinearAlgebra):
ToeplitzMatrix([0,0,c,b,a,0,0]);
ToeplitzMatrix([0,0,x^2,sin(x),x,0,0]);


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);

 

First 72 73 74 75 76 77 78 Last Page 74 of 82