mmcdara

6149 Reputation

17 Badges

9 years, 62 days

MaplePrimes Activity


These are replies submitted by mmcdara

Several points

  1. I understand that k1, omega11, omega12, omega21 and omega22 are the five "primary" parameters.

    But your expression doesn't contain any of these omegas parameters.

  2. all other coefficients would be calculated based on k values and corresponding omegas: what are these "other coefficients" (k2, q12, h, mu[s], ... ? What are their expresions wrt the five "primary" parameters.
    If you do not tell us all the relations, or provide us a cristal ball, I sincerely doubt that someone can provide you an answer.

  3. At last you want to plot something for different  5-tuples of values of k1, omega11, omega12, omega21 and omega22  (see point (1) above.
    Did you realized that this represe, 5^5 = 3125 plots?
    Are you sure uou want them all on the same figure?
    Maybe you want to do an "Explore type plot" (look to explore in the help page) ? Please be more pecise.

  4. Last point: do you thing people here are going to spent time to code in Maple the LaTeX expression you present?
    Can't you code yourself this expression (and all the auxiliary expressions, see point (2) above) and download this code in your question?

@acer 

but I perfered not to use it.

Same for me.
After the first warning message, I dug around and got this (in french, sorry)  

@acer 

You shot faster than me :-)

@C_R  @yangtheary

Let's be honest: @C_R gave the answer, albeit incomplete. 
I'm only correcting @C_R here, so please do not convert this reply into an answer.

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

with(geometry):
_EnvHorizontalName := 'x':
_EnvVerticalName := 'y':

point(F1, [-1, -1]):
point(F2, [1, 1]):

ellipse(p, ['foci' = [F1, F2], 'MinorAxis' = 2*sqrt(14)]);

Equation(p);

p

 

240*x^2-32*x*y+240*y^2-3584 = 0

(2)

 

Download ellipse_geometry.mw

@acer  
(with copy to @Carl Love)

You're absolutely right.
It was just after reading Carl's reply that I reread yours more carefully and noticed the last sentence.
I don't understand why I missed it on the first reading.
My apologies.

It's likely that I went to the special evaluation rules  help page and, having seen no mention of piecewise, inferred that the problem I observed using piecewise was of a completely different order... and skipped the end of your answer.

Thank you both for your clarifications.

@Carl Love @sursumCorda @acer 

Thank you all for your contributions.
First of all, I voted up for all of you.
Next comes the dubious matter of selecting the best answer, if any.  Please don't blame me if none of you have been my chosen one, even if @acer has lifted the corner of the curtain in front of `if`.

Thanks again.

By the way, does any of you have an explanation about the a priori strange behaviour of piecewise that I mentioned at the end of my attached file?

@acer 

Thank you acer for your analysis... and for the workaroung (of course).

@acer 

Good to know the issue has been fixed, bad to know I have to use plots:-display.

By the way: you're right about the syntax ( InsertContent(Worksheet(Group(Input(TT)))) ) which has been significantly simplified since Maple 2015)

@dharr 

Thanks for having clarified this discussion and for perfectly described the differences in perception of the term "non-dimensionalization".

@ijuptilk 

Thanks.
What about functions f[1](theta) and f[2](theta) whose dimensions should be homogeneous to a surface?

@dharr @ijuptilk

I started from @dharr code but did slightly different operations on the equations.
My point is to finder under chich conditions each term in the final dimensionless equation are indeed dimensionless, and check that these conditions ar mutually compatible.

Doing this I find that f, for instance, x is a length, so is z, and if t is a time, then u and v are velocities
More of this gamma[1] and gamma[2] are frequencies and kappa is surfave (look inside the attached code to see what kappa is).
But there is a problem, already underlined by @dharr, concerning f[1] and f[2].

Ultimately a true dimensionless equation should contain "Dimensionless Numbers" (such as Reynolds, Mach, ...) build from some combinations of the elementary dimensions present in the initial equation (2 in the present case).

I believe this require some clarifications.
For_discussion.mw

@jalal 

for you have no guarantee that your program will stop, even if the "target determinant" is in the range of reachable determinants. 

Look at this simple example:

restart:
dim := 2:
s := convert({$-2..3} minus {0}, list);
                       [-2, -1, 1, 2, 3]
numelems(s)^(dim^2)
                              625
d := Vector(numelems(s)^(dim^2)): k := 0: for i11 in s do   for i12 in s do
    for i21 in s do
      for i22 in s do         k := k+1:
        d[k] := i11*i22-i12*i21       end do:
    end do:
  end do:
end do:

        
{entries(d, nolist)}
{-15, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 

  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15}


There exis no matrices among the 625 possibles matrices whose determinant is -14 or +14.
In this case your program won't stop if your target determinant is one of these numbers.

With the same set s of values but dim=3, there exist 1 953 125 different matrices.
The extreme values of the determinants are -100 and +100.
But no matrices can have one of those determinants:

{-99, -98, -97, -96, -94, -93, -92, -91, -90, -89, -87, -86, -84, -82, -81, -78, 78, 81, 82, 84, 86, 87, 89, 90, 91, 92, 93, 94, 96, 97, 98, 99}

Raw code here

restart:
dim := 3:
s := convert({$-2..3} minus {0}, list);
                       [-2, -1, 1, 2, 3]
d := {}:
k := 0:
for i11 in s do
for i12 in s do
for i13 in s do
for i21 in s do
for i22 in s do
for i23 in s do
for i31 in s do
for i32 in s do
for i33 in s do
  k := k+1:
  d := d union {LinearAlgebra:-Determinant(Matrix(dim$2, [i11, i12, i13, i21, i22, i23, i31, i32, i33]))}:
end do:
end do:
end do:
end do:
end do:
end do:
end do:
end do:
end do:

MissingDeterminants := {$(min..max)(d)} minus d

@NanaP 

So much the better if it has been useful.

@NanaP 

ALL_Solutions file updated (see below)

Thanks.

A quick reply to your questions:

---------------------------------------------------------------------
1
Let X some random variable anf f its PDF.
Let Y = a+b*X (b assumed <> 0) and g its PDF; the basic formula to keep in mind is

g(t) = f((t-a)/b) / |b|



---------------------------------------------------------------------
2
Concerning the CDF the things are a little bit more complex. See an example here answ_1.mw.
If the scaling factor b is assumed to be strictly positive and if F and G are the CDF of X and Y respectively, then the second basic formula is 

F(t) = F((t-a)/b)

Demonstration of these formulas can be found in any text cours of Probability.

 

---------------------------------------------------------------------
3
Whatever the value of the scaling parameter Variance(Y) = b^2 * Variance(X).
As Variance is a central moment the shift parameter a doesn't matter.



---------------------------------------------------------------------
4
Skewness and Kurtosis are both defined based on central moments and the shift parameter a doesn't matter.
If you closely look to their formulas (see the Maple help pages for instance), you will see that they are dimensionless
(
Let MX(r) the central moment of order r of X and  MY(r) the central moment of order r of Y.
One has  MX(r) = br * MY(r).
Skewness(X) = MX(3) / MX(2)3/2 then Skewness(Y) = b3 *MX(3) / ( b2 *MX(2)) 3/2 = MX(3) / MX(2)3/2  = Skewness(X).
For the same reason he same Kurtosis(X) = Kurtosis(Y)
).


---------------------------------------------------------------------
​​​​​​​5
The Mean of a random variable (more precisely its Expectation), is linear operator over random variables.
Let E this operator.
Then E(Y) = E(a + b*X) = a + b*E(X).
Concerning the Mode: the transformation T : X --> Y being linear one easily deduces that Mode(Y) = a + b*Mode(X).
Concerning the Median, which is by defininition the value such that the PDF of a random variable takes the value 1/2, the demonstration that Median(Y) = a + b*Median(X) is a little bit more complex, see here answ_2.mw


FINALLY:
The following file contains all previous step-by-step demonstrations with Maple ​​​​​​​

 

restart


Probability Density Functions

X is a random variable with PDF f__X
Y = a + b . X
f__Y = PDF(Y)

with(IntegrationTools):

# X to Y relation
#
# For the sake of simplicity I consider only the case b > 0.


Y = a+b*X

Y = X*b+a

(1)

# Defition

Prob(X <= u) = Int(f__X(t), t=-infinity..u)

Prob(X <= u) = Int(f__X(t), t = -infinity .. u)

(2)

# and

Prob(Y <= v) = Int(f__Y(t), t=-infinity..v)

Prob(Y <= v) = Int(f__Y(t), t = -infinity .. v)

(3)

# Use relation (1)

eval((3), (1))

Prob(X*b+a <= v) = Int(f__Y(t), t = -infinity .. v)

(4)

# Rearrange the operand of Prob

Prob(isolate(op(lhs((4))), X)) = rhs((4)) assuming b > 0

Prob(X <= (v-a)/b) = Int(f__Y(t), t = -infinity .. v)

(5)

# Which means, from definition (2) that:


eval((2), u=rhs(op(lhs((5)))));

Prob(X <= (v-a)/b) = Int(f__X(t), t = -infinity .. (v-a)/b)

(6)

# Thus equating rhs(6) and rhs(5) gives

rhs((6)) = rhs((5))

Int(f__X(t), t = -infinity .. (v-a)/b) = Int(f__Y(t), t = -infinity .. v)

(7)

# Comparing the upper bounds of the two Integrals in (7) suggests
# that the change of variable t --> (tau-a)/b in the rhs Integral
# will change its upper bound (v-a) b Into v:

Change(lhs((7)), t=(tau-a)/b, tau) = rhs((7)) assuming b > 0

Int(f__X(-(-tau+a)/b)/b, tau = -infinity .. v) = Int(f__Y(t), t = -infinity .. v)

(8)

# Gather the two members within the same integral

Combine((lhs-rhs)((8))) = 0

Int(f__X(-(-tau+a)/b)/b-f__Y(tau), tau = -infinity .. v) = 0

(9)

# As this equality holds for any real value v one gets

GetIntegrand((9)) = 0

f__X(-(-tau+a)/b)/b-f__Y(tau) = 0

(10)

# And finally

simplify(isolate((10), f__Y(tau)), size)

f__Y(tau) = f__X((tau-a)/b)/b

(11)

# QED


Cumulative Density Functions

CDF(X) =F__X(t)
CDF(Y) = F__Y(t)

# Integrate both sides of (11) from -oo to some arbitrary value T

map(z -> Int(z, tau=-infinity..T), (11))

Int(f__Y(tau), tau = -infinity .. T) = Int(f__X((tau-a)/b)/b, tau = -infinity .. T)

(12)

# By definition of F__Y:

F__Y(T) = Change(rhs((12)), tau=a+b*t, t) assuming b > 0

F__Y(T) = Int(f__X(t), t = -infinity .. -(-T+a)/b)

(13)

# By definition of F__X:

lhs((13)) = F__X(op(2, GetRange(rhs((13)))))

F__Y(T) = F__X(-(-T+a)/b)

(14)

map(simplify, %);

F__Y(T) = F__X((T-a)/b)

(15)

# QED


Means

mu__X = mean(X)
mu__Y = mean(Y)

# By definition:

mu__X = Int(t*f__X(t), t=-infinity..+infinity);
 

mu__X = Int(t*f__X(t), t = -infinity .. infinity)

(16)

# and:

mu__Y = Int(tau*f__Y(tau), tau=-infinity..+infinity);

mu__Y = Int(tau*f__Y(tau), tau = -infinity .. infinity)

(17)

# Account for relation (11)

eval((17), (11))

mu__Y = Int(tau*f__X((tau-a)/b)/b, tau = -infinity .. infinity)

(18)

# Expand this expression after having use this change of the integration
# variable: tau = a + b*t

Expand(Change((18), tau=a+b*t, t)) assuming b > 0

mu__Y = b*(Int(t*f__X(t), t = -infinity .. infinity))+a*(Int(f__X(t), t = -infinity .. infinity))

(19)

# As f__Y is a PDF, one has

Int(f__X(t), t = -infinity .. infinity) = 1

Int(f__X(t), t = -infinity .. infinity) = 1

(20)

# Simplify relation (19) using (20):

eval((19), (20))

mu__Y = b*(Int(t*f__X(t), t = -infinity .. infinity))+a

(21)

# Use the definition (16) to simplify (21)

eval((21), (rhs=lhs)((16)))

mu__Y = b*mu__X+a

(22)

# QED


Variances

V__X = variance(X)
V__Y = variance(Y)

# By definition:

V__X = Int((t-mu__X)^2*f__X(t), t=-infinity..+infinity);
 

V__X = Int((t-mu__X)^2*f__X(t), t = -infinity .. infinity)

(23)

# and:

V__Y = Int((tau-mu__Y)^2*f__Y(tau), tau=-infinity..+infinity);

V__Y = Int((tau-mu__Y)^2*f__Y(tau), tau = -infinity .. infinity)

(24)

# Account for relation (11)

eval((24), (11))

V__Y = Int((tau-mu__Y)^2*f__X((tau-a)/b)/b, tau = -infinity .. infinity)

(25)

# Use the change tau = a + b*t for the integration variable

Change((25), tau=a+b*t, t) assuming b > 0

V__Y = Int((b*t+a-mu__Y)^2*f__X(t), t = -infinity .. infinity)

(26)

# Account for relation (22)

eval((26), (22))

V__Y = Int((-b*mu__X+b*t)^2*f__X(t), t = -infinity .. infinity)

(27)

# Factorize the integrand

lhs((27)) = Int(factor(GetIntegrand(rhs((27)))), t=GetRange(rhs((27))))

V__Y = Int(b^2*(mu__X-t)^2*f__X(t), t = -infinity .. infinity)

(28)

# Transform relation (23) this way

Expand((23)):
isolate(%, select(has, [op(rhs(%))], t^2)[])

Int(f__X(t)*t^2, t = -infinity .. infinity) = -mu__X^2*(Int(f__X(t), t = -infinity .. infinity))+2*mu__X*(Int(t*f__X(t), t = -infinity .. infinity))+V__X

(29)

# Expand relation (28)

Expand((28))

V__Y = b^2*mu__X^2*(Int(f__X(t), t = -infinity .. infinity))-2*b^2*mu__X*(Int(t*f__X(t), t = -infinity .. infinity))+b^2*(Int(f__X(t)*t^2, t = -infinity .. infinity))

(30)

# Modify relation (30) while accounting for relation (29)

simplify(eval((30), (29)))

V__Y = b^2*V__X

(31)

# QED


Medians

Medians

# By definition of the median:

Def__X := Int(f__X(t), t=-infinity..Median__X) = 1/2;

Int(f__X(t), t = -infinity .. Median__X) = 1/2

(32)

# and

Def__Y := Int(f__Y(tau), tau=-infinity..Median__Y) = 1/2;

Int(f__Y(tau), tau = -infinity .. Median__Y) = 1/2

(33)

# Account for relation (11) in (33)

eval((33), (11))

Int(f__X((tau-a)/b)/b, tau = -infinity .. Median__Y) = 1/2

(34)

# Change the integration variable

Change((34), tau=a+b*t, t) assuming b > 0

Int(f__X(t), t = -infinity .. -(-Median__Y+a)/b) = 1/2

(35)

# Use definition (32)

eval((35), (rhs=lhs)((32)))

Int(f__X(t), t = -infinity .. -(-Median__Y+a)/b) = Int(f__X(t), t = -infinity .. Median__X)

(36)

# Equating the upper bounds of each member gives

op(2, GetRange(lhs((36)))) = op(2, GetRange(rhs((36))))

-(-Median__Y+a)/b = Median__X

(37)

# Isolate Median__Y

isolate((37), Median__Y)

Median__Y = b*Median__X+a

(38)


Central Moments anq Quantiles

# For any central moments or order r (r >= 2) the proof that

CentralMonent(Y, r) = b^r * CentralMoment(X, r);

# proceeds exactly as the one used for the variances
# (central moment of order 2).

CentralMonent(Y, r) = b^r*CentralMoment(X, r)

(39)

# For any Quantile the proof that

Quantile(Y, prob) = a + b * Quantile(X, prob);

# proceeds exactly as the one used for the medians
# (quantile associated to prob=1/2).

Quantile(Y, prob) = a+b*Quantile(X, prob)

(40)

 


Download All_demonstrations_b.mw

 

First 13 14 15 16 17 18 19 Last Page 15 of 125