Items tagged with assignment assignment Tagged Items Feed

I have a vector of lists, and each list is composed of indexed names.  For each list, I would like to assign all the indexed names in the list to the first variable of the list.  Right now, I'm trying to select the entries of the list using the op command and then assign one to the other, and get the following error:

Error, invalid left hand side in assignment

June_29.mw

Thanks!

Hello !

I installed Maple 14 on my windows8 computer (with compatibility windows7). My program worked the 2 first times, and suddently it bugged on the third, though I changed NOTHING.

It puts me an "Error: recursive assignment". The concerned line is: 

if a < 2 then broSet := broSet union {[param[1, j], param[2, i]]} fi:

There should be no problem.

Does anyone have any idea ?

 

Hi

Long story short I had a detailed question and then the session timed out and killed it!

Quickly then, if we calculate something recursively Maple acts differently to other languages.

For example, in Python:

__________________________________________

>>>t=1;

>>>t+=1;

>>>print t;

___________________________________________

Is interpreted as:

__________________________________________

>>>t=1;

>>>t=t+1=2

>>>print t

2

___________________________________________

In Maple:

___________________________________________

>t:=1

>t:=t+1

>print(t)

___________________________________________

Is Interpreted as:

___________________________________________

>t=1

>t=t+1=1+1=2

>print(t); t=t+1=1+1=2

2

____________________________________________
And there in lies my problem. Logically, I wish to use a iterative algorithm to work out an expression of the nth derivative of a function from the (n-1) derivative. However, doing this is in maple brings up "error (in Test) too many levels of recursion".

 

For context, Minimum Working Example:

____________________________________________

>TestFunction:=(x)->cos(exp(-1/x^2))*F(x):

>limit(TestFunction(x),x=0)

F(0)

>TestDerivative:=(x)->eval(diff(TestFunction(y),y),y=x):

>limit(TestDerivative(x),x=0)

D(F)(0)

>for i from 1 to 50 do
print(D^(i)(TestFunction)(0)=limit(TestDerivative(x),x=0));

TestDerivative:=(x)->eval(diff(TestDerivative(y),y),y=x):

od:

D(TestFunction)(0)=D(F)(0)

Error, (in TestDerivative) too many levels of recursion

_______________________________________________

Ideally, this code would output the limit of the second derivative at zero by differentiating the first derivative and then the limit of the third derivative at zero by differentiating the second derivative etc. But what Maple is trying to do is to find the limit of the second derivative by differentiating the function then differentiating the result of that, then to find the limit of the third derivative it will first derivative by differentiate the function, then the second by differentiating the result, then third derivative by differentiating the result of that. If I have the analytic expression for the 5th derivative and I wanted the expression for the 6th derivative, I do not want to work out the 1st, 2nd, 3rd, 4th and then 5th derivative when I've already an of the expression of the 5th derivative!

I will note, it is possible to avoid the problem by using different names at each step but that does not solve the iterative problem.  Is there anyway to force maple to overwrite a function name? Is there a seperate solution? Or is maple just that daft in this case?

 

Thanks for the help,

Hamzaan

Hello All,

I have had a few questions that have come up while working on a Maple Assignment for my Calculus III class. I was wondering if anybody could help me with these questions, as well as show me how to enter them in Maple. Here are the questions I have been struggling with.

 

  1. In the xy-plane, graph the ellipse ((x-4)^2)/(4))+(y-4)^2=1 and two level curves of F(x,y)=x^3+y^3-3xy that just touch the ellipse.

                  a. What do we know about the gradients of F and the ellipse at those points?

                  b. Use your graph to approximate the minimum and maximum values of F subject to the constraint ((x-4)^2)/(4))+  (y-4)^2=1.

 

      2. A company manufactures a product using inputs x,y,z according to the production function Q(x,y,z)=20x^(1/2)y^(1/4)z^(2/5). The prices per unit are $7 for x, $12 for y, and $18 for z.

                 a. Create the cost function

                 b. The company wants to produce 2500 products. Estimate the minimum cost by using the graph of the level surfaces of the cost function (from part a) together with the production constraint.

