mmcdara

6009 Reputation

17 Badges

7 years, 269 days

MaplePrimes Activity


These are replies submitted by mmcdara

@Preben Alsholm 

Thank you Preben

PS; I like your "You don't need the assumption at the end, but it doesn't hurt."

@NIMA112I have corrected you document (Maple 2015 worksheet).
Please check it out and get back to me:

restart

U := proc (x, t) options operator, arrow; U0*exp(I*omega*t)*cos(m*Pi*x/L) end proc; -1; W := proc (x, t) options operator, arrow; W0*exp(I*omega*t)*sin(m*Pi*x/L) end proc; -1; Upsilon := proc (x, t) options operator, arrow; Upsilon0*exp(I*omega*t)*cos(m*Pi*x/L) end proc

proc (x, t) options operator, arrow; Upsilon0*exp(I*omega*t)*cos(m*Pi*x/L) end proc

(1)

m := 1; -1; nu := .38; -1; h := 10*l; -1; l := 17.6*10^(-6); -1; mu := E/(2*(1+nu)); -1; E := 1.44*10^9; -1; rho := 1220; -1; L := 10*h; -1; R := 10^10

10000000000

(2)

``

Phi := proc (z) options operator, arrow; z*(1-(4/3)*z^2/h^2) end proc

proc (z) options operator, arrow; z*(1-(4/3)*z^2/h^2) end proc

(3)

G := E/(2*(1+nu));

521739130.4

(4)

Q[11] := E/(-nu^2+1);
Q[55] := G:


([Q[110], Q[111], Q[112]] =~ Q[11] *~ int~([1, z, z^2], z=-h/2..h/2))[];
assign(%);

1683029453.

 

Q[110] = 296213.1837, Q[111] = 0., Q[112] = 0.7646249650e-3

(5)

([Q[113], Q[114], Q[115]] =~ Q[11] *~ int~([Phi(z), Phi(z)^2, z*Phi(z)], z=-h/2..h/2))[];
assign(%);

Q[113] = 0., Q[114] = 0.4951856917e-3, Q[115] = 0.6116999719e-3

(6)

([Q[550], Q[551], Q[552]] =~ (Q[55]/Q[11]) *~ [Q[110], Q[111], Q[112]])[];
assign(%);

Q[550] = 91826.08695, Q[551] = 0., Q[552] = 0.2370337392e-3

(7)

([Q[553], Q[554], Q[555]] =~ (Q[55]/Q[11]) *~ [Q[113], Q[114], Q[115]])[];
assign(%);

Q[553] = 0., Q[554] = 0.1535075644e-3, Q[555] = 0.1896269913e-3

(8)

([Q[556], Q[557], Q[558], Q[559]] =~ Q[55] *~ int~([diff(Phi(z), z), z*diff(Phi(z), z), Phi(z)*diff(Phi(z), z), diff(Phi(z), z)^2], z=-h/2..h/2))[];
assign(%);

Q[556] = 61217.39128, Q[557] = 0., Q[558] = 0., Q[559] = 48973.91304

(9)

# check
eval(Q)

table( [( 11 ) = 1683029453., ( 55 ) = 521739130.4, ( 111 ) = 0., ( 550 ) = 91826.08695, ( 110 ) = 296213.1837, ( 551 ) = 0., ( 557 ) = 0., ( 556 ) = 61217.39128, ( 559 ) = 48973.91304, ( 558 ) = 0., ( 553 ) = 0., ( 552 ) = 0.2370337392e-3, ( 555 ) = 0.1896269913e-3, ( 554 ) = 0.1535075644e-3, ( 114 ) = 0.4951856917e-3, ( 115 ) = 0.6116999719e-3, ( 112 ) = 0.7646249650e-3, ( 113 ) = 0. ] )

(10)

terms := [1, z, z^2, Phi(z), Phi(z)^2, z*Phi(z), diff(Phi(z), z), z*diff(Phi(z), z), Phi(z)*diff(Phi(z), z), diff(Phi(z), z)^2, diff(Phi(z), z$2), diff(Phi(z), z$2)*diff(Phi(z), z), diff(Phi(z), z$2)^2]:

seq(beta[k] = mu*int(terms[k], z=-h/2..h/2), k=1..nops(terms));
assign(%);

beta[1] = 91826.08697, beta[2] = 0., beta[3] = 0.2370337392e-3, beta[4] = 0., beta[5] = 0.1535075644e-3, beta[6] = 0.1896269913e-3, beta[7] = 61217.39129, beta[8] = 0., beta[9] = 0., beta[10] = 48973.91305, beta[11] = 0., beta[12] = 0., beta[13] = 0.1581027668e14

