MaplePrimes Questions

I am trying to see if there is a way to submit maple code as a worksheet and get results back as worksheets in a cluster. 

The following 2D integrals of 0 are seemingly trivial and one would expect them to evaluate to zero, but Maple evaluates them to undefined

int(0, x=0..infinity, y=0..1) # undefined
int(0, x=0..1, y=0..infinity) # undefined

When the 2D integral is split into two 1D integrals, it does evaluate to zero, as the following examples show

int(0,x=0..infinity) # 0
int(int(0,x=0..infinity), y=0..1) # 0
int(int(0,x=0..1),y=0..infinity) # 0

If infinity is replaced by a variable (say 'c'), the first two integrals are also evaluated to zero.

It may be connected by the following

int(a, x=0..infinity, y=0..1) # a*infinity
int(a, x=0..1, y=0..infinity) # a*infinity
int(a,x=0..infinity) # signum(a)*infinity

So for the 1D integrals the signum is applied to 'a' when the interval is infinite, but not for the 2D integrals. I'm not sure about this difference.

if i solved two integral seperately..it solved.. but i can't solve together..what's wrong...please help

restart

"al_eq:=`D__11`*(∫)[0]^(a)((ⅆ)^2)/((ⅆ)^( )x^2) A*((ⅆ)^2)/((ⅆ)^( )x^2) A ⅆx (∫)[0]^(b)B*B ⅆy;"

Error, invalid product/quotient

"al_eq:=`D__11`*(∫)[0]^a((ⅆ)^2)/((ⅆx)^2) A*((ⅆ)^2)/((ⅆx)^2) A ⅆx (∫)[0]^bB*B ⅆy;"

 

``

B^2*b

(1)

``

Download 2.mw

i want to sovle this problem ..but i dont' know how to start..please help me.how to solve this eqution?

Hey Guys in the attached file below, how can i create a spatial motion (3 traditional + (1 rotational) )? i keep getting errors when i use both for my Rigid body frame. I just have to activate one of the Translational or Rotational block at same time , is there any solution here

Spatial_Motion2.msim

how to solve for lamda and r in this equtaions...please help

restart

with(LinearAlgebra):

solve(cos(lambda[i])*cosh(lambda[i]) = 1);

Warning, solutions may have been lost

 

0

(1)

evalf(%);

0.

(2)

lambda[i];

lambda[i]

(3)

r[i] := (cos(lambda[i])-cosh(lambda[i]))/(sin(lambda[i])-sinh(lambda[i]));

(cos(lambda[i])-cosh(lambda[i]))/(sin(lambda[i])-sinh(lambda[i]))

(4)

``

Download 1.mw

Is it possible to read in specific parts of a bmp image? 

what is the homology matrix that plates the ABCE square on the NPCM square
I think it may bi find out with the rotation angle, the vector of translation and the homothety ratio.
restart;  
with(geometry):  
with(plots):  
_EnvHorizontalName = 'x':  _EnvVerticalName = 'y':

point(A, 0, 1):
point(B, 1, 1):
point(C, 1, 0):
point(E, 0, 0):
square(Sq, [A, B, C, E]):
Phi := (1 + sqrt(5))/2:
point(N, (2 - Phi)/(Phi - 1), 1):
line(BE, [B, E]):
MakeSquare(s1, [N, C, 'diagonal']):
point(M, (3 - sqrt(5))/(2*sqrt(5) - 2), (3 - sqrt(5))/(2*sqrt(5) - 2)):
point(P, (1 + sqrt(5))/(2*sqrt(5) - 2), (3*sqrt(5) - 5)/(2*sqrt(5) - 2)):
T:=<simplify(coordinates(midpoint(O1,E,B))-coordinates(midpoint(O2,M,P)))>:
simplify(distance(O1,O2)):
line(MN,[M,N]):eq:=Equation(%,[x,y]):sol:=solve(eq,y):
Ang:=Pi/2-arctan(diff(sol,x)):
r:=simplify(distance(N,M)):
line(MP,[M,P]):eq:=Equation(%,[x,y]):subs(y=0,%):point(Q,solve(%,x),0):
line(PQ,[P,Q]):
homology(Sq1, Sq, C, Ang, 'clockwise', r):


display(draw([A(color = black, symbol = solidcircle, symbolsize = 12), 
B(color = black, symbol = solidcircle, symbolsize = 12), 
C(color = black, symbol = solidcircle, symbolsize = 12), 
E(color = black, symbol = solidcircle, symbolsize = 12), 
N(color = black, symbol = solidcircle, symbolsize = 12), 
Sq(color = red, filled = true, transparency = 0.9), 
BE(color = green), 
PQ(color = black),
 Sq1(color = black), 
s1(color = red, filled = true, transparency = 0.8)]), 
textplot([[coordinates(A)[], "A"], 
[coordinates(B)[], "B"], 
[coordinates(E)[], "E"], 
[coordinates(N)[], "N"], 
[coordinates(P)[], "P"], 
[coordinates(M)[], "M"], 
[coordinates(Q)[], "Q"], 
[coordinates(C)[], "C"]], 
align = [above, right]), view = [-0.6 .. 1.5, 0 .. 1], axes = none);
 

