Thomas Richard

Mr. Thomas Richard

2543 Reputation

12 Badges

12 years, 60 days
Maplesoft Europe GmbH
Technical professional in industry or government
Aachen, North Rhine-Westphalia, Germany

MaplePrimes Activity


These are answers submitted by Thomas Richard

The CodeGeneration package will translate some LinearAlgebra routines (see the HilbertMatrix example at ?CodeGeneration,Python), but not GraphTheory.

So I'm afraid you will have to do the translation more or less manually.

First of all, rule-based typesetting is only available in extended level.

Next, you can force the factor of 1/2 to be kept as is, but it will be wrapped in parentheses (I don't think you can get rid of these).

So here's my suggestion:

interface(typesetting=extended):
with(Typesetting):
Settings(typesetdot=true):
Suppress(x(t)):
diff(``(1/2)*LongExpression*x(t),t);

In order to obtain a fraction, you may call expand(%) afterwards.

Note that interface(compactdisplay) is about displaying procedures, and has nothing to do with formulae.

Following the conventions of the DynamicSystems package, u1(t) is your input, so you need to tell dsolve to solve for the others (x1(t), x2(t), x3(t) are states, and y1(t) is the output):

sys := [diff(x1(t), t) = x2(t), diff(x2(t), t) = -x3(t)/3, diff(x3(t), t) = 6*x2(t) - 3*x3(t) - 3*u1(t), y1(t) = -6*x1(t) + x2(t)]:
numelems(sys);
fcns := [x1(t),x2(t),x3(t),y1(t)]:
sol := dsolve(sys,fcns);
odetest(sol,sys); # optional check

So you have 4 equations and 4 unknown functions. Integration constants _C1, _C2, _C3, _C4 will be determined when you supply initial conditions for fcns. The integrals in those solutions can be computed once u1(t) is specified.

You could also swap the roles of u1(t) and y1(t), of course.

I think this only works in standard typesetting level, so execute

interface(typesetting=standard):

before, or use its interactive equivalent: Tools > Options > Display > Typesetting level

Here's one way to obtain that collection of files, redirecting plot output from screen to files:

currentdir(cat(kernelopts(homedir),"/Documents")); # note that this RETURNS the previous setting

for i from 1 to 5 do 
   filename := cat("Fig",i,".jpg");
   plotsetup(jpeg, plotoutput = filename);
   fig := plot(x*i,x=0..10):
end do;

 

The x11 plotdevice needs an old GUI library called Motif (libXm.so.4, as you can see when running "ldd mplotx11"). So you will need to install a package named libXm or libmotif or similar - details will depend on your Linux distribution.

The kernelopts command will let you set this limit. Note that it returns the previous setting.

The dsolve call returns a sequence of three solution sets. If you wrap that into list brackets, simplify will work as expected (mapping properly onto that list):

simplify([dsolve(DE, explicit)]);

 

The short answer is no - the file formats are incompatible.

You can copy&paste Maple commands between both applications, and most of them will work seamlessly in Maple Flow. The code editor should make this step a bit easier.

I'm not an expert on Lie groups, but this might get you started:

with(PDEtools);
sys := [pde1, pde2];
depvars := [U, V, B];
infi := Infinitesimals(sys, depvars);

There are lots of options and related commands (such as InvariantSolutions), so check the ?Infinitesimals help page, please.

The alpha=1/2 case can be handled using Laplace transform:

ieq := g(x) =  Int(f(y)/sqrt(x-y),y=0..x);
sol := intsolve(ieq, f(x), method=Laplace);

Is that the result you expected?

This can be achieved programmatically by inserting

interface(displayprecision=2):

or interactively via "Tools > Options > Precision > Round screen display to ... decimal places".

H := CopyGraph(G);

The GraphTheory package implements CopyGraph which is appropriate here.

You can try e.g.

kernelopts(numcpus=2):

but I doubt that it will help avoiding a BSOD - which I have never seen due to Maple usage...

Good luck however!

That seems to be a glitch in old versions. At least since Maple 2017, I'm consistently getting

cg0 = x[0] * x[0];

which is the expected output here.

1 2 3 4 5 6 7 Last Page 1 of 37