## tool to convert .mw written in 2D to worksheet usi...

most people who post here seem to use .mw written in 2D, which I do not like to use.

Is there a tool to convert such a file to 1D worksheet that one can use from the command line before opening the document itself in Maple?

The reason I ask, sometimes opening the original file and trying to do this from inside Maple by selecting the code using the mouse, then  Format->ConvertTo->1D   does not work, and gives an error.

Also, sometimes, when I try to first create an empty worksheet document, and then try to copy/paste the code from the other document over, it also does not work. This happens when there are syntax errors in the original document. The error that comes up is

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

As an example, please see the attached file in the following question

https://www.mapleprimes.com/questions/227506--I-Need-Help-Trying-To-Write-A-Code

It will good to have a tool that converts such documents to 1D worksheet or even plain Maple code (.mpl) but I did not see such option under SAVE AS either. Also, when I tried to export it as .mpl file, I get the same error as above in the file. So I gave up.

## SOLVING PDE EQUATION...

Hello Anybody can help me to write codes for PDE to solve by Galerkin finite element method or any other methods can be able to gain results? parameter omega is unknown and should be determined.

I attached a pdf file for more .

Thanks so much

 >
 >
 (1)
 > #BCs can be from following
 (2)
 >
 (3)
 >

buchanan2005.pdf

 >
 >

## Central Moment of order 2 doesn't equal the Varian...

I found this strange result:
When the central moment of order 2 and the variance are assessed on a sample of a random variable, they don't return the same value.

Let S be the sample, N its size and M its empirical mean.  The difference comes from the fact that

• Variance(S)               = add( (S[n]-M)^2, n=1..N) / (N-1)
• CentralMoment(S, 2) = add( (S[n]-M)^2, n=1..N) / N

By definition the variance of a random variable X is its 2nd order central moment.
This definition should also apply when these statistics are calculated on a sample of X.

It seems to me this is a mistake.

 > restart:
 > with(Statistics):
 > N := 100:
 > # Example 1 U := RandomVariable(BetaDistribution(3, 2)): CentralMoment(U, 2, numeric); Variance(U, numeric); print(): S := Sample(U, N): CentralMoment(S, 2); Variance(S);
 (1)
 > # Example 2 V := RandomVariable(Normal(3, 2)): CentralMoment(V, 2, numeric); Variance(V, numeric); print(): S := Sample(V, N): CentralMoment(S, 2); Variance(S)
 (2)
 > # Examples revisited S := Sample(U, N): CentralMoment(S, 2); Variance(S)*(N-1)/N; print(): S := Sample(V, N): CentralMoment(S, 2); Variance(S)*(N-1)/N
 (3)
 >

## Sets, nested sets...

Hello. Let's say I have a set A1 in which there are nested sets {5,6},{8,9}. How can I get A2 from A1? Expand nested sets so that all elements are in the same set

## Can't remember the name of the command...

The eval command doesn't work on random variables.

For instance:

with(Statistics):
X := RandomVariable(Normal(mu, sigma)):
Y := eval(X, mu=1);
Mean(Y); # returns mu

I once found a Maple command whose syntax is the same as eval's and acts as eval
Y := COMMAND(X, mu=1)
Mean(Y); # returns 1

Could someone remind me of its name?

## how do i plot a probabilitry function in 3 variabl...

How can i plot a probability function such as cos(x-y)*cos(y-z)*cos^3(x-2z)=0.6 where

x=0..5, y=0..x, z=0..y.

## How to recover the definition of a random variable...

Hi,

When you declare a random variable X  by writting X := Statistics:-RandomVariable(...) Maple associates to the name X an "object" dubbed _R.
My question is very simple: is it possible to recover the definition of X from the "object" _R?

To illustrate, suppose I've written
> X := Statistics:-RandomVariable(Normal(0, 1)) ;
_R
I would like to extract the information "_R represents a random variable Normal(0, 1)" from _R

