Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Doing a routine simplification but got an error...Dont know where the mistake comes from.

 

simplification_error.mw

Is it possible to make notes above and next to a matrix like in the image above? How?

I'm sorry if this is really obvious but I'm new to Maple.

Thank you in advance :)

I want to solve the following problem in Maple:

I used the following Maple code. I am unsure whether this is the correct way of entering the assumptions for the initial and boundary conditions though.


 

eq := diff(u(x, t), t, t)-4*(diff(u(x, t), x, x)) = 0

diff(diff(u(x, t), t), t)-4*(diff(diff(u(x, t), x), x)) = 0

(1)

ic := `assuming`([u(x, 0) = 4*sin(x), (D[2](u))(x, 0) = 0], [x > 0])

u(x, 0) = 4*sin(x), (D[2](u))(x, 0) = 0

(2)

bc := `assuming`([(D[1](u))(0, t) = 0], [t > 0])

(D[1](u))(0, t) = 0

(3)

`assuming`([simplify(pdsolve([eq, ic, bc]))], [`and`(t > 0, x > -t)])

u(x, t) = (-4*Heaviside(x-2*t)+4)*sin(2*t-x)+4*sin(x)*cos(2*t)

(4)

``

``

Download IVP_with_inequalities.mw

Hi, I have a problem that needs excessive use of symbolic matrix-vector manipulation. I'm using maple physics vector package. my first problem is that it seems this package don't support symbolic vector transpose and the related rules is there a way to implement this, for example, I want to write in symbolic form: V_*Transpose(V_) but maple eliminate the Transpose head function and evaluate this as V_^2 which is wrong, or I want maple automatically simplify the transpose rule which state that (ab)'=b'a' which a and b are symbolic matrices if maple doesn't understand this, so is there a way I can implement this.
my second question is how can I state that for example, A*B is not equal to B*A with just assuming A and B are Matrix with Airbtrary dimension and not define A and B indices so that whenever i type: A*B+B*A it doesn't evaluate it as 2*AB

I need to plot a model of the amount of internet users starting from 1995 - 2024 in the US.


 

Example : Quadratic Modeling: Internet Users

 

"I:={[[-0.25 t^(2)+16.9 t-50,,5<=t<=24],[,]]"

``

"I  ="number of users of internet

t = time i.e 5 = 1995 year

 

NULL


 

Download Modeling_graph.mw

 

How can i sove further to get exact value

 

I am new to maple. I am trying to plot3d  the following differential eq:

eq1 := diff(c(x, t), t) - 1.5*diff(c(x, t), x, x) + 0.05/(x + 0.001) = 0

With these initial conditions:

ics := c(x, 0) = 0, c(0, t) = 10, D[1](c)(20, t) = 0

And then I slove and plot this:

sol := rhs(dsolve({eq1, ics}, c(x, t)))

plot3d(sol, x = 0 .. 20, t = 0 .. 100, labels = [x, t, c])

But I only get an empty coordinate system with no plot. I don't have this problem when in the last line of the eq, I have 0.05*x instead of 0.05/(x + 0.001).

Could someone help me with what might be the problem?

 

 

 

Hi,

How to change Maple symbol " I " to mathematical symbol " i " ?

Thanks

How to do this in Maple please?

Iterate an array and select x items so that the sum of the selected items equal or are above a value.

Eg. 10 real numbers in an array, random for example between 0..10 and select some of them so the value is equal or greater than y, e.g 5.2 , as close as possible to optimize the selection.

