MaplePrimes Questions

Hello

I have problem to calculate a numerical integration. I guess, I can't use integration cammands correctly or singularity is the problem.
The equation has a singularity at y=0 (exp(1E-9*I*x/y)). The limits are semi_infinite.
integration:

f1 := (-(1.671130827*10^(-21)*I)*((0.6132469529e-1-.5253537767*I)*x^3+(.2894208344-2.479398027*I)*y*x^2+(0.1107017247e-1+(-.2377238011-0.2774956673e-1*I)*y^2)*x+(-.1167302837+.9999999999*I)*y^3+(0.2912028092e-1-.2494663781*I)*y)*exp(-1.732070784*10^(-15)*x*y)*((-0.6132469529e-1-.5253537767*I)*x^3+(.3115611798+2.669068985*I)*y*x^2+(-0.1107017247e-1+(-.3699321954+0.4318229002e-1*I)*y^2)*x+(.1455017102+1.246477826*I)*y^3+(0.2512356422e-1+.2152274756*I)*y)*exp(1.732070784*10^(-15)*x*y)*exp(-2.178669712*10^(-15)*y^2-3.534838336*10^(-16)*x^2+(1.000000000*10^(-9)*I)*x/y)/x)*y:

evalf(Int(f1,y=0..infinity));



Thank you
Test4_MaplePrimes.mw

 




 

I have two list in which I need to substitute variables from on elist with variables in other list in an expression.

rootElements := [[a, Integer, c, Integer, -k*a, b], [Integer, c, a, Integer, b, -k*a], [Integer, a, b, -k*a, c, Integer], [Integer, a, Integer, c, -k*a, b]];

list1 := [[a[maximum], 0, c[maximum], 0, (-k*a)[minimum], b[minimum]], [0, c[minimum], a[maximum], 0, b[maximum], (-k*a)[maximum]], [0, a[minimum], b[maximum], (-k*a)[maximum], c[maximum], 0], [0, a[minimum], 0, c[minimum], (-k*a)[minimum], b[minimum]]]


let the term be

term :=a*c/(k*a+b);


Terms := seq(applyrule([seq(rootElements[i][j] = list1[i][j], j = 1 .. nops(list1[i]))], term), i = 1 .. nops(list1));

my outputs  are

a[maximum]*c[maximum]/(k*a[maximum]+b[minimum]),# k*a should be minimum, becuae I substituted a earlier it is failing
a[maximum]*c[minimum]/(k*a[maximum]+b[maximum]),
a[minimum]*c[maximum]/(k*a[minimum]+b[maximum]),# k*a should be maximum, becuae I substituted a earlier it is failing
a[minimum]*c[minimum]/(k*a[minimum]+b[minimum]);

is there a way to substitute larger terms first[like -k*a first] and goes to smaller variable??

 I am using applyrule since algsubs cannot do for more than one substitution.Also, I would be glad if any other alternative is provided.
thank you
 

Can any one do the addition of values (in string format) x in textarea0, y in textarea1 and get the mathcontainer result in the text box2.

Thanks

Ramakrishnan V


y := GetProperty(TextArea1,value);
Do(%TextArea2 = Do(%MathContainer0,x=%TextArea0,y=%TextArea1));

``

``

``

NULL


howTogetNumericAnswerinTextArea.mw

Download howTogetNumericAnswerinTextArea.mw

 

Has there been a option included in the plots:-setoptions3d that is equivalent to the size option found in plots:-setoptions? I can't seem to find one.  I would really like to be able to set all my 3d plots to the same size. Or am I missing something?

>>> maple = pywinauto.application.Application().start(r'C:\Program Files\Maple 2015\bin.win\maplew.exe')
C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py:1044: RuntimeWarning: Application is not loaded correctly (WaitForInputIdle failed)
  warnings.warn('Application is not loaded correctly (WaitForInputIdle failed)', RuntimeWarning)
>>> maple.Maple.PrintControlIdentifiers()
__main__:1: DeprecationWarning: Method .PrintControlIdentifiers() is deprecated, use .print_control_identifiers() instead.
Traceback (most recent call last):
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 246, in __resolve_control
    criteria)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\timings.py", line 453, in wait_until_passes
    raise err
pywinauto.timings.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\__init__.py", line 50, in wrap
    return method(*args, **kwargs)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 585, in print_control_identifiers
    this_ctrl = self.__resolve_control(self.criteria)[-1]
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 249, in __resolve_control
    raise e.original_exception
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\timings.py", line 431, in wait_until_passes
    func_val = func(*args, **kwargs)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 191, in __get_ctrl
    dialog = self.backend.generic_wrapper_class(findwindows.find_element(**criteria[0]))
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\findwindows.py", line 84, in find_element
    elements = find_elements(**kwargs)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\findwindows.py", line 303, in find_elements
    elements = findbestmatch.find_best_control_matches(best_match, wrapped_elems)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\findbestmatch.py", line 533, in find_best_control_matches
    raise MatchError(items = name_control_map.keys(), tofind = search_text)