Any help you could give me would be much appreciated. Thanks!!

 

 

            

part of my codes are:
func[1] := (1/2)*(c+s)*x[1]+s*x[3]+(s-c)*x[1]*x[2];
func[2] := (1/2)*(c-s)*x[1]+s*x[3]+(s+c)*x[1]*x[2];
func[3] := -b*x[2]-x[1]^2;
They are just three ODE , how to fix the error?Where is the so-called recursive assignment...?
The program works well when:
"func[1] := x[2] + (x[1]^2 - x[1]*x[3]);
func[2] := - x[1] +  (x[2]^2 + x[1]*x[4]) + x[2]^3;
I've tried all sorts of different assignments for a,b and c but all still give me an error 
for root 2. 
have tried posint, int, nonnegative, positve but none work 
any help would be appreciated. 
 
isTriangle:=proc(a::posint,b::posint,c::posint)
if (a+b) > c then print (a,b,c,`are lengths of a triangle`)
#this is according to the triangle inequality theorem
elif (a+b) < c then print ...

I have a set of equations

I've several versions behind but I getting a strange behavior. I created an assignment using the eco0 question bank. Later this assignment was passed to a class a semester later. The question bank eco0 was updated. As the instructor, using the review button on the assignment shows the new version of the question bank. As a student, the assignments are getting the old question bank question.  The students didn't start the assignment until after the questionbank change.(I think I'm using version 4.0.) 

Hi,

I'm having some problems with the generation of the typical stiffness matrices seen in FEA formulations. I have got an elementary matrix that is looped through the entire stiffness matrix to generate it. As there is juxtaposition between the elementary matrices, there is some recursive assignment involved that I can't handle properly. Here is the code for a 6x6 elementary matrix with a 3x3 juxtaposition. n is the nombre of recursions needed to fill the stiffness matrix. M is the elementary matrix

I am getting the reecursive assignment error on the folowing code in the band[i]:= [band[]i[], ... section.

CreateMatrix is defined and I know that works and creates a global Matrix H

I have been grappling with the Maple concept of last name evaluation and would appreciate a more detailed explanation than is available in the Programming Guide (too brief) or the help page (confusing).

What I think I understand is this: Normally, Maple evaluates an expression fully until all assignments are resolved, leaving me with an expression having only "values" (in a generalized sense, could be strings, numbers, what have you) and "names", which are variables...

A simple question. I have looked at the help pages on "passing" and "declaring" arguments, which are very detailed, but couldn't quite spot the answer to my question, though I suspect it is there somewhere.

I have 2 procedures and want to pass the argument of one procedure to another procedure used therein. In the basic case, I seem to be able to do it without special precautions. However, I have not been able to make it work in a situation involving multiple spellings for the arguments ...

I have to solve the following set of equations. But it allways appears the Error "recursive assignment". Has somebody a solution for me? Is there a Problem with the Equations?

DGL1 := m[1]*(D(D(x[1])))(t)+d[1]*((D(x[1]))(t)-(D(x[2]))(t))+c[1]*(x[1](t)-x[2](t))+e^(-0.4e-1*t)*sin(t)+1.5 = 0;
DGL2 := m[2]*(D(D(x[2])))(t)+d[2]*(D(x[2]))(t)+d[1]*(DF[4]-(D(x[2]))(t))+c[2]*(x[2](t)+x[f])+c[1]*(F[4]-x[2](t)) = 0;

init := (D(x[1]))(0) = 0, x[1](0) = 1.5, x[2](0) = 5;

Today, after hours of hunting a persistent bug in a worksheet, I discovered something i did not know about Maples evaluation strategy. Consider the following Maple code:

restart:
a:=1:
b:=a:
b:=2:
a;

Now the variable 'a' holds the value of 1. Now consider the case where 'a' is a vector:

restart;
a:=<1,1>:

1 2 Page 1 of 2