dharr

Dr. David Harrington

8215 Reputation

22 Badges

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

The solution provided is a partial solution. Maple has managed to reduce your third order de to a second order one which it can't solve in the general case. So I doubt it can be reduced to a first order one.

When you specified the initial condition v(0)=C1, Maple did solve it and gave you the solution v(y)=C1 for all y. If you use odetest, it will verify that is a correct solution. Maybe not the one you wanted. You need to specify a first and second derivative at 0 as well. If you just choose C2 and C3 for these, Maple doesn't find a solution. Perhaps it can find a solution for some special values, but in my experience Maple can find a partial or general solution more easily than it can find one with conditions. 

Maple has a bunch of tools in the DEtools package to perhaps find an analytical solution if you know something about differential equations. Otherwise, a numerical solution may work for you.

% on its own gives the last expression as you say. That is unrelated to putting % in front of (many) things, which makes them inert. So %. is inert matrix multiplication - not evaluated until you use value - see examples in attached.

Download inert.mw

 

Maplecloud could be used for this. However, most journals allow supplementary information with the online version of an article, which can include Maple worksheets.

M := ExcelTools:-Import(cat(currentdir(), "/Data.xlsx"))

Generates a Matrix from the whole file. You can also specific a selection to import. The Matrix can be split into columns in various ways, depending on the names you want and what sort of variable. For example, for the first column as a Vector.

tim:=M[..,1];

To put 10 columns into variables x1,...x10

cat(x, 1 .. 10) := LinearAlgebra:-Column(M, 1 .. 10)

 

Using 

disk([x0,y0],0.06,color=black)

from the plottools package is clearer, both on the screen and in the .pdf export. I tried to find the reason by exporting to .eps and looking more closely in Coreldraw, but then they look the same, so the export process must work differently.

Following up on @acer's, suggestion, the following appears to work, but I'll let you check the bits to see if they are correct.

Download float.mw

Use

fprintf(fd,"%a",u11);
close(fd);

Edit: If you need the "u11:=", then that is

fprintf(fd,"u11:=%a",u11);
close(fd);

I interpret your x1prime as a derivative with respect to time, and assume the partial derivatives don't depend explicitly on time. Then the equations you give aren't really relevant, and something like the following works.

de1:=diff(H(x,y),x)=2*x*y^3;
de2:=diff(H(x,y),y)=3*x^2*y^2;
pdsolve({de1,de2});

{H(x, y) = x^2*y^3+_C1}

Download pdsolve.mw

The inttrans package in my version of Maple (2015) does not work this one out, but it can be worked out step by step using Cauchy's residue theorem.

Edit: redone to use strict upper half plane.

Download Fourier.mw

Here I read the whole file in as a string and then process it (including removing all the spaces). If you really have huge files, then reading line by line as in @mmcdara's answer is superior. But either way, I think the use of sscanf or fscanf helps.

readdata.mw

 

How about

foo:=proc(n::integer);
  if n=0 then
     return FAIL
  else
     return 1,2;
  fi;
end proc:
L:=foo(6);
if L<>FAIL then
  A,B:=L;
end if;

This also works if you return a list and use A,B:=L[]; 

If you really like the call form a,b:=foo(), then you could just return FAIL,FAIL and test A for FAIL.

The nonlinearsimplex method does not use derivatives and so can avoid this problem. But it can't do bounded problems. It finds the maxima at x=0, but these go to infinity, so not sure what you really want here. To find those, just look for where the reciprocal goes to zero, e.g., with fsolve.

plot.mw

restart;
with(GraphTheory):
G:=CycleGraph(4):
SetVertexPositions(G,[[0,0],[1,1],[2,0],[1,-1]]):
G:=RelabelVertices(G,["left","top","right","bottom"]):
DrawGraph(G);
ChromaticPolynomial(G, 5);

260

Download Flag.mw

You can recklessly force this, or play it safe with CancelInverses.

SolveTools:-CancelInverses(arcsin(sin(x)));

x
 

SolveTools:-CancelInverses(arcsin(sin(x)),'safe');

arcsin(sin(x))

 

Not sure I exactly understand how the code in test.mpl is being run. The command currentdir() finds the path of the currently running file (usually a (preexisting) worksheet but perhaps running from a command prompt?), and the subdirectory can then appended.

First 36 37 38 39 40 41 42 Last Page 38 of 81