MaplePrimes Questions

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)
 

How can I get the vlaue of matric c?

Thanks for your help


restart;
with(Student[LinearAlgebra]);
a := Matrix(2, 2, [[1, 2], [3, 4]]);
                               [1  2]
                          a := [    ]
                               [3  4]
b := Matrix(2, 2, [[2, 4], [6, 2]]);
                               [2  4]
                          b := [    ]
                               [6  2]
c := multiply(a, b);
                              /[1  2]  [2  4]\
                 c := multiply|[    ], [    ]|
                              \[3  4]  [6  2]/
evalm(c);
           [        /   [2  4]\          /   [2  4]\]
           [multiply|1, [    ]|  multiply|2, [    ]|]
           [        \   [6  2]/          \   [6  2]/]
           [                                        ]
           [        /   [2  4]\          /   [2  4]\]
           [multiply|3, [    ]|  multiply|4, [    ]|]
           [        \   [6  2]/          \   [6  2]/]
 

This is my first problem with Maple but i am pretty confused as to why it would struggle with these steps.

Just using a standard worksheet, here is what i have:

> f:=(4^x)+1

>g:=x^4

> solve(g=f,x)

now, i would just expect this to come back with 3 answers, but instead i get 

Warning, solutions may have been lost
                     RootOf(-4^_Z - 1 + _Z^4)

if I do:

>fsolve(g=f,x)

It comes back with only one of the answers(2.094012853), instead of all three.

What am I doing wrong?

I mean, for example,

solve({4*x1+7*x2+6*x3 = 186, floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) = 18, 
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) = 21});
Warning, solutions may have been lost

A finite number of the solutions can be found by DirectSearch

DirectSearch:-SolveEquations([floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) = 18, 
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) = 21, 4*x1+7*x2+6*x3 = 186], 
{x1 >= -100, x2 >= -100, x3 >= -100, x1 <= 100, x2 <= 100, x3 <= 100}, 
AllSolutions, solutions = 3, number = 1000);

Matrix(3, 4, [[0., Vector[column](3, [0., 0., 0.]),
 [x1 = 74.18778903830886, x2 = 58.93905207777524, x3 = -87.22075344961036], 185], 
[0., Vector[column](3, [0., 0., 0.]),
 [x1 = 71.22714241634635, x2 = 56.43467122661542, x3 = -82.32521137528222], 164],
 [0., Vector[column](3, [0., 0., 0.]), 
[x1 = 73.6407870507502, x2 = 58.33738250527096, x3 = -86.15413762331626], 165]])

I don't see a way to obtain the MMA answer (in Maple notation)

(155/2 < x1 and x1 < 78 and 744/7-4*x1*(1/7) < x2 and x2 < 62 or 72 <= x1 and x1 <= 73 and
 102-4*x1*(1/7) < x2 and x2 < 62 or 73 < x1 and x1 <= 147/2 and 102-4*x1*(1/7) < x2 and
 x2 <= 726/7-4*x1*(1/7) or 147/2 < x1 and x1 < 74 and 60 <= x2 and x2 <= 726/7-4*x1*(1/7) or
 74 <= x1 and x1 < 75 and 726/7-4*x1*(1/7) < x2 and x2 < 62 or 153/2 < x1 and x1 < 78 and
 726/7-4*x1*(1/7) < x2 and x2 < 60 or x1 = 72 and 58 <= x2 and x2 < 60 or 72 < x1 and x1 < 74 and
 58 <= x2 and x2 <= 708/7-4*x1*(1/7) or 75 <= x1 and x1 < 76 and 102-4*x1*(1/7) < x2 and x2 < 60 or
 x1 = 74 and 442/7 < x2 and x2 < 64 or 74 < x1 and x1 < 75 and 738/7-4*x1*(1/7) < x2 and 
x2 <= 744/7-4*x1*(1/7) or 74 <= x1 and x1 < 75 and 708/7-4*x1*(1/7) < x2 and x2 <= 102-4*x1*(1/7) or 
151/2 < x1 and x1 < 76 and 708/7-4*x1*(1/7) < x2 and x2 < 58 or 157/2 < x1 and x1 < 80 and
 762/7-4*x1*(1/7) < x2 and x2 < 64 or 68 <= x1 and x1 < 137/2 and 56 <= x2 and x2 <= 666/7-4*x1*(1/7) or
 x1 = 137/2 and x2 = 56 or x1 = 70 and 56 < x2 and x2 < 58 or 70 < x1 and x1 <= 71 and 56 <= x2 and
 x2 < 58 or 71 < x1 and x1 < 72 and 56 <= x2 and x2 <= 690/7-4*x1*(1/7) or 70 <= x1 and x1 <= 281/4 and
 54 <= x2 and x2 < 55 or 281/4 < x1 and x1 < 72 and 54 <= x2 and x2 <= 666/7-4*x1*(1/7)) and
 x3 = 31-2*x1*(1/3)-7*x2*(1/6)

PS. MMA_solution.pdf MMA_solution.mw

First 774 775 776 777 778 779 780 Last Page 776 of 2428