tomleslie

13876 Reputation

20 Badges

15 years, 174 days

MaplePrimes Activity


These are replies submitted by tomleslie

@Markiyan Hirnyk 

The following is the worksheet I had produced to justify my earlier comment. I didn't bother posting it earlier, because the problem seemed to have been solved - so I just made the observation that the integral *seemed* to be (Pi^2)/8.

I have just given the attached worksheet a quick check, and can find nothing which contradicts - my earlier answer. In other words, the answer is (Pi^2)/8

IntOverReg.mw

 

@Markiyan Hirnyk 

a quick use of identify() on the numerical output indicates that the answer is

Pi^2/8

the the 'method' option under the help page at ?pdsolve/numeric

And here is the code posted earlier. This time  as a worksheet: -uploader *seems* to be working now!?

odeSOL.mw

In the attached, I

  1. commented out most of the useless c**p
  2. fixed a few syntax errors

and it now actually runs, and produces a solution. However the solution hits a singularity at t=~0.4097, and so cannot be computed for values of the independent variable greater than this.

The attached produce a plot of the solution up to this singularity point (more or less)

I wrote the above before I realised that someone has "improved" MaplePrimes so that I can no longer upload any files. Tried both Chrome and Firefox - no luck.

It's past my bedtime: I may try again tomorrow :-(

 

A quick check with

pdsolve([PDE1,PDE2]);

finds no solution. A numeric solution *might* be possible, (since the system is third order in one variable, but first order in the other) but this is going to require five boundary/initial conditions

Use the big green up-arrow in the MaplePrimes editor toolbar to upload the worksheet which illustrates your problem

@Carl Love 

If you enter "Calc 2 Goblet Maple Project" into your preferred search engine, you will quickly discover the objective

Clearest(?) description is possibly at the link below (which also has an *interesting* lead author)

http://www.math.tamu.edu/~yasskin/prevclas/152H.14a/goblet/Goblet.pdf

You should however be aware that the precise criteria for the "goblet", volume, stem thickness, etc vary a bit across the hits returned.

@Carl Love 

Oddly enough I know that - and btw, how often is an array "recreated" - so given a choice, whihc is better practice?

@AndrewG 

I'm pretty sure that maple has no specific command for generating a multivariate distribution (normal or otherwise)

I have run the attached in Maple18.02, 2015.2, and 2016, and in all cases get the results shown in the attached.

This result does not correspond with the results which you have posted: only two possibilities

  1. Maple version issue: - which version are you running?
  2. Something seriously weird happening in the code "some_long_script.mpl" which you do not provide - which obviously I cannot debug

try.mw

Two inconsistencies

  1. The numerical terms in the first matrix which you generate are not given by the general formulae which you quote. For example the [2,2] term is given as 12, but from the general equation you give, it ought to be 2
  2. The last row in the matrix of formulae which you supply is inconsistent with the previous rows (and with itself!). Check the denominator, and explain the sequence (n-1)!, (n-2)!...ending up at (2n)!

I have taken a guess at what you are trying to achieve, but because of the above inconsistencies, I am probably wrong! But at least you ought to ba able to adapt the general method shown below

n:=5;
M:=Matrix( n, n, (i,j)->`if`( j<=i,
                                         `if`( j=1,
                                                (-1)^(i+j-2),
                                                (-1)^(i+j-2)*(i+j-2)!/(j-1)!
                                              ),
                                        0
                                     )
              );

 

 

@AndrewG 

I don't actually see anything wrong with the way you have solved your own problem. So go with it!

If I was starting from scratch, I might have done it slightly differently: not a criticism - just a different thought process, which is

  1. Skip the offset to [3,15] for now: this is real easy to add later.
  2. Work in polar coordinates. NB this will be wrong if you want x,y variables with different standard deviations. I am deliberately emphasizing the circular symmetry of your question
  3. In polars, I think you want the radial coordinate to follow a zero-mean normal distribution, and the angular coordinate to follow a uniform distribution with the range 0..2*Pi
  4. One can easily construct these two distributions, then generate [x,y] coordinates, using x=r*cos(theta), y=r*sin(theta)
  5. One can then "add in" the offset in (1) above using x=OS_x+r*cos(theta), y=OS_y+r*sin(theta)

With this thought process, I end up with the code

restart;
with(plots):
getSamps:= proc( stdR::posint, os::list, nSamps::posint)
                         #
                         # stdR is the standard deviation in the radial coordinate
                         # os represents the "centre" of the distribution
                         # nSamps determines how mnay sample you want to be returned
                         #
                            uses Statistics:
                            zip( (r, theta) -> [ os[1]+r*cos(theta),
                                                        os[2]+r*sin(theta)
                                                     ],
                                                     Sample( Normal(0, stdR), nSamps),
                                                     Sample( Uniform(0, 2*Pi), nSamps)
                                );
                   end proc:
 pointplot(getSamps(1, [3,15], 1000));

But (as far as I can tell) the above produces pretty much what you original code does - so not better, just different

on the form in which you need your "input parameter" for example if you are happy with a vector of samples which follow a logNormal distribution, then

with(Statistics):
mu:=1: sigma:=2; nsamps:=100;
Sample( RandomVariable(LogNormalDistribution(mu, sigma)),nsamps);

will work.

In future, post code using the big green up arrow in the Mapleprimes editor toolbar. No-one here is going to retype code from a picture

Now in the picture you post

  1. 'f'' is defined but never used: if you aren't going to use it, why define it? Completely pointless.
  2. 'Z' is defined, but only used in 'f' (which is never used) - so why bother? Completely pointless
  3. the matrix 'bp' is defined but never used: if you aren't going to use it, why define it? Completely pointless. It also defined using the matrix() command which has been deprecated for a long time: either use Matrix(), or specify Maple version you are using
  4. 'B' is also defined using matrix() rather than Matrix() - do you really mean to do this?
  5. be:=evalm(A&.B) - what is this supposed to mean?. The 'evalm' command has been deprecated for years (if you really really need it, then please specify Maple version). Wnat is meant by the '&.' operator? Luckily, 'A' is never defined, and the output of this command ie 'be' is never used by anything, anywhere, so this command is completely pointless
  6. I.m bored now -so I'm going to stop - but you have a lot to fix before anyone is going to get interested.
First 151 152 153 154 155 156 157 Last Page 153 of 207