MaplePrimes Questions

Is there already a build in sum(), add() procedure where you can supply a condition?

I know the help doesn't say anything about it, but I thought maybe there is something else.

Say I want to add the coefficients a(n) up to N, but only if n divides N, so

add(a(n),n=1..N,conditioner: mod(N,n)=0)

Thanks

how can I get the first function acting on the symbolic expression as below(in this case log)

expr :=sin(abs(log(a+b*c)));


I need to solve for many unknown expressions. It would be great if I can able to get all functions in sequential order acting.

I got to know using op i can solve if only one function is action like below

expr := sin(a+b*c)
then op(0,expr) #gives sin

op(1,expr) # gives a+b*c


I have the following Maple code.

 

x := [5, 10, 15, 20];

y := [4.22, 7.49, 12.24, 19.60];  

yui := [2.48, 3.76, 6.11, 14.60];

yli := [2.27, 3.34, 6.09, 10.90];

 

with(Statistics): with(plots):

p1 := ErrorPlot(y, coords = x, yerrors = yui);

this produces a plot with error bars. The problem is that I acutally have unequal errors. In the ErrorPlot helpfile it says:

"This options specifies errors along the x-axis. The array of errors must have the same number of elements. To specify right errors and left errors separately, use the list of two vectors." (this pertains to xerrors obviously but below it says the same applies to yerrors)

I have tried entering the code above with yerrors=[yli,yui] and with yerrors={yli,yui}....but neither option works and I get the error:

"Error, invalid input: Statistics:-ErrorPlot expects value for keyword parameter yerrors to be of type {identical(default), [{array, list, rtable, DataFrame, DataSeries}, {array, list, rtable, DataFrame, DataSeries}], {array, list, rtable, DataFrame, DataSeries}}, but received {[2.27, 3.34, 6.09, 10.90], [2.48, 3.76, 6.11, 14.60]}"

Can anyone advise me on what I'm doing wrong - I am very new to Maple.

Jo

 

Dear all, I am having difficuty in executing the following program. the error message reads "Error, unable to compute coeff". Secondly the solution and the graph of the equation could not display.Attached is the prime_question.mw
 

 

Download prime_question.mw
 

restart; with(student)

n := 2;

2

(1)

v := sum(u[i]*p^i, i = 0 .. 2);

p^2*u[2]+p*u[1]+u[0]

(2)

f := proc (x) options operator, arrow; e^x+(1/2)*x*(e^(2*x)-1) end proc;

proc (x) options operator, arrow; e^x+(1/2)*x*(e^(2*x)-1) end proc

(3)

k := proc (x, t) options operator, arrow; x end proc;

proc (x, t) options operator, arrow; x end proc

(4)

F := proc (u) options operator, arrow; u(x)^2 end proc;

proc (u) options operator, arrow; u(x)^2 end proc

(5)

u[0] := f(t);

e^t+(1/2)*t*(e^(2*t)-1)

(6)

for i to 2 do u[i] := expand(subs(x = t, int(coeff(p*k(x, t)*F(v), p^i), t = 0 .. x))) end do

Error, unable to compute coeff

 

s := value(sum(Eu[k], k = 0 .. 2*e));

sum(Eu[k], k = 0 .. 2*e)

(7)

U := proc (x) options operator, arrow; collect(s, x) end proc;

proc (x) options operator, arrow; collect(s, x) end proc

(8)

with*plots:

p1 := plot*(exact*solution, t = 0 .. T, style = point):

p2 := plot*(U(t), t = 0 .. T, style = line):

plots*([display])(p1, p2);

plots*[display(plot*(exact*solution, t = 0 .. T, style = point), plot*(sum(Eu[k], k = 0 .. 2*e), t = 0 .. T, style = line))]

(9)

``

``


 

Download prime_question.mw

 

 

file

I am using DirectSearch package for optimization. I am using GlobalOptima function. I want to see the settings and results such as initial points, number of iterations, residuals etc. I tried using infolevel[Directsearch] but couldn't see any results. Let me know if there is any other command to get this information.

I want to ask you, Is there any inequality for |cosh(x)|? I have read that cosh(x)<= e^(x^(2)/2).

Hello here is a description of my issue:

1. I created a new code edit region

2. i put some code in the code edit region 

3. In the context Panel I unchecked the 'visible' setting for the code edit box

When I evaluate the worksheet the code in the code edit region still runs, but I can't figure out how to edit the code in that region. There is not an icon to open the code edit region as there would be had I toggled the 'expand' setting. Furthermore, I can't select the invisible code edit region in order to toggle the 'visible setting'.