pywinauto.findbestmatch.MatchError: Could not find 'Maple' in 'dict_keys([])'
>>> maple.Maple.print_control_identifiers()
Traceback (most recent call last):
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 246, in __resolve_control
    criteria)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\timings.py", line 453, in wait_until_passes
    raise err
pywinauto.timings.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 585, in print_control_identifiers
    this_ctrl = self.__resolve_control(self.criteria)[-1]
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 249, in __resolve_control
    raise e.original_exception
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\timings.py", line 431, in wait_until_passes
    func_val = func(*args, **kwargs)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 191, in __get_ctrl
    dialog = self.backend.generic_wrapper_class(findwindows.find_element(**criteria[0]))
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\findwindows.py", line 84, in find_element
    elements = find_elements(**kwargs)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\findwindows.py", line 303, in find_elements
    elements = findbestmatch.find_best_control_matches(best_match, wrapped_elems)
  File "C:\Users\mas\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\findbestmatch.py", line 533, in find_best_control_matches
    raise MatchError(items = name_control_map.keys(), tofind = search_text)
pywinauto.findbestmatch.MatchError: Could not find 'Maple' in 'dict_keys([])'
>>>

 

HW4.msim 

I did the base part of a robot in the MapleSim. I am trying to get the differential equation of the system, but the MapleSim gave me 2 different differential equations. When I use these differential equations, I could not reach to my goal. I think I need only one differential equation whose degree must be 2. The system works well, but the problem is a differential equation of the system. How can I get the correct differential equation? And also, why are there 2 different equations? Which one represents what? Thanks for answering.

 

Does Maple have a routine for -directly- calculating an integral over a region defined implicitly by an inequality. Suppose region R is defined by f(x,y)<c and we want to find  integral g(x,y) over R. Does Maple have a procedure for this? The required output will be a function of c.

Hey there,

 

I'm trying to build a procedure that can function as an adapted form of Prim's algorithm. The idea is that on a graph with just vertices, the procedure has a starting point, and from there will find out which vertex is the cheapest to connect to (currently expressed purely by the lowest distance). Once this is found, the connected vertex is removed from a list that has vertices that aren't connected yet, and added to a list of vertices that are in the minimal spanning tree.

My problem is that I get an error returned that says "invalid Boolean expression", and I'm not sure how to solve it. Can anybody here point me in the right direction?

The procedure is defined as follows:

Primmetje := proc (aantal, posities, begin)
local knopenover, knopeninmst, huidig, V, kaart, e, a;
knopenover := [seq(i, i = 1 .. aantal)];
knopeninmst := {};
huidig := [0, 0];
if begin <> {} then
  V := [begin];
knopeninmst := knopeninmst union {V}
end if;
remove(V, knopenover);
kaart := Graph(aantal);
SetVertexPositions(kaart, posities);
while nops(knopeninmst) < aantal
do for e in knopeninmst
   do for a in knopenover
     do if huidig = [0, 0] or Distance(posities[e], posities[a]) < Distance(posities[huidig[1]], posities[huidig[2]]) then
   huidig := [e, a];
knopeninmst := knopeninmst union {a};
remove(a, knopenover);
AddEdge(kaart, huidig)
end if
end do
end do
end do
end proc

When I try to execute it with some parameters the return is this:

vp := [2.5, 21], [6, 13.5], [8, 10], [11, 24.5], [14.3, 19.4], [16.8, 26], [22, 21.5], [22, 17], [22.2, 12.5], [26.8, 23], [28, 20.5], [30, 25.5], [32, 21], [29.5, 16];
Primmetje(14, vp, 1);
Error, (in Primmetje) invalid boolean expression: [[6, 13.5]]

I think it has something to do with the double brackes, but I'm not sure how to solve it.
 

restart;
M := -6*alpha*eta^2*mu*(lambda^2*mu+1)/`&vartheta;`+12*alpha*eta^2*lambda*mu^(3/2)*(sqrt(mu)*cot(A+sqrt(mu)*eta*(-t*(-alpha*eta^2*mu+f)+x))*lambda+1)/(`&vartheta;`*cot(A+sqrt(mu)*eta*(-t*(-alpha*eta^2*mu+f)+x)))-6*alpha*eta^2*mu*(sqrt(mu)*cot(A+sqrt(mu)*eta*(-t*(-alpha*eta^2*mu+f)+x))*lambda+1)^2/(`&vartheta;`*cot(A+sqrt(mu)*eta*(-t*(-alpha*eta^2*mu+f)+x))^2)+6*mu*eta^2*alpha*sqrt(sigma*(1+cot(A+sqrt(mu)*eta*(-t*(-alpha*eta^2*mu+f)+x))^2))/(sqrt(sigma)*theta*cot(A+sqrt(mu)*eta*(-t*(-alpha*eta^2*mu+f)+x))^2);
             2    /      2       \   
  6 alpha eta  mu \lambda  mu + 1/   
