mmcdara

6279 Reputation

17 Badges

7 years, 325 days

MaplePrimes Activity


These are questions asked by mmcdara

I have a surface defined by C(x, y, x) = 0 that I visualize with implicitplot3d.
Using shading=shue does not suits me and I would like to define my own coloring function F(x, y, z).

The first error I got made me think that a coloring function cannot depend on 3 parameters.
But a simpler (and not visually satysfying function) F(x, y) already leads to an error, which makes me wonder if it is possible to use a colorig function with  implicitplot3d?

implicitplot3d_coloring.mw

Thanks in advance

Question 1
Let theta a real number in the range 0..2*Pi.
Is there a way to "convert" 

f := theta -> arccos(cos(theta))+arcsin(sin(theta))

into 

f1 := theta -> piecewise(theta < 0, 0, theta < (1/2)*Pi, 2*theta, theta < Pi, Pi, theta <= (3/2)*Pi, 3*Pi-2*theta, 0)


Question 2
As f1 is  2*Pi periodic, is there a way to convert f into a periodic function where the "pattern" is f1(theta)?
To be clearer I thought to something close to what we get when we do this

solve(cos(x)=1, allsolutions);
                            2 Pi _Z2 
about(_Z1);
Originally _Z1, renamed _Z1~:
  is assumed to be: integer

and I imagined 

Some_Transformation(f(theta))
    f1(theta+2*Pi*_Z1~)
about(_Z1); 
Originally _Z1, renamed _Z1~: 
  is assumed to be: integer

For the moment I build the periodized f1 this way

f2 := (theta, K) -> int(f1(theta-z)*add(Dirac(z-2*Pi*k), k=-K..K), z=-infinity..+infinity);
# or
f2 := (theta, K) -> sum(int(f1(theta-z)*Dirac(z-2*Pi*k), z=-infinity..+infinity), k=-K..K);

Thanks in advance.

For a lesson I'm preparing, I want to illustrate some probability concepts using Maple.
In particular, I need to use the fact that the Expectation operator(let say the Mean operator) is a linear operator with respect to random variables. 
However, I don't want to particularize my demonstration by using this or that statistical distribution but simply the notion of random variable.
I have therefore created a specific Distribution named  MinimalAbstractDistribution in which only the mean and variance are defined.

When Statistics:-Mean is applied to the expression (A*p+q) where p and q are names and A is a random variable with distribution MinimalAbstractDistribution, linearity is effectively used.
But not when it is applied to A/p or A-q.

Why that?
Is there a way of defining a statistical distribution so that Mean behaves as expected?

(You will easily understand that no workaround of the form

Mean(A+q);
eval(%, q=-q);

# or
add(Mean~([op(A-q)]))

can be accepted in a lesson).

Thanks for your attention
 

restart

with(Statistics):

 

MinimalAbstractDistribution := proc(i)
  Distribution(Mean=mu[i], Variance=sigma[i]^2)
end proc:

A := RandomVariable(MinimalAbstractDistribution(1))

_R

(1)

[Mean, Variance](A);

[mu[1], sigma[1]^2]

(2)

Mean(p*A+q);
Mean(p*(A+q))

p*mu[1]+q

 

p*(mu[1]+q)

(3)

# But

Mean(A-q);
Mean(A/p)

FAIL

 

FAIL

(4)
 

 

Download Mean_operator.mw

Here is an example where IntegrationTools:-Combine does not seem capable to combine two integrals whose lower bounds are -infinity (same situation holds where upper bounds equal to +infinity).

Is there a way to Combine(J1) without using the J3 workaround?
Is there any mathematical reason why Combine(J1) does not work or it is due to the way Maple handles infinity?

Thanks in advance.

IntegrationTools_Combine.mw

These two results seem contradictory:

  1. The first one means the type real doesn't exist, which can be easily verified by looking to the help(type) page, 
  2. Given the definition of '::' ( from help(coloncolon`) 'The  "::" operator serves several purposes in Maple, all related to types.') the second one suggests that real is a known type (for there is no error returned).
restart
f := x -> `if`(x::real, x, I*x):
f(3)
Error, (in f) type `real` does not exist
g := x -> is(x::real);
g(3), g(3*I)
                              true, false

Does assuming transforming "real" into a property in function g explains why it returns true?

Thank in advance for your explanations

(
Bulk questions:

Why doesn't real type exist, whereas complex type does?
From help(complex):
General complex numbers are numbers of the form x + I*y, where x and y are integers, rationals, or floats. In the general complex number case, if either x or y is a floating-point number, then an automatic conversion takes place, coercing both x and y into type float.
seems to mean that the complex is built upon floats and not reals.
But the dictionnary says
complex: adj. 1. of, involving, or of the form of a complex number, consisting of a real and an imaginary part, either of which may be zero. 2.- n. another term for a simplicial complex. Sometimes, however, less is required of a complex than of a simplicial complex. 3. (Group theory) an archaic term for a subset of a group.
real: adj.  1. involving or consisting of real numbers alone, having no imaginary part, or imaginary part equal to zero.  2. (as substantive) a real number.
The dictionnary doesn't mention floating point number but real ones, whereas the help pages do the opposite.

Why some numbers are considered as types whereas others are properties?
For instance, help(property) says that property rational is related to parent property real, but rational is also a type.
)

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