(11)

# check
eval(beta)

table( [( 1 ) = 91826.08697, ( 2 ) = 0., ( 3 ) = 0.2370337392e-3, ( 4 ) = 0., ( 5 ) = 0.1535075644e-3, ( 6 ) = 0.1896269913e-3, ( 7 ) = 61217.39129, ( 9 ) = 0., ( 8 ) = 0., ( 11 ) = 0., ( 10 ) = 48973.91305, ( 13 ) = 0.1581027668e14, ( 12 ) = 0. ] )

(12)

N__T := 0; H__x := 0; N__0 := 0; K__2 := 0; K__1 := 0; DD := 0

0

 

0

 

0

 

0

 

0

 

0

(13)

local I:

seq(I[k-1] = rho*int(terms[k], z=-h/2..h/2), k=1..6);
assign(%);

I

 

Warning, The imaginary unit, I, has been renamed _I

 

I[0] = .2147200000, I[1] = 0., I[2] = 0.5542638934e-9, I[3] = 0., I[4] = 0.3589518548e-9, I[5] = 0.4434111146e-9

(14)

eq1 := - Q[110] * diff(U(x, t), x, x)
       + Q[111] * diff(W(x, t), x, x, x)
       - Q[113] * diff(Upsilon(x, t), x, x)
       - Q[110] * diff(W(x, t), x)/R
       - Q[556] * Upsilon(x, t)/R
       + Q[550] * U(x, t)/R^2
       - Q[551] * diff(W(x, t), x)/R^2
       + Q[553] * Upsilon(x,t)/(R^2)

       + (beta[1]*l^2)/(4*R)  * diff(W(x,t), x, x, x)
       - (beta[7]*l^2)/(8*R)  * diff(Upsilon(x,t), x, x)
       - (beta[1]*l^2)/(8*R^2)* diff(U(x,t), x, x)
       + (beta[2]*l^2)/(8*R^2)* diff(W(x,t), x, x, x)
       - (beta[4]*l^2)/(8*R^2)* diff(Upsilon(x,t), x, x)

       + I[0] * diff(U(x,t), t, t)
       - I[1] * diff(W(x,t), t, t, x)
       + I[3] * diff(Upsilon(x,t), t, t)

0.9437974374e12*U0*exp(I*omega*t)*cos(1784.995826*x)-0.5287797395e-1*W0*exp(I*omega*t)*cos(1784.995826*x)-0.6120983889e-5*Upsilon0*exp(I*omega*t)*cos(1784.995826*x)-.2147200000*U0*omega^2*exp(I*omega*t)*cos(1784.995826*x)

(15)

 

Download CHECK_THIS_mmcdara.mw

@MaPal93 

What I've done is tailored to your initial problem and I've never claimed that it's a generic method for dealing with other problems.
It is quite easy to ask for the solution of some problem and say this solution doen't work for another problem.
I suggest you think carefully about the problem, or category of problems, you want to solve and Reply here with more precise specifications.

@MaPal93 

Screen capture + conversion to png to be uploaded:

Direct export to png from the interactive graphic menu 

There is no blurring here.

I use Maple 2015.2 but I don't think it is a version issue. If you cannot solve this problem by your own I suggest you to open a new thread and join my code, yours, and the images above: someone would likely have an idea of what happens on your side.

@MaPal93 

For your functions f__1 and f__2, a simple solve is enough to find the locus o couples (sigma_-d, sigma__v) which verify f__1=f__2.

"For a more complex case ..." means essentially "whan solve is not enough". 
Then implicitplot(....) or contourplot(..., contours=[0]) may be good alternatives.

"A minor follow-up: why is the plot significantly blurred ..." there is no such thing in the worksheet.
As a rule the quality of the plots is significantly altered when displayed on Mapleprimes

@Carl Love 

Thanks Carl for this extremely detailed answer which seems to cover all my questions.
I'm not going to pretend I understood it in its entirety on the first sight, and I think a second (third?) reading will be necessary for me to get the right idea.

@Axel Vogt 

Thnk you Axel, this really helps.

@jalal 

Let's say we have some sample S, for instance S := Statistics:-Sample(Normal(0, 1), 10^3).
What is it that does not suit you in the command Statistics:-Histogram(S, opts), where opts is any sequence of options described in the help page?

Here are a few examples of histograms of samples drawn from a continuous or discrete random variable.
The last example is the histogram of the table you provided in your original question.

restart:

with(Statistics):


