MaplePrimes Questions

It's Alan's birthday and he's having a

party. Seven other people will attend.

Everyone will sit around the dining table.

The seating arrangement must meet the

following conditions:

* Amy and Alan sit together. Brad and

Beth sit together.

* Charles sits next to either Debbie or

Emily.

* Frances sits next to Debbie.

* Amy and Alan do not sit next to either

Brad or Beth.

* Brad does not sit next to Charles or

Frances.

* Debbie and Emily do not sit next to

each other.

* Alan does not sit next to either Debbie

or Emily.

* Amy does not sit next to Charles.

Who should sit where?

Dear all;

nice to speak with you.

complete a table randomly by positive three-digit numbers and display only the symmetrical numbers.

 

Thanks

Hi,

im trying to calculate the divergence of a 3x3 tensor. The tensor is created by the following code:

with(VectorCalculus);
with(LinearAlgebra);
SetCoordinates(cartesian[x, y, z]);
alias(u = u(t, x, y, z), v = v(t, x, y, z), w = w(t, x, y, z)); alias(eta = eta(t, x, y, z));
U := VectorField(`<,>`(u, v, w));
M := OuterProductMatrix(U, U);

The last command gives a 3x3 tensor:

Now I want to calculate the divergence of this tensor. But the function "Divergence" (VectorCalculus-package) is only able to handle vectors. A workaround would be the extract the data row by row -> convert it to a vector -> calculate the divergence.

Is there a more elegant possibility to do this?

 

Thanks in advance.

Hi,

for my simulation I have to calculate several gradients and jacobian matrices. The equations are quite complex and with my current setup hard to read.

 

Here is some exampel code:

restart;
with(VectorCalculus);
SetCoordinates(cartesian[x, y, z]);
alias(u = u(t, x, y, z), v = v(t, x, y, z), w = w(t, x, y, z)); alias(eta = eta(t, x, y, z));
U := VectorField(`<,>`(u, v, w));
Divergence(U);
Jacobian(U);
Diff(U, t);

The Divergence operator gives me a very compact result:

But Jaobian and Diff look like:

 

To achive a better readability I want to do two things (if possible):

1) hide the independet variables (t,x,y,z) in the result of Jacobian, Diff

2) display the result of Diff in a row vector (3x1) instead

 

Is this possible?

Thanks in advance for your help

 

 

I am looking to return all the substrings of a string that match a particular pattern (regexp). This is a very common text processing operation.

StringTools[RegMatch] returns boolean about whether the given pattern exists somewhere in the string. That's a start, but it is not efficient to hunt around for where the match is in order to extract the characters.

StringTools[Search] and [SearchAll] can return position information, but they work on exact matches of the pattern space, not on regular expressions. I could pre-generate all the possible matching sequences of up to some length and search for those exactly, but that is inconvenient at best and pretty much useless if there is a .* or .+ in the regular expression (as the space of potential matches grows exponentially.)

StringTools[RegSub] can be used to find one match by using something like ".*(REALPATTERN).*" = "\1" but since this does not extract any position information, one would at the very least then have to StringTools[Search] of the exact match to determine the position, then take a substring of the original string, and continue searching. And if you are going to do that, you might as well just use StringTools[RegMatch] with an optional third argument of a symbol to return the matched characters, instead of fooliing around with deleting everything else using RegSub.

Have I overlooked a possibility?

Example of use:

I would like to search "variable %1 needs to be of the form %3+2.9 in order to use routine %2 to find the fizturl", extracting the "%1", "%3", "%2". This would be regular expression "%[0-9]+". Notice that there might be other digits in the string that I do not want to extract, so I cannot just search for digits. I also cannot just remove all characters "[^0-9%]" as that would leave digits and would, for example, merge together the %3+2.9 into %329 leaving post-processing to extract the true pattern matches.

For what I am doing at the moment, I do not need to know the positions those occured at, just the matches.

Why is it that


dismantle(3*a);

returns a SUM entity?


SUM(3)
   NAME(4): a
   INTPOS(2): 3

dismantle(3+a);

also returns a SUM entry

SUM(5)
   NAME(4): a
   INTPOS(2): 1
   INTPOS(2): 3
   INTPOS(2): 1

ToInert() looks fine for both of these.

 

Tested on Maple 16, Maple 17, Maple 18

I want to solve a Laplace integral transform step-by-step its as follows:

 

f(t):=e^at

IntTutor(Int(e^-st f(t),t=0..infinity)

 

but it says that the expression can't be integrated, and secondly it does not work with 'infinity'. How I can solve this for step-by-step solution?

Thanxs

 

When I open My Maple 18 on my Macbook pro, with all updates on the operating system and on Java, my Maple starts up fine, but when I press 2+2 and the enter, nothing happens.

 

I have tried reinstalling Maple, without any change of the problem

 

Per Kirkegaard

hi

i want to use Direct Search Package for solve system of equation but i have an error:

Error, SolveEquations is not a command in the DirectSearch package.

please help me. code is attached.boltmohasebe.mw

Hi all.

I try to get the real part from the complex expression. But it turns out to not be the simplest result:

A:=I*sin(k*Pi*(x-h*cos(theta))/a)*sin(l*Pi*(y-h*sin(theta))/b)*exp(-I*k[0]*h)*sin(k*Pi*x/a)*sin(l*Pi*y/b)

convert(exp(-I*k[0]*h), sin);

simplify(Re(A));

Maple results in:

Re(sin(k*Pi*(-x+h*cos(theta))/a)*sin(l*Pi*(-y+h*sin(theta))/b)*exp(-I*k[0]*h)*sin(k*Pi*x/a)*sin(l*Pi*y/b))

while the simplified result should be:

sin(k*Pi*(x-h*cos(theta))/a)*sin(l*Pi*(y-h*sin(theta))/b)*sin(k*Pi*x/a)*sin(l*Pi*y/b)*sin(k[0]*h)

 

I wander how to get the simplifyed result in maple. Thanks

How can I breal kong code lines in "Code Edit Region" like "..." in Matlab?

How can one use maple to linearized nonlinear ODE of this type Linearize.mw

with maple.

Best regards.

 

Hi,

 

  Suppose I have the following code

 

***

f[1]:=x1^2+x2;
f[2]:=-x2^3+x1-2;

solve({f[1], f[2]}, {x1, x2}):
a,b:= eval([x1, x2], %[1])[]:
a, b;

***

 

It could work and give me "1 and -1". 

 

I would like to have a general subroutine, solving f[1]...f[n]. I cannot input  "solve({f[1], f[2],....,f[n]}, {x1, x2}):" just like that. Is ther any way to use "solve" or similar module to handle arbitary number of variables?

I am trying to use solve to determine 5 unknowns from 12 equations each with seperate data points); however, maple requires you to have equal number equations and variables. Is there any way around this?

There are two ways of expressing the solution to a cubic equation, one of them uses cos and arccos [1]. How do I / is there a way to ask Maple to get this form?

More generally, can Maple be instructucted to solve equations using trig identities?

[1] http://en.wikibooks.org/wiki/Trigonometry/The_solution_of_cubic_equations

First 1324 1325 1326 1327 1328 1329 1330 Last Page 1326 of 2429