MaplePrimes Questions

Hello every one,

 

I am trying to solve a backward induction problem (game theoretic problem) in maple. Lets say we have S rounds. I start from bottom (S-th round) and solve a parametric equation. Then I put the solution in the upper level (S-1). Then, update the functions at level and solve the equation pertatining to this level (S-1). Again, I put the solution ofround S-1 into the equations of S-2 and update the equations and parametrically solve the equation belonging to level S-2 . This process repeats till the first level.

 

The issue is that the solution gradually becomes larger and larger. I guess that's why Maple is not able to solve it. 

 

Have any of you guys faced to a similar problem. Any suggestion?

 

I was thinking of asking maple to reduce its precision in computations. I mean there may not be necessary to store a number with 100 digits precision! However, I don't know how to do that (I don't know the command). Any suggestion?

 

Thank you in advance.

 

Ahmadreza

I've got

f(x,y)= a.exp(1+xy) +( a^2 )*sin(x)+1

for which I've shown that there exists an implicit function x=g(y). ( df/dx <>0)

and df/dx = a*exp(1+xy) +( a^2 )*cosx now in the neighborhood of P=(0,0) for the implicit function to exist I'd need a*exp(1+xy)*y <>0 but at P, wouldn't this be 0?

Given, g(y)=x, how do I find the max,min,saddle points?

Hello

1)I need some guides to solve my problem. I have attached my file. Could you please help me to understand what's wrong in my code?

2) Is there any option to pause "Loops" and watching results, something like break point.

THank you.

 

 

restart

 

with(ImageTools):``

with(FileTools):````

Input Section

 

NULL

filelocation := "C:\\Users\\Mohammad\\Desktop\\1.jpg":

k := 1:NULL

 

zimage := Read(filelocation):

zwidth := Width(zimage):NULL

kernel__length := VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1):````

kernel__data := `~`[`*`](Matrix(1 .. kernel__length, 1 .. kernel__length, 1), 1/kernel__length^2):

imheight := Height(zimage):``

imwidth := Width(zimage):NULLNULL

Width(zimage, lower):

Width(zimage, upper):

View(zimage):``

new1zpic := Convolution(zimage, kernel__data):

View(new1zpic)``NULL

new2zpic := zimage:

dummy := 0:

"for i from (k+1)  to (Width(zimage,upper)-k) do     for j from (k+1)  to (Height(zimage,upper)-k) do           for m from 1 to kernel[length]  do               for n from 1 to kernel[length]  do                         dummy:=dummy+kernel[data] (m, n)*new2zpic(i+m-2, j+n-2)                                         end do;              end do;                      new2zpic(i,j):=dummy:                   dummy:=0:   end do; end do;"

Error, final value in for loop must be numeric or character

 

 

 

 

NULL

 

Download Exercise_II-1.0.mw

restart

 

with(ImageTools):``

with(FileTools):````

Input Section

 

NULL

filelocation := "C:\\Users\\Mohammad\\Desktop\\1.jpg":

k := 1:NULL

 

zimage := Read(filelocation):

zwidth := Width(zimage):NULL

kernel__length := VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1):````

kernel__data := `~`[`*`](Matrix(1 .. kernel__length, 1 .. kernel__length, 1), 1/kernel__length^2):

imheight := Height(zimage):``

imwidth := Width(zimage):NULLNULL

Width(zimage, lower):

Width(zimage, upper):

View(zimage):``

new1zpic := Convolution(zimage, kernel__data):

View(new1zpic)``NULL

new2zpic := zimage:

dummy := 0:

"for i from (k+1)  to (Width(zimage,upper)-k) do     for j from (k+1)  to (Height(zimage,upper)-k) do           for m from 1 to kernel[length]  do               for n from 1 to kernel[length]  do                         dummy:=dummy+kernel[data] (m, n)*new2zpic(i+m-2, j+n-2)                                         end do;              end do;                      new2zpic(i,j):=dummy:                   dummy:=0:   end do; end do;"

Error, final value in for loop must be numeric or character

 

 

 

 

NULL

 

Download Exercise_II-1.0.mw

Hi! I'm having trouble with the MapleSim "Equation Extraction" template. I have an extremely simple dynamics scenario with RigidBody at a particular position in a world; when the simulation starts, the body should simply start fallin with a constant acceleration, and I'm looking to extract kinematic equations for this situation.

