MaplePrimes Questions

I am trying to understand the use of "events" in solving ode's, specifically the possible actions.
From the help pages:

Events are specified by the events=[event1,event2,...] option in the call to dsolve[numeric], where each event is a list of [trigger,action] pairs, where the trigger describes the trigger of the event, and the action describes the action to perform when the event is triggered.

It then goes on to list possible actions, for example,

u(t) = -u(t): execute statement when triggered
– [u(t) = -u(t), y(t) = -y(t)]: execute statements when triggered
[If(y(t) < 0, y(t) = -y(t), halt)]: execute statements conditionally when triggered

I tried to use the first one unsuccessfully several ways:
This works:dsolve({eq, y(0) = 1, (D(y))(0) = -1}, numeric, events = [[x+y(x) = 15, halt]])

but dsolve({eq, y(0) = 1, (D(y))(0) = -1}, numeric, events = [[y(x) = 0,[ 'print("Yes'")', halt]]]) does not

nor does any variant of that using print.

Also, I cannot get at the result of any assingment, e.g.,

dsolve({eq, y(0) = 1, (D(y))(0) = -1}, numeric, events = [[y(x) = 0, [z = diff(y(x), x), halt]]]) does not work either; z does not have a value. What commands can be executed as actions after an event is triggered?

 

 

 

 

I experience an issued with a 3d plot. This is my code and I get: "Warning, expecting only range variables [H[s], H[j]] in expression eq to be plotted but found name eq." as a return from Maple.

restart;

eq = c[1]-abs(H[s])^2*sigma^2/abs(H[j])^2;

c[1] := 2;

c[2] := 4;

sigma := 1;

tmp := plot3d(eq, H[s] = .1 .. 2, H[j] = 0 .. 5, view = 0 .. 8,

axes = boxed, labels = [H[s], H[j], P[j]],

filled = [style = surface, transparency = .2]); plots:-display(tmp, view = 0.1e-1 .. 8)

I have two square matrices (LS,RS) in the form of generalized eigen-value problem as below:

LS*z=omega*RS*z

One time, I am using inverse of RS multiplying by LS to get the eigen values as
MS := MatrixInverse(RS) . LS:
VL1, VR1 := Eigenvectors(MS):

Next time, I am using direct method as below to get the eigen values 

VL2, VR2 := Eigenvectors(LS, RS);
 

I am wondering there are meaningful differences between VL1 and VL2 as well as VR1 and VR2.

Does anybody know why?

RS.mw

LS.mw

 

 

 

there is a problem with users tab and web page of mapleprimes, and it just does display the first page and not other pages ...
for example :
https://www.mapleprimes.com/users/?page=2
is not displayed ...

i have started using maple toolbox on MATLAB and i have alot of questions...
first of all, why there is not a good document for using maple toolbox on matlab ? how commands should be use and so on?
MY FIRST QUESTION : can we increase number of digits for using solve or fsolve command in maple toolbox on matlab?
MY SECOND QUESTION : when using maple toolbox, the output is displayed just like when using 'pretty print' command, can we deactivate this option ?
for example, i used fsolve , and want output and the calculations be done using 50 Digits, but it does not ! :(

The object in the above display consists of a thin red disk and attached thin blue disk. They have radii 1.0 and 0.2 and masses 1.0 and 0.2 respectively.

Starting from rest at the above position they are given an initial angular velocity of Omega radians/second which starts the object rolling along the positive x axis.

If Omega is great enough that, at some time during the roll, the vertical component of the centrifugal force on the blue disk exceeds the downward force of gravity on the object, will the object begin a spinning projectile motion above the x axis?

Assuming both disks have negligible thickness, what Physics laws will govern the rolling and (possible) spinning projectile motions and what mathematics describes these motions? 

I have a big vector (1*10000) composed of negative, positive and HFloat(infinity) elements. How to extract only positive elements of this messy big vector with corresponding number of element,except positive infinities?

For example, suppose only the 111,181, 206th elemenst of this vector are positive values as: 101.2109e11,19211.129,87211.

How to get both 111,181, 206 and their corresponding values, 101.2109e11,19211.129,87211?

Dear Maple users,

I am solving a system of linear equations Ax=b where A is a matrix (243*241) which contains a rational polynomial of unknown "kappa" along with floating numbers. As suggested in some other posts I am using Linear algebra package with the LinearSolve command and option "solve" to find out unknown vector x. b is a vector having entries zero and 1. The system is such that two equations are redundant but it is difficult to recognise which two are redundant and hence for the time being I am keeping them in the matrix. (For a known value of kappa (say kappa=2) I have checked that two equations are redundant.) For the reference, the matrix and the right-hand vector b is attached as text.

There are two issues

1) Maple takes very long time (12 hours and so) to get x=b\A;

2) The result is a long expression i.e.  x[i] is a rational polynomial in kappa; a very long rational polynomial which I am importing as a text. I am not sure if maple exports all terms in the polynomial as for the different value of kappa I see Ax-b >0. 

How can I overcome this problem? Any help will be greatly appreciated. 

for example, a__b+b__a+a__b^2,how i can choose the first and third.

I posted a similar question about typesetting:-delayDotProduct. I used two different methods to solve the same vector calculus problem and came up with two seperate problems, though both are using the with(Physics[Vectors]) package. Below is my code showing the error.

Thanks for any help you all can give on this.

Cheers,

Dave
 

``

Problem 3-1

 

basis issue

 

restart; with(Physics[Vectors]): Setup(mathematicalnotation=true);
Coordinates(cartesian); Coordinates(X = [x,y,z,t])

[mathematicalnotation = true]

 

Coordinates(cartesian)

 

Coordinates(X = [x, y, z, t])

(1.1.1)

D1:=D1_(t,x,y,z);
B:=B_(t,x,y,z);
E:=E_(t,x,y,z);
j__p:=j__p_(t,x,y,z);

D1_(t, x, y, z)

 

B_(t, x, y, z)

 

E_(t, x, y, z)

 

j__p_(t, x, y, z)

(1.1.2)

f1:=epsilon=epsilon__0+rho/(B_.B_);

epsilon = epsilon__0+rho/Physics:-Vectors:-Norm(B_)^2

(1.1.3)

f2:=Nabla.D1=0;
f3:=Nabla.(epsilon*E)=0;

Physics:-Vectors:-Divergence(D1_(t, x, y, z)) = 0

 

epsilon*Physics:-Vectors:-Divergence(E_(t, x, y, z)) = 0

(1.1.4)

poisson equation and assume sigma is sigma__p

f4:=epsilon__0*(Nabla.E)=sigma__p(t);

epsilon__0*Physics:-Vectors:-Divergence(E_(t, x, y, z)) = sigma__p(t)

(1.1.5)

f5:=diff(sigma__p(t),t)+Nabla.j__p=0;
f6:=j__p=n*e(v__i_p-v__e_p);
f7:=j__p=n/(B_.B_)*(m__i+m__e)*diff(E,t);
f8:=j__p=rho/(B.B)*diff(E,t);

diff(sigma__p(t), t)+Physics:-Vectors:-Divergence(j__p_(t, x, y, z)) = 0

 

j__p_(t, x, y, z) = n*e(v__i_p-v__e_p)

 

j__p_(t, x, y, z) = n*(m__i+m__e)*(diff(E_(t, x, y, z), t))/Physics:-Vectors:-Norm(B_)^2

 

j__p_(t, x, y, z) = rho*(diff(E_(t, x, y, z), t))/Physics:-Vectors:-Norm(B_(t, x, y, z))^2

(1.1.6)

f9:=diff(f2,t);
f10:=diff(f3,t);
f11:=diff(f4,t);

Physics:-Vectors:-Divergence(diff(D1_(t, x, y, z), t)) = 0

 

epsilon*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t)) = 0

 

epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t)) = diff(sigma__p(t), t)

