## 18909 Reputation

14 years, 34 days

## MaplePrimes Activity

### These are replies submitted by Kitonum

2. Many problems can be solved in Maple different ways. Write more in what your problem is. Perhaps it can be solved in a different way without  PolyhedralSets  package.

## Plotting stream tubes...

@Jawadqau What are stream tubes?  Curves in the space? In this case, the last line of code should be:

plots:-odeplot(sol, [-1/2*diff(h(eta),eta), h(eta), g(eta)], 0..N, color=red, thickness=3, scaling=constrained, labels=[f,h,g]);

plots:-tubeplot([s->eval(-1/2*diff(h(eta),eta),sol(s)),s->eval( h(eta),sol(s)),s->eval(g(eta),sol(s))], 0..N, radius=0.05, color=red, scaling=constrained, lightmodel=light4);  # Or a tubeplot

## Inconsistent system...

From the first equation we obtain

f(eta) = -2*diff(h(eta),eta)

that is for  eta=0  we have  f(0) = -2*D(h)(0)  but it contradicts your  bc

## Not a bug...

@minhhieuh2003  It's not an error. By default, Maple works with an extended numeric line when solving inequalities;  infinity  and  -infinity  can participate in arithmetic operations and in comparisons with ordinary numbers. See

infinity+2;
-infinity+2;
infinity*(-infinity);
is(eval(x*(x-3)+2, x=infinity)>0);

## Different codes...

@ssara  In your code, instead  _local(cos);  should be  local cos;  and instead  B := op([1, 2], A)*(-cos(theta)+1)+op(2, A);  should be  B:=op([1,2], A)*(1-cos(theta))+op(2, A):  . Just copy the whole code from my answer into your worksheet and check that the codes exactly match.
Tell me what version of Maple you use and upload here a link to your worksheet using the bold green arrow (the worksheet should be saved before that) if my code does not work again.

## Maple ignores this...

@Markiyan Hirnyk  In fact, Maple simply ignores  assuming real . But the solution itself is correct. In terms of  V2  and  V3  we have  V2=0  and  V3=0

## Digits...

Use  Digits  command to get the required number of significant digits:

Example:

Digits:=3:
a:=1.23402*10^(-5);
a*10^6;

a := 0.0000123
12.3

## My preferences...

@tomleslie  And I prefer that it's shorter (and/or faster). I do not see any reason to use for sets or lists   numelems  instead of  nops. You allude to a wider field of application of  numelems  in comparison with nops . But if we follow this logic, for example it's better to use  `**`  to raise to an exponent than `^` (because a single symbol  `*` can be used for multiplication and exponentiation). Or the area of any plane figure should be calculated by integration (for example, the area of a rectangle than just multiplying its sides).

Even when working with matrices, I prefer other commands than numelems, because it is usually required to know not only the total number of entries in the matrix, but the number of rows and the number of columns. Here is an example:

A:=<1,2,3; 4,5,6>;
m, n:=op(1, A);
`*`(%);
m*n;
numelems(A);

## numpoints...

@tomleslie The actual number of points may not coincide with numpoints. See help for numpoints and the example. Note that near the origin the points are more often:

plot(abs(x), x=-2..2, style=point, symbol=solidcircle, numpoints=40);

## Just open...

@ssara  Nothing needs to be converted. Just open this file in your Maple.

@ssara  You do not need any for loops. The substitution and collection must be done immediately in the entire matrix. See the corrected file ss_new.mw

## A way...

@shimaa sadk  You can easily write these results into a list, and then assign names to them.

Example:

{x=1, y=2, z=3};
L:=eval([x,y,z], %);
a, b, c := op(L);
# The new names (a multiple assignment)

## Option for Maple 7...

@das1404  I offered you a possible option for Maple 7 here, but it seems you did not read it.