## How do I values to constants when using Invariants...

Dear Maple users,

I am progressing, but one last hitch, see below. A want the invariants of the PDE below. However, the final expression is too general to be useful. I would like to insert specific values for F1(R), F2(R), F3(R), and F4(R):

F3=F4=0; and F2=1, and F3(R)=aR, where a is a constant. R is one of my independent variables (the Reynolds number).

I would like to do this at the step where the Infinitiesimals are generated by

For example, the first entry would then be, infinies:=[ _xi[y](y, R, l, u) = y, ... ]. Then Invariants should give me much simplified expressions which I need.  How can i do this?

Thanks

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

## Custom-Coloring a pointplot...

In short, I want to create a density plot but with points. So I do a pointplot and I want to color it according to the value of a third function.

So let's say I do:

>x1:=[seq(x,x=1..2,0.02)];

>y1:=[seq(y^3,y=1..2,0.02)];

>z1:=[seq(x1[i]/y1[i],i=1..51)];

And I want a plot like:

>pointplot([x1,y1])

but with a color corresponding to the gradient of z1.

What I can do is something like:

>pointplot([x1,y1], colorscheme=["valuesplit", z1, [0..0.5="Black",0.5..1="RoyalBlue"]])

but that's not as pretty as it could be. So is there a way to do something like colorscheme=["zgradient", z1]? This doesn't work because zgradient expects its first argument to be colors and then you can add markers, but they apply to the function you plot, not to a third function.

Any ideas?

## Visualising solutions to sums of polynomials...

I'm working towards creating a way to visualise real polynomial ideals! (or at least the solutions of the polynomials in the ideals) this code creates a plot showing the solutions to all the polynomials in the ideal generated by P1 and P2 (these are specified in the code)

with(plots);
P1 := x^2+2*y^2-3;
solve(P1, y);
Plot1 := plot([%], x = -2 .. 2);

P2 := -2*x^2+2*x*y+3*y^2+x-4;
solve(%, y);
Plot2 := plot([%], x = -4 .. 2);

P2*a+P1;
solve(%, y);
seq(plot([%], x = -4 .. 2), a = 0 .. 10, .1);
display(%, Plot1, Plot2)

This is because when you multiply two polynomials their set of solution curves is just the union of the sets of curves associated with the previous polynomials.

For the next step I'd like to create a graph of the solutions associated with an ideal with three generators. To stop this from being excessively messy I'd like to do it with the RGB value of the colour of a curve is determined by  a and b where the formula for a generic polynomial that we are solving and graphing is given by:

P1+a*P2+b*P3;

where P3 is given by

P3 := x*y-3

I've tried various ways to use cury to make this work (my intuition is cury is the right function to use here)  but got no where. Any ideas how to procede?

## removing entries from list...

I wanted to remove entry from a list that contain y=y or x=x in it. Here is an example

f:= (x-1)*y^4/(x^2*(2*y^2-1));
S:=[singular(f)]


Where I wanted to remove those entries highlighted above to obtain

This is below how I ended up doing it. I'd like to ask if there is a better or more elegent way. I had to use map, since could not get remove() to work on the original list in one shot.

foo:= z->remove(has,z,{y = y,x = x});
map(foo,[singular(f)])


Which gives the output above.

Is there a better way to do this? I always learn when I find how to do something better.

Maple 2019.1

## How to explain this output from iscont( )?...

Why does the iscont( ) function declare that the square root function is continous over Riscont_error.mw

 (1)

## Define a block matrix...

Dear Users!

Hoped you will be fine. I want to define a block matrix A for any value of M like this way

A = [A[0], A[1], A[2], ..., A[M]]

A[i] = [A[i,0], A[i,1], A[i,2], ..., A[i,M]]

and

A[i,j] = Transpose([a[i,j,0], a[i,j,1], a[i,j,2], ..., a[i,j,M]]);

Kindly help me in this matter. Thanks in advance.