Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

This worksheet animates the motion of an object (say, a cube which slides frictionlessly) on a rotating carousel. The cube is not self-propelled.

How can the worksheet be modified to handle the combination of the carousel motivated motion and the cube's own generated motion, caused by, say, by a few strategically placed thrusters?

The cube's own generated path could be a straight line, or a curve such as an ellipse. The cube's own motion could have a constant velocity or be accelerating.

Carousel_dynamics.mw

Hi,

How can two specular equations generate two nonspecular (i.e., very different in length and form) solutions? I attach my script with two questions at the bottom: 

specular_equations_nonspecular_solutions.mw

Thank you.

Maple seems to give me very inaccurate results for this computation, I'm wondering if this is a known issue and if there's a way to fix it? Worksheet:

Exact commands I ran:
with(combinat):
B := (n, i, p) -> binomial(n, i)*(p^i)*(1-p)^(n-i)/i;

F:=(n,p)->sum(B(n,i,p),i=1..n);
F(2,1);

This outputs 0, when it should output 1/2. See image attached:

 

Is there a fix for this?

xA := 4;
yA := 10;
xB := 0;
yB := 0;
xC := 13;
yC := 0;
Mat := matrix(3, 3, [xA, xB, xC, yA, yB, yC, 1, 1, 1]);
phi := (x, y) -> 1/Mat &x [x, y, z];
phi(4, 18/2);
phi(4, 10);
phi(13, 0);
Why the results are not calculated ? Thank you.

Hello everyone,

I wrote a very simple shooting method and I don't know why it doesn't go through the for loop.
Please help, I have no idea why it doesn't work.

Simple_ODE_Met_1.mw

This is probably a dummy question. I have a matrix (3 columns, 4 rows). I would like to extract the rows in which the value in the third column matches "2". As long as one has a matrix of 2 columns, this can be easily done by using the Lookup command but it does not allow you to give the row values of multiple columns. Is there another command that allows you to do that?

Thank you in advance for your help.

FindRowInMatrix.mw

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

First 16 17 18 19 20 21 22 Last Page 18 of 2097