Given a constant gamma, gaussian random variables S[1] and S[2], and a linear combination of gaussian random variables Omega, I need to compute Exp[ Omega | S[1], S[2] ] - (gamma/2)*Var[ Omega | S[1], S[2] ]. I am not experienced in Maple. In the attached script I include many step-by-step details on what I need to do, as well as some notes where I get stuck:

150423_OptimizationProblem.mw

It would be convenient if you could directly fix this and share the working version. Thanks!

The conditional means and variance terms are calculated according to the 2D version of the script 3_gaussian_mmcdara.mw provided by @mmcdara.

Here is a string, and I want to treat consecutive single digits as a single number and extract them. I can process it using regular expressions in Python. I'm not sure if Maple can handle it in a similar way.

import re
sstr1 = "124e34e243e45e56e76f34e45e23ea12e98e34e43"
num=re.findall(r'\d+', sstr1)
s=list(map(int, num))
print(s)

[124, 34, 243, 45, 56, 76, 34, 45, 23, 12, 98, 34, 43]

Is there an equivalent regular expression method in Maple?

As usual, I have a tricky question. There is an integral that Maple can take numerically

R0 := 1/(a-sqrt(b+c*cos(x)));

Now let's put the coefficients, e.g.

 a := 0.9; b := 4.5; c :=0.1

and take the integral from 0 to 2*Pi

R1 := evalf(int(R0, x = 0 .. 2*Pi));

Also, there is an exact analytical result that Maple gives (I give it after simplifying it to avoid division by zero for the limit x=0 and x=2*Pi)

R2:=-4*((a^2-b+c)*EllipticK(sqrt(-2*c/(b-c)))-a^2*EllipticPi(2*c/(a^2-b+c), sqrt(-2*c/(b-c))))/((a^2-b+c)*sqrt(b-c));

As it turns out, the results are completely different. In the first case -5.145818656, while for the second case -3.612771378+0.I

Moreover, If we change the coefficients to a := 0.9; b := 4.5; c := -4 then I obtain Float(undefined)+3.662506136*I and -2.362349457+3.662506117*I , respectively.

My question: how to avoid this descepancy?

A := Matrix([[1, 3, 9, 2, 3, 7, 1, 1, 5, 4, 7], [7, 5, 5, 4, 9, 3, 4, 5, 3, 5, 3], [5, 2, 1, 6, 5, 4, 2, 9, 6, 6, 6], [2, 4, 1, 9, 5, 1, 1, 2, 1, 1, 7], [1, 9, 2, 3, 2, 9, 8, 2, 2, 7, 3], [5, 5, 3, 7, 2, 1, 5, 2, 7, 8, 3], [2, 2, 1, 7, 8, 7, 8, 2, 1, 4, 5], [8, 9, 6, 4, 9, 4, 1, 5, 4, 2, 5], [5, 7, 4, 5, 3, 2, 8, 3, 6, 2, 6], [6, 7, 8, 9, 9, 9, 8, 4, 8, 9, 3]]);

Use Maple to create the vector b that is column 2 from A and the matrix C that is made from columns 1 to 1 and 3 to 11 of A (in the same order as the columns of A.

Now solve the matrix equation

Cx=b

and enter the 4th component of the unique vector solution for x in the box below.

 

Let P(x) a polynomial with a single indeterminate.
In Maple 2015 (please, do not consider this question if Maple >=2021 doesn't present this problemcoeffs returns the coefficients P(x) in a different in some circumstances:

m := [$1..3]:

add(m[k]*(R)^(k-1), k=1..3):
c:= coeffs(%, R, 't'): [c], [t];

                              [ 2      ]
                   [3, 2, 1], [R , R, 1]
add(m[k]*(R)^(k-1), k=1..2):
c:= coeffs(%, R, 't'): [c], [t];
                        [1, 2], [1, R]

The order in the first case is R^2, R^1, R^0 while it is R^1, R^0 in the second one.

It's quite easy to check if P(x) is of the form a+b*R and to reverse the output of coeffs. But does it exist an option of coeffs which monitors the output order.

TIA

guys..i need help ...how to find the answer for this equation..for all value of in and b in (a and b)...for all combination of a and b

problem.mw

Hi,

I don't understand why my ruled surface is not displayed with this code in my animation. Maybe there is an issue with an option? All my previous animations were displayed normally. Any ideas? Thank you

G2ExamenJuin.mw

First 209 210 211 212 213 214 215 Last Page 211 of 2428