MaplePrimes Questions

The Statistics package contains a function named Specialize (which quite strangely doesn't appear when you expand the sections of this package).
Here is what help(Specialize) says:

The Specialize function takes a random variable or distribution data structure that contains symbolic parameters, and performs a substitution to specialize the given random variable or distribution.

My goal was to work with mixtures of two random variables. There are many ways to do that depending on the what you really want to achieve, but an elegant way is to define such a mixture this way:

  • Let X and Y two random variables representing the two components to be mixed.
    For instance X = Normal(mu, sigma) and Y = Normal(nu, tau).
     
  • Let B a Bernoulli random variable with parameter P.
     
  • Then M = B*X + (1-B)*Y represents a random mixture of the two components in proportions (p, 1-p).
    Note that M is a 5-parameters random variable.

Doing the things this way enables getting a lot of formal informations about M such as its mean, variance, and so on.

In order to illustrate what the mixture is I draw the histogram of a sample of M.
To do this I Specialized the three random variables X, Y, B.

I used parameters

mu=-3, nu=3, sigma=1, tau=1, p=1/2


My first attempt was to draw a sample of the random variable Mspec defined this way

Mspec := Specialize(B, [p=1/2])*Specialize(X, [mu=-3, sigma=1]) + (1-Specialize(B, [p=1/2]))*Specialize(Y, [nu=3, tau=1]);

As you see in the attached file (first plot) the histogram is wrong (so is the variance computed formally).

I changed this into

Mspec := Specialize(B, [p=1/2])*(Specialize(X, [mu=-3, sigma=1])-Specialize(Y, [nu=3, tau=1])) + Specialize(Y, [nu=3, tau=1]);

without more significative success: while the variance is nox corrext the histogram still remains obviously wrong (plot number 2)

My last attempt, which now gives q correct result (plot 3) was:

Bspec := Specialize(B, [p=1/2]);
Mspec := Bspec*Specialize(X, [mu=-3, sigma=1]) + (1-Bspec)*Specialize(Y, [nu=3, tau=1]);

Specialize.mw

I agree that one can easily do this stuff without using  Specialize.
For instance by using the procedure given at the end ofthe attached file.
Or by truly constructing a mixture Distribution (which would be more elegant but more complex).

I also agree that Specialize is in itself of a relative low interest except for educational purposes (you present the theoritical results and next you run a numerical application while giving numeric values to the formal parameters).

But why providing such an anecdotal function if it doesn't do the job correctly?

Note that these results were obtained with Maple 2015, but I doubt they'll be any better for more recent versions, given the confidential nature of Specialize.

I am trying to calculate the line element ds^2, for a de Sitter spacetime in 2+1 dimensions with positive cosmological constant, using the following metric and energy moment tensor:
1- ds² = -A(r) c^2 dt^2 + B(r) dr^2 + r^2d{\theta}^2,
2- T^{\mu \nu} = -(\rho + p) dx^{\mu} dx^{\nu} + p g^{\mu \nu}.

I tried several ways but I can't solve it using Maple 2023, Physics package. Could someone show me step by step how to solve this problem?

Images of the line element we need to find, the metric tensor associated with the problem and the components of the Riemann tensor.
My goal is to calculate the metric tensor, line element and associated components of the Riemann tensor for De Sitter spacetime with positive cosmological constant.

Is it possible to split a table (not the datatype, but the insert - table one)?

Question deleted since it tagged duplicate. Will go search for the duplicate. I did not know there was duplicate one.

update

Here is original question. If moderator thinks it is duplicate feel free to delete. 

I would like to duplicate this simplification done in Mathematica, but in Maple. Mathematica will cancel the exponential term automatically if told the domain is real, but in Maple it willl not.

My attempts in Maple which all fail

restart;


ode := diff(v(x), x, x)*exp(x^2) = 0;
simplify(ode);
simplify(ode) assuming real; #there is no such type
simplify(ode) assuming x::positive;
simplify(ode,symbolic);
use RealDomain in simplify(ode) end use;

How to cancel the exponential term from the above equation in Maple?

How do I use factor for Polynomials.

factor(a^2-b^2) works  (gives (a+b)(a-b))

factor(a^2+2ab+b^2) does nothinig

similarly sqrt(a^2+2ab+b^2) does nothing

Thanks for any info.

GGC

Hello everyone,

I'm trying to learn how to use Shoot Library 9.

Unfortunately, I'm not doing very well. I'm getting an error that I don't understand. I don't know where it comes from.

Please help me solve this odes system using this library.

I attached my Maple worksheet file.

ShootLib_Test.mw

Hi,

How to insert the notation of a vector, with an arrow? thanks

S5VecteurTextPlot.mw

evalf(Pi*int(2*299792458^2*662607015*10^(-8)*10^(-34)/((exp(299792458*662607015*10^(-8)*10^(-34)/(1380649*10^(-6)*10^(-23)*lambda*5772.0)) - 1)*lambda^5), lambda = 0 .. infinity));

returns a complex number for the Solar radiant exitance in watts per square meter with an effective blackbody temperature of "5772.0" kelvins.

Replacing "5772.0" with an exact "5772" gives the correct answer though.  The nominal Solar temperature is defined as exactly 5772 kelvins whereas the physical Solar effective temperature is 5772.0 K (+/-) 0.8 K.

Is there a way to get Maple 2023 to avoid outputting these types of errors when using nonexact quantities?

I tried replacing "5772.0" with "5772.00000000001" and "5771.9999999999" and the error is not duplicated for those kelvin temperatures.

Interestingly, this error does not occur on Maple for Excel, only within the Maple desktop client....

https://scienceworld.wolfram.com/physics/Stefan-BoltzmannLaw.html

https://iopscience.iop.org/article/10.3847/0004-6256/152/2/41/

I'm currently addressing a problem related to modified Bessel functions using an older version of Maple (the specific version escapes my memory). In an attempt to resolve issues, I've experimented with the trial version of Maple 2023, but I've encountered an unusual phenomenon. Expressions that were previously simplifiable in Maple now resist simplification. The specific expression provided below, which should equate to 1, fails to be recognized as such by Maple. This poses a concern as it could lead to overly complex expressions in subsequent steps, considering this expression is only an intermediate stage. Is there a recommended approach to overcome this challenge?

f := (BesselI(0, alpha)*alpha-2*BesselI(1, alpha))/(BesselK(0, alpha)*BesselI(1, alpha)*BesselI(0, alpha)*alpha^2+BesselK(1, alpha)*BesselI(0, alpha)^2*alpha^2-2*BesselI(1, alpha))

(BesselI(0, alpha)*alpha-2*BesselI(1, alpha))/(BesselK(0, alpha)*BesselI(1, alpha)*BesselI(0, alpha)*alpha^2+BesselK(1, alpha)*BesselI(0, alpha)^2*alpha^2-2*BesselI(1, alpha))

simplify(f)

(BesselI(0, alpha)*alpha-2*BesselI(1, alpha))/(BesselK(0, alpha)*BesselI(1, alpha)*BesselI(0, alpha)*alpha^2+BesselK(1, alpha)*BesselI(0, alpha)^2*alpha^2-2*BesselI(1, alpha))

eval(f, alpha = .25)

1.000000000

NULL

Download question.mw

1. Sorry the question is not a maple product but just wanted to know if anyone was using the sharp equation calculator with a pc link interface as it is not with a very acceptable web presence and the kit is unaffordable. If Maple has an equivalent I would love to know.

2. Does Maple have a facility for using virtual drives and emulators on a portable basis (non cloud)?

Hi Math People,

I can't find an answer if it is possible to insert slider or any other component into document, adjust its value by sliding it and execute all following calculations in the document below the slider, those which depends on the value of slider parameter?

I know this is possible in graphs, or explore command, but could it be simply setting some value let's say "a". Lets set its value by slider and when slider is set, code should automatically update document? This part of code of slider "Action When Value changes"

Or am I expecting too much?

Best regards

Marcin

how to write the elements of the triangle of Pascal so that all 1 are aligned on a same vertical. Thank you.

this is my model. Please give me how to find the DFE and basic reproduction number from maple.

I am a little overwhelmed by the possibilities of ColorTools.
Is there a graphical overview of implemented palettes side by side?

please help me to fixed and find the analytic solution...

restart

with(linalg)

f1 := mu[1]*N-delta*r-beta*N*s(e+i)

mu[1]*N-delta*r-beta*N*s(e+i)

(1)

f2 := beta*N*s(e+i)+omega*v-(mu[1]+pi+gamma)*e

beta*N*s(e+i)+omega*v-(mu[1]+pi+gamma)*e

(2)

``

f3 := pi*e-(mu[1]+mu[2]+sigma)*i

pi*e-(mu[1]+mu[2]+sigma)*i

(3)

f4 := gamma*e+sigma*i-(theta+mu[1]+mu[2])*q

gamma*e+sigma*i-(theta+mu[1]+mu[2])*q

(4)

f5 := theta*q+xi*v-(mu[1]+delta)*r

theta*q+xi*v-(mu[1]+delta)*r

(5)

f6 := eta*N*s-(mu[1]+omega+xi)*v

eta*N*s-(mu[1]+omega+xi)*v

(6)

T := solve({f1, f2, f3, f4, f5, f6}, [s, e, i, q, r, v])

Error, (in solve) cannot solve for an unknown function with other operations in its arguments

 

``

Download cobacoba.mw

First 111 112 113 114 115 116 117 Last Page 113 of 2402