Histogram of a sample from a continuous random variable.

S := Sample(Uniform(-5, 5), 10^3):

h0 := Histogram(S):
h1 := Histogram(S, style=polygon):
h2 := Histogram(S, maxbins=10):
h3 := Histogram(S, frequencyscale=absolute):
h4 := Histogram(S, binbounds=[seq(-5+k, k=0..10)]):
h5 := Histogram(S, frequencyscale=absolute, transparency=0.8, color=red):

plots:-display(Matrix(2, 3, [seq(h||k, k=0..5)])):


Histogram of a sample from a discrete random variable.

S := Sample(DiscreteUniform(-5, 5), 10^3):


h0 := Histogram(S):
h1 := Histogram(S, discrete=true):
h2 := Histogram(
        S
        , discrete=true
        , axis[1]=[tickmarks=[$(-5..5)]]
        , thickness=20
        , style=polygon
        , view=[-5.5..5.5, default]
      ):

plots:-display(Matrix(1, 3, [h0, h1, h2])):


Histogram of  your sample.

data :=[ [[50, 60], 20], [[60, 70], 25], [[70, 80], 15], [[80, 90], 30], [[90, 100], 10] ]

[[[50, 60], 20], [[60, 70], 25], [[70, 80], 15], [[80, 90], 30], [[90, 100], 10]]

(1)

S := [seq((add(data[k][1])/2)$data[k][2], k=1..numelems(data))]:

Histogram(
  S
  , frequencyscale=absolute
  , discrete=true
  , axis[1]=[tickmarks=[seq(k=cat("[", k-5, ", ", k+5, "["), k in [seq(55..95, 10)])]]
  , thickness=40
  , style=polygon
  , view=[50..100, default]
);

 

 

Download histograms.mw

Please let me/us know if you have a particular need. For instance provide data (or the way they are constructed) and an image of the histogram you would obtain.

First thing: what you represent IS NOT an Histogram (look the corresponding help pages).

Second point "[You are] looking to construct a histogram in an aesthetic manner with bins. The Histogram command does not provide an optimal output. Any suggestions?".... what does aesthetic  mean to you? Are you aware the what is aesthetic for you is a subjective judgement and may seem awfullto someone else?

So, begin to provide an example of what you feel is an aesthetic histogram for you and we will be capable to give you a solif answer.

Nevertheless the attached file contains a few examples of customized "Classes-Effectifs" tables.
Note that as I use Maple 2015 I don't know what your own version proposes to display a table like th one in your mw file.
So here hre a few examples of what can be done TallyInto.mw.

Last remark: If I'm not mistaken the lines

InsertContent(Worksheet(Group(Input( TAB )))):

must be written

InsertContent(Worksheet( TAB )):

since Maple 2018 (read help page DocumentTools:-Layout:-Cell)

Other usefil info can be found here Statistics:-TallyInto and Statistics:-FrequencyTable

@Axel Vogt 

Your two suggestions 

M := convert(Int(Dirac(u-v), [u, v]), piecewise, u);
W := convert(Int(Dirac(u+v-1), [u, v]), piecewise, u);

are very good.

The two following steps 

M-piecewise(min(u, v), u) ;
W-piecewise(max(u+v-1, 0), u) ;

leave me a little frustrated for they mean that we suspect that M could be equal to min(u,v) and that we verify this hypothesis.
I would have prefer to apply successive transformations to finaly get (Oh miracle!) the expression min(u, v).

I nevertheless vote up for the the frst idea.

Remove the characters "&", "(", ")" in the name of your file: it can be loaded (page not found)

@fabs 

Here is the edited file which includes the case X=x1*tauderivatives.mw
In fact the trick works whatever the function of x1 and tau.

@Carl Love 

Thanks Carl, I understand better now.

@Carl Love 

Than you Carl.
This is almost what I did just after havng read @vv's answer.

restart
phi := x -> (x^(-theta)-1)/theta:
ihp := u -> solve(phi(x)=u, x):
invfunc[phi] := ihp:

C := (u, v) -> (phi@@(-1))(phi(u)+phi(v)):
simplify(C(u, v)) assuming theta >= -1, theta <> 0;
                                         /    1  \
                                         |- -----|
                                         \  theta/
             /      (-theta)    (-theta)\         
             \-1 + u         + v        /         

The only slight difference (but maybe of great importance???) is that I did not use unprotect(invfunc).
I only checked out that this table indeed contained phi=ihp.

 

@vv 

Thank you vv.
I'm feeling sorry for being so stupid because I had looked at the invfunc help page but obviously not carefully enough.

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