Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello
Is it possible to reproduce this MathCad example in Maple?

The quantity diff(y)./diff(x) is an approximate derivative.

  • x = [1 2 3 4 5];
    y = diff(x)
    y =
         1     1     1     1
    
    z = diff(x,2)
    z =
         0     0     0
    

Given,

  • A = rand(1,3,2,4);
    

diff(A) is the first-order difference along dimension 2.

diff(A,3,4) is the third-order difference along dimension 4.


The function diff of Matlab calculates differences between adjacent elements of X along the first array dimension whose size does not equal 1

Is there a similar function in Mape?

 

Please, where are the statistical tolerance intervals in Maple, similar to those we have in MiniTab and in R ?  maybe in statistical quality control ?

Example 1 :  Package « tolerance » in R (https://cran.r-project.org/web/packages/tolerance/tolerance.pdf) : 

 

« Description :  Statistical tolerance limits provide the limits between which we can expect to find a specified proportion of a sampled population with a given level of confidence. This package provides functions for estimating tolerance limits (intervals) for various univariate distributions (binomial, Cauchy, discrete Pareto, exponential, two-parameter exponential, extreme value, hypergeometric, Laplace, logistic, negative binomial, negative hypergeometric, normal, Pareto, Poisson-Lindley, Poisson, uniform, and Zipf-Mandelbrot), Bayesian normal tolerance limits, multivariate normal tolerance regions, nonparametric tolerance intervals, tolerance bands for regression settings (linear regression, nonlinear regression, nonparametric regression, and multivariate regression), and analysis of variance tolerance intervals. Visualizations are also available for most of these settings. »

 

Example 2 : 

https://support.minitab.com/en-us/minitab/18/help-and-how-to/quality-and-process-improvement/quality-tools/how-to/tolerance-intervals-normal-distribution/methods-and-formulas/methods-and-formulas/

https://support.minitab.com/fr-fr/minitab/18/help-and-how-to/quality-and-process-improvement/quality-tools/how-to/tolerance-intervals-nonnormal-distribution/methods-and-formulas/tolerance-intervals/   

Hi, i want to investigate  chaos for the problem , cantilever beam under random narro band excitation, but the code has errors .the code is this:

      restart:with(plots):      h:=1: Omega:=(0..376):alpha1:=617.2:alpha2:=1.02*10^(8): c:=.002:k:=18.4:  step:=0.1:imax:=376:  for i from 0 to imax do;  Omega[i]:=i*step:   f:=evalf(solve({((-a*Omega[i]^(2)+alpha1*a+3/(4)*alpha2*a^(3)+1/(4)*k*Omega[i]^(2)*a^(3)-(3)/(4)*k*Omega[i]^(2)*a^(3))^(2)+(c*Omega[i]*a^())^(2))=h^(2),a>0}));  ff[i]:=((rhs(f[1]))^(2))/(2):  end do:   l1:=[[Omega[n],ff[n]] $n=0..imax]:  p1:=plot(l1, x=0..3,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):    jmax:=914: f1:=array(377..914):f2:=array(377..914):f3:=array(377..914):Omega1:=array(377..914):  for j from 377to jmax do;  Omega1[j]:=j*step:   fff:=evalf(solve({((-a*Omega1[j]^(2)+alpha1*a+3/(4)*alpha2*a^(3)+1/(4)*k*Omega1[j]^(2)*a^(3)-(3)/(4)*k*Omega1[j]^(2)*a^(3))^(2)+(c*Omega1[j]*a^())^(2))=h^(2),a>0}));  f1[j]:=((rhs(fff[1,1]))^(2))/(2):f2[j]:=((rhs(fff[2,1]))^(2))/(2):f3[j]:=((rhs(fff[3,1]))^(2))/(2):  end do:   ll1:=[[Omega1[n],f1[n]] $n=377..jmax]:  pp1:=plot(ll1, x=0..10,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):    ll2:=[[Omega1[n],f2[n]] $n=377..jmax]:  pp2:=plot(ll2, x=0..10,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):    ll3:=[[Omega1[n],f3[n]] $n=377..jmax]:  pp3:=plot(ll3, x=0..15,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):       plot({  seq(seq(p1), seq(seq(pp1),seq(seq(pp2),seq(seq(pp3))  },style=point,title=`Pitchfork Diagram`);  Thanks for your help

I need to convert this Maple Table to a Matrix

table([(25, 1) = -39, (16, 151) = 32, (33, 1) = -54, (1, 1) = 29, (13, 1) = 32, (31, 101) = -7, (6, 51) = -10, (11, 101) = -1, (28, 151) = -39, (18, 51) = -65, (4, 151) = 29, (8, 151) = -10, (23, 101) = 23, (34, 51) = -54, (40, 151) = 87, (36, 151) = -54, (9, 1) = -1, (37, 1) = 87, (21, 1) = 23, (14, 51) = 32, (22, 51) = 23, (20, 151) = -65, (27, 101) = -39, (3, 101) = 29, (19, 101) = -65, (24, 151) = 23, (32, 151) = -7, (30, 51) = -7, (38, 51) = 87, (7, 101) = -10, (10, 51) = -1, (29, 1) = -7, (35, 101) = -54, (17, 1) = -65, (26, 51) = -39, (15, 101) = 32, (12, 151) = -1, (39, 101) = 87, (5, 1) = -10, (2, 51) = 29]) 

Hello,

I have difficulties to solve a small linear system.

I attach my code. It may be due to derivate variables but i'm not sure. I remember having solve before similar systems.

Analyse_cinematique_test2.mw

May you have a look at my code and tell me why the solve function doesn't return any results ?

Thank you for your help.

Hello,

I have a set of 8 kinematic constraints.

I would like to express them into the following form Jxdq with J the jacobian matrix.

I attached my code.

the 8 equations are gathered in SysEq

Thanks a lot for your help

Analyse_cinematique_test.mw

The following quiz doesn't react in the rigth way, when the respond is a fraction with nominator 1. When the fraction 4/20 is the answer, the respond 1/5 is incorrect

Grading:-Quiz("Reduce this fraction",
proc (Resp, Ans) evalb([op(InertForm:-Value(Ans))] = [op(Resp)]) end proc,
proc () local a, b, c; a := rand(1 .. 5); b := rand(1 .. 5); c := rand(2 .. 5)( ); `%/`(a( )*c, b( )*c) end proc, 
'inertform' = true)

Any proposals?

Below is my code (I hope copy paste is ok.....)

restart;

OB := add(px[i]*(px[i]-py[i])*(1-Sw[i])*fclass[i], i = 1 .. 6); # this is my objective function

px := Vector[row](6, [0.6e-2, 0.5e-2, 0.4e-3, 0.3e-2, 0.2e-3, 0.1e-3]);

py := Vector[row](6, [0.9e-2, 0.8e-2, 0.7e-2, 0.6e-2, 0.5e-3, 0.4e-3]);

fclass := Vector[row](6, [0.1e-4, 0.9e-4, 0.9e-3, 0.9e-2, 0.9e-1, .9]);  # assign some numbers for the parameters

with(Optimization);

Maximize(OB, {add(Sw[i]*fclass[i], i = 1 .. 6) = 0.001, Sw[1] <= 1, Sw[2] <= 1, Sw[3] <= 1, Sw[4] <= 1, Sw[5] <= 1, Sw[6] <= 1}, assume = nonnegative);

  [-1.08216000000000 *10^-7 , [Sw[1] = 1., Sw[2] = 0., Sw[3] = 0., ] Sw[4] = 0.110000000000000, Sw[5] = 0., Sw[6] = 0.]

The Optimization result is -1.08216*10^-7. However, this is clearly not right, since with the below solution for Sw[i], the result is bigger and the constaint still hold...(i.e. add(Sw[i]*fclass[i], i = 1 .. 6) = 0.001)

[-1.07676000000000*10^(-7), [Sw[1] = 1., Sw[2] = 1., Sw[3] = 0., Sw[4] = .1, Sw[5] = 0., Sw[6] = 0.]]

I cannot see what's wrong...Can we simply blame the floating point is not easy for Maple to handle??

Thanks.

Hello guys,

I have some problems with plugging in a metric ansatz to some tensorial terms.
ansatz1.mw

Best

How can reduce the number of circle in this curve

f := proc (x) options operator, arrow; sin(x) end proc;

plot(f(x), x = 0 .. 2*Pi);

 

Dear all,
When I try to simplify the expresion z+conjugate(z) I get, as expected, 2*Re(z).

The problem arises when I try to do the same with a more complicated expression as z1*conjugate(z2)+conjugate(z1)*z2. Trying to simplify this Maple only give me back the expression with nochange. The expresion is equivalent to the first example so I expected to get 2Re(z1*conjugate(z2)).

Does anybody know how to solve this problem?
Thank you in advance!

Hello,

I have two functions :
x(apha1,alpha2)
y(alpha1,alpha2)

When alpha2 is fixed, i can make a parametric plot to see the evolution of the point M which have the coordinates (x,y).

Consequently, 

for alpha2 = 30°, i can plot 

plot([eval(X(alpha1,30*Pi/180)),eval(Y(alpha1,30*Pi/180)),alpha1=-30*Pi/180..30*Pi/180],-1..1,-1..1);

for alpha2 = 25°, i can plot 

plot([eval(X(alpha1,25*Pi/180)),eval(Y(alpha1,25*Pi/180)),alpha1=-30*Pi/180..30*Pi/180],-1..1,-1..1);

for alpha2 = 20°, i can plot 

plot([eval(X(alpha1,20*Pi/180)),eval(Y(alpha1,20*Pi/180)),alpha1=-30*Pi/180..30*Pi/180],-1..1,-1..1);

and so on ...

I would like to plot these different parametric plots with a increment of 5 degrees for alpha2 from 30° to -30°. But, i would like to gather all the plots on the same plot.

I attach my code. My attempt with a for loop doesn't work.

How can i do such a plot (gathering several parametric plots) ?

Thank you for your help.

Analyse_cinematique_vehicule_4D_28.01_test.mw

 

 

 

Dear All,

I am having problem in plotting two function(which themselves are functions of elliptical integrals of first and third kind) together.

If I plot them separately, it has no issues but while combining it plots just one.

I am attaching the maple worksheet here, I have to plot alpha and beta together with 'z' as independent variable.

Please reply asap.
 

restart

a := .5:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

b__sc := -a+2*s*sqrt(3*(3-x))*cos((1/3)*arccos(-s*sqrt(3*a/(3-x)))):

d__sc := -a+2*t*sqrt(3*(3-x))*cos((1/3)*arccos(-t*sqrt(3*a/(3-x)))):

--------------------------------------------------------------------------------------------------------------------

b := proc (z) options operator, arrow; s*b__sc/(1-z) end proc:

d := proc (z) options operator, arrow; t*b__sca/(1-z) end proc:

--------------------------------------------------------------------------------------------------------------------

w__s := proc (z) options operator, arrow; a/b(z) end proc:

v__s := proc (z) options operator, arrow; a/d(z) end proc:

--------------------------------------------------------------------------------------------------------------------

h__sc := proc (z) options operator, arrow; (b(z)+a)/(b(z)-a) end proc:

j__sc := proc (z) options operator, arrow; (d(z)+a)/(d(z)-a) end proc:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

r := proc (z) options operator, arrow; (1/3)*x+2*sqrt(b(z)^2-a^2-(1/3)*x^2)*cos((1/3)*arccos(-(3/2)*sqrt(3)*(2*(b(z)-a)^2-(1/3)*x*(-a^2+b(z)^2)-(2/27)*x^3)/(b(z)^2-a^2-(1/3)*x^2)^(3/2)))/sqrt(3) end proc:

u := proc (z) options operator, arrow; (1/3)*x+2*sqrt(d(z)^2-a^2+(1/3)*x^2)*cos((1/3)*arccos(-(3/2)*sqrt(3)*(2*(d(z)-a)^2-(1/3)*x*(-a^2+d(z)^2)-(2/27)*x^3)/(d(z)^2-a^2+(1/3)*x^2)^(3/2)))/sqrt(3) end proc:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

H := proc (z) options operator, arrow; 1/r(z) end proc:

J := proc (z) options operator, arrow; 1/u(z) end proc:

---------------------------------------------------------------------------------------------------------------------------------------------------------

M := proc (z) options operator, arrow; ((h__sc(z)-2*H(z))*(6*H(z)+h__sc(z))+8*x^2/(b(z)^2*(1-w__s(z))^2))^(1/2) end proc:

P := proc (z) options operator, arrow; ((j__sc(z)-2*J(z))*(6*J(z)+j__sc(z))+8*x^2/(d(z)^2*(1-v__s(z))^2))^(1/2) end proc:

---------------------------------------------------------------------------------------------------------------------------------------------------------

n__1 := proc (z) options operator, arrow; evalf((1-6*H(z)/h__sc(z)+M(z)/h__sc(z))/(1-2*H(z)/h__sc(z)-(4+2*x)/(h__sc(z)*(a^2+2*x))+M(z)/h__sc(z)+sqrt((2+x)^2-4*a^2-8*x)/(h__sc(z)*(a^2+2*x)))) end proc:

n__3 := proc (z) options operator, arrow; evalf((1-6*J(z)/j__sc(z)+P(z)/j__sc(z))/(1-2*J(z)/j__sc(z)-(4+2*x)/(j__sc(z)*(a^2+2*x))+P(z)/j__sc(z)+sqrt((2+x)^2-4*a^2-8*x)/(j__sc(z)*(a^2+2*x)))) end proc:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

n__2 := proc (z) options operator, arrow; evalf((1-6*H(z)/h__sc(z)+M(z)/h__sc(z))/(1-2*H(z)/h__sc(z)-(4+2*x)/(h__sc(z)*(a^2+2*x))+M(z)/h__sc(z)-sqrt((2+x)^2-4*a^2-8*x)/(h__sc(z)*(a^2+2*x)))) end proc:

n__4 := proc (z) options operator, arrow; evalf((1-6*J(z)/j__sc(z)+P(z)/j__sc(z))/(1-2*J(z)/j__sc(z)-(4+2*x)/(j__sc(z)*(a^2+2*x))+P(z)/j__sc(z)-sqrt((2+x)^2-4*a^2-8*x)/(j__sc(z)*(a^2+2*x)))) end proc:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

k := proc (z) options operator, arrow; evalf((1/2)*2^(1/2)*(h__sc(z)/M(z))^(1/2)*(M(z)/h__sc(z)+6*H(z)/h__sc(z)-1)^(1/2)) end proc:

l := proc (z) options operator, arrow; evalf((1/2)*2^(1/2)*(j__sc(z)/P(z))^(1/2)*(P(z)/j__sc(z)+6*J(z)/j__sc(z)-1)^(1/2)) end proc:

----------------------------------------------------------------------------------------------------------------------------------------------------------------

psi := proc (z) options operator, arrow; evalf(arcsin((1-2*H(z)/h__sc(z)-M(z)/h__sc(z))/(1-6*H(z)/h__sc(z)-M(z)/h__sc(z)))) end proc:

phi := proc (z) options operator, arrow; evalf(arcsin((1-2*J(z)/j__sc(z)-P(z)/j__sc(z))/(1-6*J(z)/j__sc(z)-P(z)/j__sc(z)))) end proc:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Omega__1 := proc (z) options operator, arrow; evalf((4*(1-w__s(z))*(2+x+sqrt((2+x)^2-4*a^2-8*x))-4*a^2-8*x)/(a*((2+x)^2-4*a^2-8*x)^(1/2)*((4+2*x)/(a^2+2*x)+2*H(z)-h__sc(z)+M(z)+sqrt((2+x)^2-4*a^2-8*x)/(a^2+2*x)))) end proc:

Omega__3 := proc (z) options operator, arrow; evalf((4*(1-v__s(z))*(2+x+sqrt((2+x)^2-4*a^2-8*x))-4*a^2-8*x)/(a*((2+x)^2-4*a^2-8*x)^(1/2)*((4+2*x)/(a^2+2*x)+2*J(z)-j__sc(z)+P(z)+sqrt((2+x)^2-4*a^2-8*x)/(a^2+2*x)))) end proc:

----------------------------------------------------------------------------------------------------------------------------------------

Omega__2 := proc (z) options operator, arrow; evalf((4*(1-w__s(z))*(2+x+sqrt((2+x)^2-4*a^2-8*x))+8*x+4*a^2)/(a*((2+x)^2-4*a^2-8*x)^(1/2)*((4+2*x)/(a^2+2*x)+2*H(z)-h__sc(z)+M(z)-sqrt((2+x)^2-4*a^2-8*x)/(a^2+2*x)))) end proc:

Omega__4 := proc (z) options operator, arrow; evalf((4*(1-v__s(z))*(2+x+sqrt((2+x)^2-4*a^2-8*x))+8*x+4*a^2)/(a*((2+x)^2-4*a^2-8*x)^(1/2)*((4+2*x)/(a^2+2*x)+2*J(z)-j__sc(z)+P(z)-sqrt((2+x)^2-4*a^2-8*x)/(a^2+2*x)))) end proc:

---------------------------------------------------------------------------------------------------------------------------------------------

alpha := proc (z) options operator, arrow; evalf(-Pi+4*(Omega__1(z)*(EllipticPi(n__1(z), k(z))-EllipticPi(psi(z), n__1(z), k(z)))+Omega__2(z)*(EllipticPi(n__2(z), k(z))-EllipticPi(psi(z), n__2(z), k(z))))/((1-w__s(z))*(M(z)*h__sc(z))^(1/4))) end proc:

beta := proc (z) options operator, arrow; evalf(-Pi+4*(Omega__3(z)*(EllipticPi(n__3(z), l(z))-EllipticPi(phi(z), n__3(z), l(z)))+Omega__4(z)*(EllipticPi(n__4(z), l(z))-EllipticPi(phi(z), n__4(z), l(z))))/((1-v__s(z))*(P(z)*j__sc(z))^(1/4))) end proc:

plot([alpha, beta], 0 .. 1);

Warning, unable to evaluate 1 of the 2 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

 

 

``


 

Download deflection-angle-comd.mw

hello guys,
in the bellow, screen shot that I have sent to you.
how can I solve this three equations and obtain a1 a2 a3??? in fact non zero answers.
also is this possible to learn me how to write my codes that I have written in maple in the form that others send to you for their questions??? I dont know how to do that...and send screen shot!!
thank you

First 855 856 857 858 859 860 861 Last Page 857 of 2216