However, the problem I have with the extracted equations is that they contain some rotational dependent terms that I wish to avoid - a lot of sines and cosines with arguments that I actually cannot match up to any variables in the model, or when I enable quaternion representation, terms like this:

What I don't understand is what exactly these rotation terms represent. The object should be falling straight downwards, and gravitation should be applied straight downwards, and when I start the simulation it does run through, also indicating that there should be no unbound variables. I'm not sure exactly what parameters in the Modelica model do they correspond to? I did not find any such angles in the object settings. And can I ask MapleSim to generate equations without these unbound rotation variables?

Hello,

I'm a bit lost, cause I Have to programm the "Schema A" from Wu/Sun with Maple. It's about Rebalanced-CRT-RSA, and therefore a key generation algorithm.

Unfortunately I havn't worked with Maple (or similar programms) yet. So if somebody will help me, that would be really kind :)

Here's the Algorithm (Source: Wu/Sun, Design of Rebalanced RSA-CRT for fast Encryption):

Step 1. Randomly select an odd number e of 568 bits.

Step 2. Randomly select a number kp1 of 160 bits, such that gcd(kp1, e) = 1.

Step 3. Based on Theorem 4.1, we can uniquely determine two numbers dp, k_{p1} < dp < 2k_{p1},
and P , e < P < 2e, satisfying ed_p = k_{p1}P + 1.
Step 4. Factor P as P = k_{p2} · p_0 such that k_{p2} is a number of 56 bits and p (= p_0 +1) is a prime
number. If this is infeasible, then go to Step 2.
Step 5. Randomly select a number k_{q1} of 160 bits, such that gcd(k_{q1}, e) = 1.
Step 6. Based on Theorem 4.1, we can uniquely determine two numbers dq, k_{q1} < d_q < 2k_{q1},
and Q, e < Q < 2e, satisfying ed_q = k_{q1}Q + 1.
Step 7. Factor Q as Q = k_{q2} · q_0 such that k_{q2} is a number of 56 bits and q (= q_0 +1) is a prime
number. If this is infeasible, then go to Step 5.
Step 8. The public key is (N, e); the secret key is (d_p, d_q, p, q).

Thank you for any help!

 

Edit2: I'm a fool, the integers arent of the right form, so they're not 568-bit/160-bitform :/

Edit:

I continued tryin, and I think i got at least Step 1-3:

Step 1+2: 


restart; 
with(RandomTools); 
BeidesGCD := proc () 
local a, b, A, B, C; 
global e, kp1; B := proc () 
b := Generate(nonnegint(range = 2^568)) 
end proc; 
while length(b) <> 171 do B() end do; 
while type(b, odd) = false do B() end do; 
A := proc () 
a := Generate(nonnegint(range = 2^160)) 
end proc; 
while length(a) <> 49 do A() end do; 
while gcd(a, b) <> 1 do A() end do; 
e := b; print(b); 
kp1 := a; 
print(a); 
gcd(e, kp1) 
end proc 

and the numbers needed for Step 3:

x := 1/e mod kp1; 
y := (e*x-1)/kp1; 

dp := x+kp1; 
P := y+e; 

 

But the next step causes problems, is it even possible to tell Maple "sth is infeasible"?

f:=sin((x-1)*(y+3))/(exp((x-1)^2+(y+3)^2)-1);
limit(f,{x=1,y=-3});


On running the above code, I don't get a result. I don't understand why, and what are some of the underlying math principles that I would have to use to evaluate the limit of f at (1,-3) if I were to solve this question on paper?

I need to find where the limit of the function:

{1-cos(x*y^3)}/(x^2+y^6)^(1+a) exists/does not exists for different values of a, given 0<=a<=1 and as (x,y)->(0,0).

I've tried writing a procedure that changes a in particular increments but that is clearly not the most efficient way. Are there any rules of limits that I should be using?

 

I've got a set

E:={(x,y,z): x^2+y^2=-2*z-x, z^2+y^2=1} and need to find points of E which have minimal or maximal distance from (0,0,0). I've set up the Lagrangian as F:=sqrt(x^2+y^2+z^2) + L1(x^2+y^2+2z+x)+L2(z^2+y^2-1)

and consequently obtained the equations:

x/sqrt(x^2+y^2+z^2) + 2*x*L1+L1=0