restart; with(plots):with(LinearAlgebra):unprotect(O); alias(conj = conjugate); conj z = lambda*v+a; La droite D est représentée par son équation complexe Appelons H l'affixe h le pied de la perpendicukaire abaissée de O sur (D) Les vecteurs OH et V sont orthogonaux donc z = lambda v + a h*conj(v)+conj(h)*v = 0; Le point H appartient à la droite (D) donc : h = lambda*v+a; conj(h) = conj(a)+lambda*conj(v); (lambda*v+a)*conj(v)+(conj(a)+lambda*conj(v))*v = 0; solve(%, lambda); h := simplify(subs(lambda = %, lambda*v+a)); a := 3-I*4; v := -2/3+4*I; evalc(h); H := [Re(h), Im(h)]; Représentation graphique d'un cas particulier : f := proc (x) options operator, arrow; -3*x+5 end proc: a := 3: A := [a, f(a)]:O:=[0,0]: zo := [8/3+I*f(8/3)]; ze := [2+I^(eval(diff(f(x), x), x = 2))]; Zo := [8/3, f(8/3)]; Ze := [2, f(2)]; ex := -3*x+5; V := `

I've never noticed this before, becuase I do not like to with()  packages, but like to add the name of the package at each command and alwsys try to use explicit commands.

Compare this first example, which does not work, since the "." in the codeis the global "dot" command ?dot

restart;
VC:=VectorCalculus:
f:=y*sin(x)+y^2;
VC:-Nabla . VC:-Nabla(f,[x,y])

So the dot above is the one used for normal dot product, which is visible without loading any package as in: <1,2>.<3,4> gives 11

Now when I next loaded the VectorCalculus explicitly, but kept the same code the same, i.e. using the same ".", now it worked

restart;
with(VectorCalculus);
VC:=VectorCalculus:  #do not need this now, but to keep the code the same
f:=y*sin(x)+y^2;
VC:-Nabla . VC:-Nabla(f,[x,y])

It worked because Maple now used VectorCalculus:-`.`  ,Even though I did not tell it to do this, it searched the package since it is loaded) and now decided to use VectorCalculus:-`.` instead of the global `.` dot defined before loading this package.

But how did Maple know which dot to use? 

Did it say to itself, the dot in the middile must be VectorCalculus:-`.` and not the global `.` due to the type of the operands around the dot, it automatically found the correct match? 

So imagine if one has loaded more packages, and some might have its own `.` operator that takes the same operands, does Maple search them all to find the correct dot to use based on type of operands to bind it to? and how in this case it knows which to use, if there is more than one match among all loaded packages? I can see this causing confusion, becuase one is never sure in this case which operator was used. I do not know if Maple issues a warning in this case or not.

I do not use input 2D math in document mode. But was trying it now to see if I can enter this to check my hand solution

In worksheet, this is what I do

restart;
VC:=VectorCalculus:
f:=y*sin(x)+y^2;
VC:-DotProduct(VC:-Del,VC:-Gradient(f,[x,y]))

But I do not know how to enter   if possible, in document mode 2D math. THis is what I tried. Created document mode. Picked the DEL operator from the left side common symbols window. But I do not know how to do the rest.

Clearly I am doing something silly. This is why I prefer plain Maple code, becuase I can see what I am typing :)

But was wondering, how to do the above in docuemnt mode + 2D math? To make it look close to how it shows in the book. Does one need special palette for this?

 

 

Hello

In Section 14.5 - External Calling ..., page 489, the authors gave an example on how to use the command line in Unix to call maple with arguments. I followed the example but added a mpl-file to see if the arguments were sent to it.  

Example (Linux):

/opt/maple2020/bin/maple -c n:=4 -c 'path:="/home/eduardo/examples";' example.mpl > output.txt &

Maple sends out the following error message: "Error, incorrect syntax in parse: '/' unexpected (near 7th character of parsed string)".

The msg is clear where the error is but I could not figure out what to do. The single quotes were supposed to take care of that, weren't they?  

Many thanks.

Ed

Edit: I have added the double-quotes.   The problem still persists.  

I wanted to overwrite an existing variable of type table by the one returned from a call to a proc().

But it does not work, unless eval() is called on the returned result from the proc()

But if the variable that recieves the return value from the proc() was not already a table type, then it works without using eval. Why is that? 

Here is an example

restart;
foo:=proc(A::table)
  A["c"]:=3; #add new field
  return A;
end proc;

A:=table():
A["a"]:=1:
A["b"]:=2:
B:=foo(A):
whattype(B);
print(B)

           table(["a" = 1, "c" = 3, "b" = 2])

In the above, it worked. is table now, and assigned the updated table from the proc.  But 

A:=table():
A["a"]:=1:
A["b"]:=2:
A:=foo(A): #without eval, it does not work.
whattype(A);
print(A)

             symbol
               A

I expected A to be overwritten, just like B was. To fix this, I have to change A:=foo(A): by A:=eval(foo(A)):

But why eval was not needed in the first example, and was needed for the second example?

btw, the same thing happens with Record(), not just table()

just like to understand the reasoning behind this. I expected both cases to work the same way. But it works different if the variable happend to be unassigned (like B above).

Hello all,

I was hoping to get some general tips for tackling numeric integrals. As someone with little experience in the subject, I find myself overwhelemed by the many different integration methods. 

Experts, what are the first steps you take when trying to find a numeric solution to an integral? How might you zero-in on a particular integration method? What about tweaking error parametrs, etc.? Is there a general framework for approaching these problems, or is it all guesswork?

Thanks!

1 2 3 4 5 6 7 Last Page 1 of 1678