(1.1.7)

f12:=isolate(f11,diff(sigma__p(t),t));
f13:=subs(f12,f5);
f14:=subs(f8,f13);
f15:=isolate(f14,Nabla.diff(E_(t,x,y,z),t));

diff(sigma__p(t), t) = epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t))

 

epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t))+Physics:-Vectors:-Divergence(j__p_(t, x, y, z)) = 0

 

epsilon__0*Physics:-Vectors:-Divergence(diff(E_(t, x, y, z), t))+Physics:-Vectors:-Divergence(rho*(diff(E_(t, x, y, z), t))/Physics:-Vectors:-Norm(B_(t, x, y, z))^2) = 0

 

Error, (in Physics:-Vectors:-+) vectors projected over different basis

 

 

NULL


 

Download Different_basis.mw

I ran into this problem when trying to do some symbolic vector calculus using the with(Physics[Vectors]) package. I have uploaded my document (at least I hope it uploads correctly). I use 1-D math input because I learned maple 13 years ago.

Thanks for any help you all can provide.

Cheers,

Dave
 

``

Problem 3-1

 

typsetting issue

 

restart; with(Physics[Vectors]): Setup(mathematicalnotation=true);
#Coordinates(cartesian); Coordinates(X = [x,y,z,t])

[mathematicalnotation = true]

(1.1.1)

D1:=D1_(t,x,y,z);
B:=B_(t,x,y,z);
E:=E_(t,x,y,z);
j__p:=j__p_(t,x,y,z);

D1_(t, x, y, z)

 

B_(t, x, y, z)

 

E_(t, x, y, z)

 

j__p_(t, x, y, z)

