Items tagged with variables variables Tagged Items Feed

How can I use maple and separation of variables ,solve the wave equation utt=uxx for a string of lengh 4 with u(x,0)=sin (Pi/2 x) e-x . ut(x,0)=0.u(0,t)=0 and u(4,t)=0.

I am trying to write a procedure that have the following input:  expr, xdata,ydata. [dependent variables list]

I want a procedure to calculate Rsquare following the method described in 

http://www.mapleprimes.com/questions/120014-How-To-Calculate-Coefficient-Of-Determination

 

But I want the proc to take any abitary function and be able to identify the  dependent variable...how can I approach it? what function can I use to match [dependent variable list] in expr??

 

Thanks

 

 

Ok, I am not able to find about this after 30 minutes search (my limit of giving up :).

One can ofcourse make a local variables in a proc. But sometimes I need to make a temporary variable within the proc, say inside an if...fi to use for some local temporary computation. There is no need for this temporary variable to be declared at the whole proc() scope, since it is used only inside some limited scope.  I am not able to find how to do this in Maple. Here is some silly example

f:=proc()
     local x;
     x:=9;
     if x<10 then
        local z;
        z:=20;
        x:=z;
        ....
     fi;
     x;
     end proc;

the above is illegal. I can do this:

f:=proc()
     local x;
     x:=9;
     if x<10 then
        proc()
        z:=20;
        x:=z;
          ....
        end proc;    
     fi;
     x;
     end proc;