- -------------------------------- + 
             &vartheta;              

                                1                               
  ------------------------------------------------------------- 
                /      (1/2)     /   /          2       \    \\ 
  &vartheta; cot\A + mu      eta \-t \-alpha eta  mu + f/ + x// 

  /            2          (3/2) /  (1/2)    / 
  \12 alpha eta  lambda mu      \mu      cot\A

       (1/2)     /   /          2       \    \\           \\   
   + mu      eta \-t \-alpha eta  mu + f/ + x// lambda + 1// - 

                                1                                
  -------------------------------------------------------------- 
                                                               2 
                /      (1/2)     /   /          2       \    \\  
  &vartheta; cot\A + mu      eta \-t \-alpha eta  mu + f/ + x//  

  /           2    /  (1/2)    / 
  \6 alpha eta  mu \mu      cot\A

       (1/2)     /   /          2       \    \\           \  \   
   + mu      eta \-t \-alpha eta  mu + f/ + x// lambda + 1/^2/ + 

  /                /      / 
  |        2       |      | 
  \6 mu eta  alpha \sigma \1

                                                       2\\      \/
        /      (1/2)     /   /          2       \    \\ ||      | 
   + cot\A + mu      eta \-t \-alpha eta  mu + f/ + x// //^(1/2)/ 

  /                 
  |     (1/2)       
  \sigma      theta 

                                                    2\
     /      (1/2)     /   /          2       \    \\ |
  cot\A + mu      eta \-t \-alpha eta  mu + f/ + x// /
alpha := 2;
                               2
eta := 3;
                               3
mu := 1.5;
                              1.5
lambda := 2;
                               2
theta := 3;
                               3
sigma := .5;
                              0.5
b := .5;
                              0.5
f := 5;
                               5
y := 0;
                               0
plot3d([abs(M)], x = -3 .. 3, t = -3 .. 3);
 

How I can extract data about figure as matrix format.

I want to save data from figure as matrix for each curve in figure as i.e.,  x and y .

for example as this format.

fig10.mw

sol := Vector[column](4, [` 1001 x 4 `*Matrix, `Data Type: `*anything, `Storage: `*rectangular, `Order: `*Fortran_order])

 

hi everyone,

I am trying to find maxima for a multi variable function. As a first step I want to find out partial differentiation and equate each expression to zero.
 

Normally I would expect to solve these equations to get the variable value(s). But I came across a perticular function which cannot be solved as above explained.

Expression :=30*a*sin(theta)+80*cos(theta)*b
variable :=  {a, b, theta} # using indets(Expression,name)

PartialDifferentiationExpressions :={80*cos(theta), 30*sin(theta), 30*a*cos(theta)-80*sin(theta)*b}

 

How can I find the critical Points from these?

My approach is to find Hessian Matrix and ten find out maxima for the function(at which critical point it happens)

 

Note Edit: This is an example. I am writing a script which takes an equation as Input and solve for the maxima. Hence, I would like to know how to when this kind of situation arises. Thank You

Hi

How can i solve this system of equations:
{c*(N-k)*(1-exp(-p)) = p, -d*((k-N)*exp(-p)-k) = N, 0 < N, 0 < p, 1 < c, 1 < d, 1 < k}

N and P are variables and the others are constant numbers.

I used "solve" function but the results are:
piecewise(And(1 < c, 1 < d, 1 < k, 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)*d/((d-1)*c), 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)), [{N = d*k*(exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1), p = c*k*(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-d-exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))+1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)}], [])

piecewise(And(1 < c, 1 < d, 1 < k, 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)*d/((d-1)*c), 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)), [{N = d*k*(exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1), p = c*k*(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-d-exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))+1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)}], [])

 

 

 

Is it possible to export data from Maple to Excel where data are generated by Maple using Optimization:-LSSolve or DirectSearch:-SolveEquations function?

I have attached a file, where n is the primary variable. For n=1, 2, 3, .......... 20, I have got solution individually. But it is more time consuming event. Is it possible to use array or a vector for the variable n and solve equations at a time for all value of n and stored a excel file?
Any advice for me? @Preben Alsholm , @tomleslie or anybody
system_equations_(10.12.2008).mw
 

I've made calculation as array := function(array1,array2). Then summ of all array[i] all in one cycle. If I look in summ variable I see fu(0+fu() +.. agebraical representation. I tried evalf(summ). still algebraical. How to derive numerically?

I want to calculate the following summation for a,b;

 

when it is odd, 

vanishes.

MY TRY:

restart:
J:=proc(a,b,c) local u,v,p,w;
p:=(a+b+c):
if p=2*k then
u:=b+c-a: 
v:=c+a-b: 
w:=a+b-c:
return (-1)^p*sqrt(binomial(2*u,u)*binomial(2*v,v)*binomial(2*w,w)/((2*p+1)*binomial(2*p,p)))
else 
return 0
end if
end proc:
aa:=2:bb:=4:
sum(J(aa,bb,cc)*J(aa,bb,cc)*sqrt(2*(2*aa+1)*(2*bb+1)*(2*cc+1))*psi[1,cc],cc=abs(bb-aa)..(aa+bb));

 

First 740 741 742 743 744 745 746 Last Page 742 of 2426