(1.1.2)

f1:=epsilon=epsilon__0+rho/(B_.B_);

epsilon = epsilon__0+rho/Physics:-Vectors:-Norm(B_)^2

(1.1.3)

f2:=%Divergence(D1_)=0;
f3:=%Divergence(epsilon*E_)=0;

%Divergence(D1_) = 0

 

%Divergence(epsilon*E_) = 0

(1.1.4)

poisson equation and assume sigma is sigma__p

f4:=epsilon__0*%Divergence(E_)=sigma__p(t);

epsilon__0*%Divergence(E_) = sigma__p(t)

(1.1.5)

f5:=diff(sigma__p(t),t)+%Divergence(j__p_)=0;
f6:=j__p=n*e(v__i_p-v__e_p);
f7:=j__p=n/(B_.B_)*(m__i+m__e)*Diff(E_,t);
f8:=j__p=rho/(B_.B_)*Diff(E_,t);

diff(sigma__p(t), t)+%Divergence(j__p_) = 0

 

j__p_(t, x, y, z) = n*e(v__i_p-v__e_p)

 

j__p_(t, x, y, z) = n*(m__i+m__e)*(Diff(E_, t))/Physics:-Vectors:-Norm(B_)^2

 

j__p_(t, x, y, z) = rho*(Diff(E_, t))/Physics:-Vectors:-Norm(B_)^2

(1.1.6)

f9:=Diff(f2,t);
f10:=Diff(f3,t);
f11:=Diff(f4,t);

Diff(%Divergence(D1_) = 0, t)

 

Diff(%Divergence(epsilon*E_) = 0, t)

 

Diff(epsilon__0*%Divergence(E_) = sigma__p(t), t)

(1.1.7)

``


 

Download Typesetting-delayDotProduct.mw

ode1a := diff(y1(tt),tt) = round(rhs(odeparm1[1][1]))*y1(tt) + round(rhs(odeparm1[1][2]))*y2(tt) + round(rhs(odeparm1[1][3]))*y3(tt);
ode2a := diff(y2(tt),tt) = round(rhs(odeparm1[1][4]))*y1(tt) + round(rhs(odeparm1[1][5]))*y2(tt) + round(rhs(odeparm1[1][6]))*y3(tt);
ode3a := diff(y3(tt),tt) = round(rhs(odeparm1[1][7]))*y1(tt) + round(rhs(odeparm1[1][8]))*y2(tt) + round(rhs(odeparm1[1][9]))*y3(tt);
sys := subs(y3(tt)=1,[ode1a,ode2a]);
print(DEplot(sys, [y1(tt), y2(tt)], tt = 0 .. 16, y1 = -16 .. 16, y2 = -16 .. 16, color = magnitude, title = `Stable Limit Cycles`, arrows = curve, dirfield = 800, axes = none));

 

how to mirror the vector field graph mathematically?

mirror the graph about x=0 this line,

so that the graph looked flip

i find curl can do, but how to do ?

 

restart;
with(VectorCalculus):
SetCoordinates('cartesian'[x(t), y(t), z(t)]);
Curl((x(t),y(t),z(t)),(Diff(x(t),t) - a11*x(t) - a12*y(t) - a13*z(t),Diff(x(t),t) - a21*x(t) - a22*y(t) - a23*z(t),Diff(x(t),t) - a31*x(t) - a32*y(t) - a33*z(t)));
Error, (in VectorCalculus:-SetCoordinates) coordinate system `cartesian[x(t), y(t), z(t)]` does not exist
Error, (in Vector) dimension parameter is required for this form of initializer

 

I am relatively new to maple and am using it for a multivariate calculus class.

I want to define a function g(x,y) which is the derivative of f(x,y).

I am trying:

which is my function, and

which should be the derivative.

When I try g(x,y) I get

but when I try to put numerical values in the first argument, (eg: f(1,y) I get

"Error, (in g) invalid input: diff received 1, which is not valid for its 2nd argument"
Any tips?

Hi quick question.  When I am writing in maple 2D input the next line seems to add a space and I have to manually go and take the spaces out.  Is there a quick fix for this?  

Thank you.

Why do I get different answers for the same command?

 different_answers.mw


 

``

restart

x := proc (n) options operator, arrow; cos(n*Pi) end proc;

proc (n) options operator, arrow; cos(n*Pi) end proc

(1)

"f:=k->"sum(k*x(n), n = 2 .. 3);f(1);

0

 

f(1)

(2)

f := proc (k) options operator, arrow; sum(k*x(n), n = 2 .. 3) end proc;

proc (k) options operator, arrow; sum(k*x(n), n = 2 .. 3) end proc

 

0

(3)

``


 

Download different_answers.mw

First 934 935 936 937 938 939 940 Last Page 936 of 2429