which compiles , but does not do what is expected. The body of the `if` statement is not called. I added a print statments there and they are not being called. (I guess since it is non-named proc(), it is not called, I thought it will fall through....

I looked for some kind of BLOCK , or DECLARE construct or such in Maple but can't find it.

is it possible to introduce a temporary local scope within a proc()? What would be the syntax? That would be really useful. Ada has this feature.

   

Consider the differential equation zZ'' + Z' + a2Z = 0,  where Z = Z(z).  Using the change of variables x = \sqrt{z/b}with b a constant,  obtain the differential equation Z'' + (1/x)Z' + c2Z = 0, where Z = Z(x) and c = 2a \sqrt{b}.

I tried Maple help and it offers the dchange command, and what I have tried is shown below;

with(PDEtools):

DE:= ...

tr:= {z = x2b}

dchange(tr, DE)

This did not return anything however.  I am thinking I need to specify that b is a constant, however, I am a little unsure on how to do this. Is the above the correct way to proceed?  I don't see how I have specified anywhere that in the final PDE, I require Z=Z(x).

Thanks for any help.  This is my first post here, so apologies for the typesetting. If there is inbuilt latex, I will use it next time.

The purpose is to display the projection of a 3D plane, defined by the points of P. "res" contains the points projected on a 2D plane and all variables beginning with "vlak" contain the points from res that should be connected to form a plane. The command polygonplot connects the points. Every time, it gives the error message "Error, (in plots:-polygonplot) points are not in the correct format". When I copy the code to a place outside the procedure, I discovered some variables are not defined.

restart:with(linalg):with(LinearAlgebra):with(VectorCalculus):with(plots): eerste:=proc(V,N,P) local M,M1,M2,I4,NT; NT:=Transpose(N); M1:=V.NT; I4:=IdentityMatrix(4); M2:=(N.V).I4; M:=M1-M2; M.P; end proc: tweede:=proc(OS,r,s,P1) local VC,K: K:=Matrix(4,3,[r,s,OS]); VC:=(MatrixInverse(Transpose(K).K)).Transpose(K); VC.P1; end proc: project:=proc(P,V,N,OS,r,s) local P1,P2,i,j,n: P1:=eerste(V,N,P); P2:=tweede(OS,r,s,P1); n:=ColumnDimension(P2); for i from 1 to n do for j from 1 to 2 do P2[j,i]:=P2[j,i]/P2[3,i]; end do: end do: DeleteRow(P2,3); end proc: P:=Matrix([[ 0 , 10 , 10 , 0 , 0 , 10 , 10 , 0 , 5 ], [ 0 , 0 , 10 , 10 , 0 , 0 , 10 , 10 , 5 ], [ 0 , 0 , 0 , 0 , 30 , 30 , 30 , 30 , 40 ], [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]]): V:=Vector([60,60,50,1]); N:=Vector([1,0,0,0]); OS:=Vector([10,10,0,1]); r:=Vector([0,1,0,0]); s:=Vector([0,0,1,0]); Vector[column](%id = 18446744073889448174) Vector[column](%id = 18446744073889448414) Vector[column](%id = 18446744073889448534) Vector[column](%id = 18446744073889448654) Vector[column](%id = 18446744073889448774) translatie:=t->Matrix([[ 1 , 0 , 0 , 1*t ], [ 0 , 1 , 0 , 1*t ], [ 0 , 0 , 1 , 0 ], [ 0 , 0 , 0 , 1 ]]); [1 0 0 VectorCalculus:-*(1, t)] [ ] [0 1 0 VectorCalculus:-*(1, t)] t -> [ ] [0 0 1 0 ] [ ] [0 0 0 1 ] f:=proc(t) local volgende,res,vlak_onder,vlak_links,vlak_voor,vlak_rechts,vlak_boven,vlak_achter,vlak1,vlak2,vlak3,vlak4,pp1,pp2,pp3,pp4,pp5,pp6,pp7,pp8,pp9,pp10: volgende:=MatrixMatrixMultiply(translatie(t),P): res:=project(volgende,V,N,OS,r,s): vlak_onder :=Transpose(Matrix([Column(res,1),Column(res,2),Column(res,3),Column(res,4)])): vlak_links :=Transpose(Matrix([Column(res,1),Column(res,2),Column(res,6),Column(res,5)])): vlak_voor :=Transpose(Matrix([Column(res,2),Column(res,3),Column(res,7),Column(res,6)])): vlak_rechts:=Transpose(Matrix([Column(res,3),Column(res,4),Column(res,8),Column(res,7)])): vlak_achter:=Transpose(Matrix([Column(res,1),Column(res,4),Column(res,8),Column(res,5)])): vlak_boven :=Transpose(Matrix([Column(res,5),Column(res,6),Column(res,7),Column(res,8)])): vlak1:=Transpose(Matrix([Column(res,8),Column(res,7),Column(res,9)])): vlak2:=Transpose(Matrix([Column(res,8),Column(res,7),Column(res,9)])); vlak3:=Transpose(Matrix([Column(res,8),Column(res,5),Column(res,9)])); vlak4:=Transpose(Matrix([Column(res,5),Column(res,6),Column(res,9)])); pp1:=polygonplot(vlak_onder): pp2:=polygonplot(vlak_links): pp3:=polygonplot(vlak_voor): pp4:=polygonplot(vlak_rechts): pp5:=polygonplot(vlak_achter): pp6:=polygonplot(vlak_boven); pp7:=polygonplot(vlak1); pp8:=polygonplot(vlak2); pp9:=polygonplot(vlak3); pp10:=polygonplot(vlak4); {pp1,pp2,pp3,pp4,pp5,pp6,pp7,pp8,pp9,pp10}: end proc: display(f(0),scaling=constrained); Error, (in plots:-polygonplot) points are not in the correct format

Above, you can see the code. When only pp1->pp7 is displayed, and pp8->pp10 is placed between commenting marks, it works fine. Otherwise it doesn't work, it looks like Maple does not define the variables pp8->pp10. I don't understand because there is no difference between pp7 and pp8.

Thanks in advance

Dear all,

I'm trying to substitute a combination of variables in an equation that is partly covered in a summation.

For example consider the equation with two variables A and B, and two function W(t) and q(z):

eq1:=A*B*(sum(W[n](t)*q[n](z), n))

now I want to do the substitution:

Hi, I am hoving trouble understanding how variables are meant to be declared. I have global variables that I wish to use that are tabled values such as m[1], ie: m subscript 1.However, when declaring parameters, local, or global variables within a procedure it does not allow them to be tables values. Why is this? and How should i be declaring these values?for example:Range:=proc(b[1]).... b subscript 1 will generate invalid parameter declarationRange:=proc(b) local c[1]...c subscript...

Dear Maple Users

I am mainly in favor of the new rules concerning subscripts. Using Ctrl+-- (double underscore) it is pretty straight forward to get a literal subscript and it displays much better in the palette Variables than was the case i Maple 16. Also the purple coloring of a variable containing a literal subscript makes sense, because it can be distinguished from the usual subscript (now Ctrl+shift+-). Good that you can remove the coloring in the View Menu (Atomic Variables...

Hi

i want to minimizez the "Eq1(h[1],h[2],...h[n])" for all the h[i] in the ranges of -1<h[i]<1.  "n" (number of unknown variables) can be determined during the code and was not know before. how can i do this?

It must be stated that when i have Eq1 and two unknown variables such as h[1] and h[2], i wrote the following code and it works good, but i dont know how can i write mentioned command for unknown number of variables.

NLPSolve(Eq1,h[1]=-1..1,h[2]=-1..1);

thanks for your attention in advance

Hi,

 

is there any analogous command to whos in Matlab to list the memory usage of specific variables in workspace?

Thanks!

Bye

Tom

hi everyone,

I need to plot a graph for system of nonlinear equations with multiple variables. 

here is some example of system nonlinear

 

f1=3.65a^2-2ac-7ad+3.65b^2+7bc-2bd-1.65a+6.22b+0.5=0

f2=13.22a^2-7ac+2ad+13.22b^2-2bc-7bd-6.22a-1.65b+0.24=0

f3=2c^3-2ac-7bc+2d^2+7ad-2bd-0.2=0

f4=c^2+d^2-1=0

 

with initial condition (0.7, 0.2, 0.6, 0.3)t. I solved this using Newton's method and here the iteration

In economics, variables are always real and often positive.

With assume(x>=0) I can set this for individual variables. But with many variables it is arduous.

Is it possible to set by default all variables to >=0 and define ony the exceptions individually?

Thanks you !

I have a multivariate polynomial equation, in that somehow I know the coeffcients, using this information, I want to extract the variables. This will be the opposite of coeffs function.

for e.g. I have 3*x3 + 5*x4

Given 3 and 5, I want to extract x3 and x4.

 

Thanks in advance.

 

Satya

 

I am trying to plot (3-Dimensional) two functions of 2 variables in maple. Here is my code:


K := (V, E) --> E*log(V)
P:= (V, E) --> E + V*log(V)
with(plots):
plot(K(V, E), P(V,E), V = 0 .. 20, E = 0 .. 190)               /*This line does not work*/
I want a 3D plot where a point in the graph would be: (K(V, E), V, E)
 
  1. How can I plot a 3-Dimensional Plot of two functions with 2 variables?

Hello,

How can I use assign(...) inside in proc in order to affect the local variables and not the globals.

 

Thanks

1 2 Page 1 of 2