How can I make the code edit region visible again?

 

Thanks for you help

This is my original question, but I can't ask, so I put it here.

I have a system of pde, and it's hard to solve.

But I want to find the type of solutions which are polynomials of degree n of the several independent variables.

Is it possible using 'pdsolve'? Or there are some other commands in Maple to do that?

Thanks!

Sorry, I comment not for answering question.

I want to ask a question, but I can't enter any 'Tags', but they need at least one tag.

There is not any text box where I can enter a tag.

Who can help me?

thanks!

I computed A and B matrices, now I want to write it in state space reperentation.

diff(x(t), t) = A*x(t)+B*u

where

diff(x(t), t) = (Vector(6, {(1) = diff(alpha(t), t), (2) = diff(alpha(t), t, t), (3) = diff(y(t), t), (4) = diff(y(t), t, t), (5) = diff(theta(t), t), (6) = diff(theta(t), t, t)}))

So I calculated A*x(t)+B*u and got this:

(Vector(6, {(1) = diff(alpha(t), t), (2) = diff(alpha(t), t, t), (3) = diff(y(t), t), (4) = diff(y(t), t, t), (5) = diff(theta(t), t), (6) = diff(theta(t), t, t)})) = (Vector(6, {(1) = 0, (2) = k/(J*R), (3) = 0, (4) = k/(M*R*r), (5) = 0, (6) = -k/(M*R*r*l)})).e+(Vector(6, {(1) = diff(alpha(t), t), (2) = -k^2*(diff(alpha(t), t))/(J*R), (3) = diff(y(t), t), (4) = -k^2*(diff(y(t), t))/(M*R*r^2)-m*g*theta(t)/M, (5) = diff(theta(t), t), (6) = k^2*(diff(y(t), t))/(M*R*r^2*l)+(M+m)*g*theta(t)/(M*l)}))

where u=e but the formation is not A*x(t)+B*u anymore. How can I enforce Maple to output the result in the form of A*x(t)+B*u?

I have been trying to solve this equation by obtaining solutions for x and I actually handed in for an assignment what Maple gave me as an output. Then it turns out that Maple was wrong. This is in fact not a solution for the equation. What am I doing wrong here?
Solve_error.mw

For any symbolic expression like

y = s + (a/b)*log((a+c/b)); 

I want to extract all possible sub-expressions which have one operator operating on exact two operands.
    

subExpression1 = a/b; # any operatoin(+,-,*,/ involving exact two variables)
subExpression2 = c/b;

 

Note: I need an sub-expression which is part of main expression. Above expression is an example. I have quite complex expressions where I need to extract these sub-expressions.  I need to scan my expression at all operators and see on what operands its working on
 

a+c/b # here + is acting on a and c/b clearly it is out of my interest

With Maple 18.02 and 2017.2 on OSX 10.13.6: 

restart: 
int( exp(a*exp(I*x)) ,x=-Pi..Pi); 
                               0 

but we get the correct answer for numerical a, e.g. 

restart: 
int( exp(1*exp(I*x)) ,x=-Pi..Pi); 
                              2 Pi 

Is this fixed in version 2018.1? 
 

‏‏‏‏I want to solve partial differential equation by adomian decomposition method, I have a mistake  in define the nonlinear term, then  the calculations of integral does not display , can anyone help me please

‏‏ADM_1.mw


 

restart

" S3:=proc(psi) [[[cos(psi),-sin(psi),0],[sin(psi),cos(psi),0],[0,0,1]]]:  end  proc ;   S1:=proc(`&varphi;`)  [[[1,0,0],[0,cos(`&varphi;`),-sin(`&varphi;`)],[0,sin(`&varphi;`),cos(`&varphi;`)]]]:   end proc;"

proc (psi) Matrix(3, 3, {(1, 1) = cos(psi), (1, 2) = -sin(psi), (1, 3) = 0, (2, 1) = sin(psi), (2, 2) = cos(psi), (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}) end proc

 

proc (`&varphi;`) Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = cos(psi), (2, 3) = -sin(psi), (3, 1) = 0, (3, 2) = sin(psi), (3, 3) = cos(psi)}) end proc

(1)

``

S3(uu)

Matrix([[cos(uu), -sin(uu), 0], [sin(uu), cos(uu), 0], [0, 0, 1]])

(2)

S1(uu)

Matrix([[1, 0, 0], [0, cos(psi), -sin(psi)], [0, sin(psi), cos(psi)]])

(3)

``


 

Download test3.mw

Way i get the wrong output with procedure S1(uu)
 

First 773 774 775 776 777 778 779 Last Page 775 of 2427