y/sqrt(x^2+y^2+z^2) + 2*y*L1+2*y*L2=0

z/sqrt(x^2+y^2+z^2)+2*L1+2*L2*z=0

for which I've set up
eqn1,eqn2,eqn3 as the three equations and vars:=x,y,z

and used solve() but I'm not getting the right answer( I need to first express x,y,z in terms of L1, L2 and then get values for L1 and L2 by substituting in the constraints and eventually get values of x,y,z.)

How should I implement that?

For example, given a 3d point p(x,y,z), with (x,y,z) as its coordinates. Then it is transformed by rotation and translation, as 

p'=R(p)*p+t(p), where R(p) is a 3x3 rotation matrix that is a matrix of functions of p, and t(p) is a 3x1 vector function of p. 

My question is how to derive dp'/d(as a 3x3 matrix) using maple? 

To make it clear,I want to do it in a way that dp'/dp = ∂p'/∂p + ∂p'/∂R*∂R/∂p +  ∂p'/∂t*∂t/∂p

And I'd like to know each intermediate quantity, such as p'/∂R, R/∂p.


Anyone can help?

Thanks a lot. 

What Maple15 commands will display a Rouleaux tetrahedron or a Meissner tetrahedron?

Hi all,

I'm having a challenge solving an integration that has some error functions associated with it.

Description:

I am trying to find the Riemann midpoint of the integral. All the parameters are known except the u and du terms which came into the expression following a laplace transform.

the output I get from the above input is shown below, and as it can be seen, the u and du terms coupled with a complimentary error function still exist. I have tried the "simplify" function and it returns similar output expression.

 

Any help will really be appreciated.

Thanks :)

 

 

 


plot(x^2, x = -2 .. 2)

Error, (in plot) incorrect first argument x^2

 

plot(2);

 

solve(x-1 = 0, x)

Error, (in coulditbe) invalid input: `coulditbe/internal` uses a 1st argument, obj, which is missing

 

``


Download Maple_Worksheet.mw

Hi,

I'm using Maple 18 and none of my worksheets that I've developed on earlier versions work on it. I tried starting a new worksheet with a very simple command (attached) and even that's giving me problems. As you can see, I have no trouble plotting constant functions, but as soon as I put in a variable it breaks down. It won't solve equations either.

FYI I'm using an HP G72 laptop with Windows 7 and no installation issues came up.

Can anyone tell me what's going on here?

Thanks,

Tom

Hi all,

I'm trying to use logplot but it's very time consuming. Any suggestion please!

Cheers!

restart:with(plots):

S1:=x+x^2*Sum(t^(k*alpha+1)/GAMMA(k*alpha+2),k=0..infinity);

S2:=x+x^2*Sum(t^(k*alpha+1)/GAMMA(k*alpha+2),k=0..n);

alpha:=0.75:x:=0.5:n:=10:

logplot(abs(S1-S2),t=0..1);

 

 

So here is the issue: I have a 50 by 50 tridiagonal matrix. The entries in the first row, first column are -i*x and the last row last column is -i*x; these are along the main diagonal, where i is complex and x is a variable. Everything in between these two entries is 0. Above and below the main diagonal the entries are -1. My issue is that I have to find a conditon on x that makes the eigenvalues real. I am completely new to maple and have no programming experience.. Can someone show me how to this?

Using Maple 18, I solved for minimum and maximum price. Instead of using fsolve I wanna use procedure programming structure in order to get the same results. How can I do it?

min_sol := fsolve([bc_cond, slope_cond, x[G, 1] = w[aggr, 1]], {p = 0 .. 1, x[G, 1] = 0 .. w[aggr, 1], x[G, 2] = 0 .. w[aggr, 2]}); p_min := subs(min_sol, p); max_sol := fsolve([bc_cond, slope_cond, x[G, 2] = w[aggr, 2]], {p = 0 .. 1, x[G, 1] = 0 .. w[aggr, 1], x[G, 2] = 0 .. w[aggr, 2]}); p_max := subs(max_sol, p);
{p = 0.3857139820, x[G, 1] = 127.8000000, x[G, 2] = 38.99045418}
0.3857139820
{p = 0.8841007104, x[G, 1] = 44.30160890, x[G, 2] = 164.2000000}
0.8841007104

First 1311 1312 1313 1314 1315 1316 1317 Last Page 1313 of 2434