Items tagged with assignment

> restart;
> n := [1, 2, 3, 4, 5]; pr := .71; p := 0; q := 0; b := 0; l := 0; s := 0;
> for j to nops(n) do R1 := 2*n[j]/(1+n[j]); R2 := 2*p/(1+n); sys := diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))+1-(diff(f(eta), eta))^2 = 0, (diff(diff(theta(eta), eta), eta))/pr+f(eta)*(diff(theta(eta), eta))-R2*(diff(f(eta), eta))*theta(eta) = 0; bcs := f(0) = 0, (D(f))(0) = l+b*((D@@2)(f))(0), (D(f))(-.5) = 1, theta(0) = 1+s*(D(theta))(0), theta(-.5) = 0; proc (f1, th1, { output::name := 'number' }) local res1, fvals, thvals, res2; option remember; res1 := dsolve({sys, f(0) = 0, theta(0) = 1+th1, (D(f))(-2) = f1, (D(theta))(-2) = th1, ((D@@2)(f))(0) = f1-1}, numeric, :-output = listprocedure); fvals := (subs(res1, [seq(diff(f(eta), [`$`(eta, i)]), i = 0 .. 2)]))(0); thvals := (subs(res1, [seq(diff(theta(eta), [`$`(eta, i)]), i = 0 .. 1)]))(0); res2 := dsolve({sys, f(0) = fvals[1], theta(0) = thvals[1], theta(1) = 0, (D(f))(0) = fvals[2], (D(f))(1) = 0}, numeric, :-output = listprocedure); if output = 'number' then [fvals[3]-(subs(res2, diff(f(eta), `$`(eta, 2))))(0), thvals[2]-(subs(res2, diff(theta(eta), eta)))(0)] else res1, res2 end if end proc; p1 := proc (f1, th1) p(args)[1] end proc; p2 := proc (f1, th1) p(args)[2] end proc; p(.3, -.2); par := fsolve([p1, p2], [.3, -.2]); res1, res2 := p(op(par), output = xxx); plots:-display(plots:-odeplot(res1, [[eta, f(eta)], [eta, theta(eta)]]), plots:-odeplot(res2, [[eta, f(eta)], [eta, theta(eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta)], [eta, diff(theta(eta), eta)]]), plots:-odeplot(res2, [[eta, diff(f(eta), eta)], [eta, diff(theta(eta), eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta, eta)]]), plots:-odeplot(res2, [[eta, diff(f(eta), eta, eta)]])); fplt[j] := plots[odeplot](sol1, [eta, diff(diff(f(eta), eta), eta)], color = L[j], axes = boxed); tplt[j] := plots[odeplot](sol1, [[eta, theta(eta)]], color = L[j], axes = boxed) end do;


Dear Sir

In this above problem it showing that error as  Error, cannot split rhs for multiple assignment please can you tell why it is showing like this  ?? and where i did multiple assignments ??


Here is my code. I am deriving soil compression line for oedometric testing with porosity, below is a part of the derivation.

I would like to differentiate the (Sst/Vst)/(Spt/Vpt) by dsm first then integrate it with dsm ranges from 0 to dmax to get my final answer...

Hope someone can help me on writing the code... Thank you very much!!!

restart

``

Sst := `βss`*[dsx(dsm)^(2-Ds)-dsm^(2-Ds)]/(2-Ds);

`βss`*[dsx(dsm)^(2-Ds)-dsm^(2-Ds)]/(2-Ds)

(1)

Spt := `βps`*[dpx(dsm)^(2-Dp)-dpm(dsm)^(2-Dp)]/(2-Dp);

`βps`*[dpx(dsm)^(2-Dp)-dpm(dsm)^(2-Dp)]/(2-Dp)

(2)

Vst := `βsv`*[dsx(dsm)^(3-Ds)-dsm^(3-Ds)]/(3-Ds);

`βsv`*[dsx(dsm)^(3-Ds)-dsm^(3-Ds)]/(3-Ds)

(3)

Vpt := `βpv`*[dpx(dsm)^(3-Dp)-dpm(dsm)^(3-Dp)]/(3-Dp);

`βpv`*[dpx(dsm)^(3-Dp)-dpm(dsm)^(3-Dp)]/(3-Dp)

(4)

``

(dpm(dsm)/dpx(dsm))^(2-Dp) = (dsm/dsx(dsm))^(2-Ds);

(dpm(dsm)/dpx(dsm))^(2-Dp) = (dsm/dsx(dsm))^(2-Ds)

(5)

dpx := proc (dsm) options operator, arrow; C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds) end proc;

proc (dsm) options operator, arrow; C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds) end proc

(6)

dpm := proc (dsm) options operator, arrow; C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds+Dp-Ds) end proc;

proc (dsm) options operator, arrow; C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds+Dp-Ds) end proc

(7)

eval(Sst*Vpt/(Vst*Spt));

`βss`*[dsx(dsm)^(2-Ds)-dsm^(2-Ds)]*(3-Ds)*(2-Dp)*`βpv`*[(C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds))^(3-Dp)-(C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds+Dp-Ds))^(3-Dp)]/((2-Ds)*`βsv`*[dsx(dsm)^(3-Ds)-dsm^(3-Ds)]*`βps`*[(C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds))^(2-Dp)-(C1*dsx(dsm)*(dsm/dsx(dsm))^((3-Ds)*Ds+Dp-Ds))^(2-Dp)]*(3-Dp))

(8)

``

``

``

``


Download GEO_Assignment_3.mw

 

ANALYSIS AND DESIGN OF MACHINE FOUNDATION

 


restart

Loading Optimization

 

Loading LinearAlgebra  

 

Loading plots  

with(ScientificConstants):

Loading DynamicSystems  

with(Units:-Standard)

with(Units:-Natural)

with(StringTools)

FormatTime("%m-%d-%Y, %H:%M")

FormatTime("%m-%d-%Y, %H:%M")

(1)

NULL

Introduction

 

This document deals with vibration analysis and design of machine foundations subjected to dynamic load.

NULL

NULL

NULL

NULL

GetConstant(g);

standard_acceleration_of_gravity, symbol = g, value = 9.80665, uncertainty = 0, units = m/s^2

(2)

g__SI := evalf(Constant(g, system = SI, units))

9.80665*Units:-Unit(('m')/('s')^2)

(3)

NULL

Richart and Lysmer's Model

 

Richart et al. (1970) idealised the foundation as a lumped mass supported on soil which is idealised as frequency independent springs which he described in term of soil parameter

dynamic shear modulus or shear wave velocity of the soil for circular footing when footings having equivalent circular radius. The Tables below shows the different values of spring and damping vlaues as per Richart and Lysmer.

NULL

In which, G = dynamic shar modulus of he soil and is given G = `ρ__s`*V__s^2 ; ν = Piosson's ratio of the soil; ρs = mass density of the soil; Vs = shear wave velocity of the soil obtained

from soil testing; g = acceleration due to gravity; m = mass of the machine and foundation; J = mass moment of inertia of the machine and foundation about the appropriate axes; K = equivalent spring stiffness of the soil; C = damping value of the soil; B = interia factor contributing to the damping factor; D = damping ratio of the soil; r = equivalent radius of a circular foundation; L = length of foundation, and B = width of the foundation.

NULL

NULL

NULL

Sketch

 

NULL

NULL

NULL

NULL

nu := .25

Table : Values of soil springs as per Richart and Lysmer (1970) model

 

NULL

NULL

SI No.

Direction

Spring value

Equivalent radius

Remarks

1

Vertical

K__z = 4*G*r__z/(1-nu)"(->)"

r__z = sqrt(L*B/Pi)"(->)"

This is in vertical Z direction

2

Horizontal

K__x = (32*(1-nu))*G*r__x/(7-8*nu)
"(->)"

r__x = sqrt(L*B/Pi)"(->)"

This induce sliding in horizontal X

2.1

Horizontal

K__y = (32*(1-nu))*G*r__y/(7-8*nu)
"(->)"

r__y = sqrt(L*B/Pi)"(->)"

This induce sliding in horizontal Y

3

Rocking

`K__φx` = 8*G*`r__φx`^3/(3*(1-nu))"(->)"

`r__φx` = (L*B^3/(3*Pi))^(1/4)"(->)"

This produces roxking about Y axis

3.1

Rocking

`K__φy` = 8*G*`r__φy`^3/(3*(1-nu))"(->)"

`r__φy` = (L^3*B/(3*Pi))^(1/4)"(->)"

This produces roxking about X axis

4

Twisting

`K__ψ` = 16*G*`r__ψ`^3*(1/3)"(->)"

`r__ψ` = ((B^3*L+B*L^3)/(6*Pi))^(1/4)
"(->)"

This produces twisting about vertical Z axis

 

NULL

NULL

NULL

NULL

NULL

Table : Values of soil damping as per Richart and Lysmer (1970) model

 

NULL

SI No.

Direction

Mass ratio (B)

Damping ratio and Damping values

Remarks

1

Vertical

B__z = .25*m__U*(1-nu)*g__SI/(`ρ__s`*r__z^3)
"(->)"

`ζ__z` = .425/sqrt(B__z)"(->)"C__z = 2*`ζ__z`*sqrt(K__z*m__U)"(->)"

This damping value is in vertical Z direction

2

Horizontal

B__x = (7-8*nu)*m__U*g__SI/((32*(1-nu))*`ρ__s`*r__x^3)
"(->)"

`ζ__x` = .288/sqrt(B__x)"(->)"

C__x = 2*`ζ__x`*sqrt(K__x*m__U)"(->)"

This damping value is in lateral X direction

2.1

Horizontal

B__y = (7-8*nu)*m__U*g__SI/((32*(1-nu))*`ρ__s`*r__y^3)
"(->)"

`ζ__y` = .288/sqrt(B__y)"(->)"

`ζ__y` = .288/((2.145204688-2.451662500*nu)*m__U*Units:-Unit(('m')/('s')^2)/((1-nu)*`ρ__s`*(L*B/Pi)^(3/2)))^(1/2)

(5.1)

NULLError, invalid left hand side in assignmentError, invalid left hand side in assignment

`ζ__ψ` = .5/(1+117.6798000*`J__ψ`*Units:-Unit(('m')/('s')^2)*6^(1/4)/(`ρ__s`*((B^3*L+B*L^3)/Pi)^(5/4)))

(5.2)

C__y = 2*`ζ__y`*sqrt(K__y*m__U)"(->)"

This damping value is in lateral Y direction

3

Rocking

`B__φx` = (.375*(1-nu))*`J__φx`*g__SI/(`ρ__s`*`r__φx`^5)
"(->)"

`ζ__φx` = .15/((1+`B__φx`)*sqrt(`B__φx`))
"(->)"

`ζ__φx` = .15/((1+11.03248125*(1-nu)*`J__φx`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`ρ__s`*(L*B^3/Pi)^(5/4)))*((11.03248125-11.03248125*nu)*`J__φx`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`ρ__s`*(L*B^3/Pi)^(5/4)))^(1/2))

(5.3)

Error, invalid left hand side in assignmentError, invalid left hand side in assignmentNULLError, invalid left hand side in assignment

.15/((1+11.03248125*(1-nu)*`J__φx`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`ρ__s`*(L*B^3/Pi)^(5/4)))*((11.03248125-11.03248125*nu)*`J__φx`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`ρ__s`*(L*B^3/Pi)^(5/4)))^(1/2)) = .15/((1+11.03248125*(1-nu)*`J__φx`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`ρ__s`*(L*B^3/Pi)^(5/4)))*((11.03248125-11.03248125*nu)*`J__φx`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`ρ__s`*(L*B^3/Pi)^(5/4)))^(1/2))

(5.4)

`C__φx` = 2*`ζ__φx`*sqrt(`K__φx`*`J__φx`)"(->)"

NULL

This damping value is for rocking about Y direction

3.1

Rocking

`B__φy` = (.375*(1-nu))*`J__φy`*g__SI/(`ρ__s`*`r__φy`^5)
"(->)"

NULL

`ζ__φy` = .15/((1+`B__φy`)*sqrt(`B__φy`))
"(->)"

.15/((1+`B__φy`)*`B__φy`^(1/2)) = .15/((1+`B__φy`)*`B__φy`^(1/2))

(5.5)

`C__φy` = 2*`ζ__φy`*sqrt(`K__φy`*`J__φy`)"(->)"

NULL

This damping value is for rocking about X direction

4

Twisting

`B__ψ` = `J__ψ`*g__SI/(`ρ__s`*`r__ψ`^5)"(->)"

`ζ__ψ` = .5/(1+2*`B__ψ`)"(->)"NULLError, invalid left hand side in assignmentError, invalid left hand side in assignmentNULLError, invalid left hand side in assignmentNULLError, invalid left hand side in assignment

.5/(1+117.6798000*`J__ψ`*Units:-Unit(('m')/('s')^2)*6^(1/4)/(`ρ__s`*((B^3*L+B*L^3)/Pi)^(5/4))) = .5/(1+117.6798000*`J__ψ`*Units:-Unit(('m')/('s')^2)*6^(1/4)/(`ρ__s`*((B^3*L+B*L^3)/Pi)^(5/4)))

(5.6)

`C__ψ` = 2*`ζ__ψ`*sqrt(`K__ψ`*`J__ψ`)"(->)"NULL

``

NULL

This damping value is valid for twisting about vertical Z axis

 

NULL

NULL

NULLNULL

(4)

``

NULL

Vertical Motion Considering damping of the Soil

 

For vertical direction the equation becomes that of a lumped mass having single degree of freedom when

deq := m__U*(diff(z(t), t, t))+'C__z'*(diff(z(t), t))+'K__z'*`#mi("z")` = P__0*sin(`ω__m`*t)

m__U*(diff(diff(z(t), t), t))+C__z*(diff(z(t), t))+K__z*`#mi("z")` = P__0*sin(`ω__m`*t)

(6.1)

NULL

t1 := subs(P__0*sin(`ω__m`*t)/m__U = F, expand(deq/m__U));

diff(diff(z(t), t), t)+1.085721853*(G*(L*B/Pi)^(1/2)*m__U/(1-nu))^(1/2)*(diff(z(t), t))/(m__U*(m__U*Units:-Unit(('m')/('s')^2)/(`ρ__s`*(L*B/Pi)^(3/2))-m__U*Units:-Unit(('m')/('s')^2)*nu/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2))+4*G*(L*B/Pi)^(1/2)*`#mi("z")`/(m__U*(1-nu)) = F

(6.2)

NULL

(6.3)

By algebraically manipulating the expression, the form traditionally used by engineers is derived:

t2 := algsubs('C__z'/m__U = 2*zeta*omega, t1)

diff(diff(z(t), t), t)-(-1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))*nu+1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))+4.*G*(L*B/Pi)^(1/2)*`#mi("z")`*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2))/((nu-1.)*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2)*m__U) = F

(6.4)

NULL

t3 := algsubs('K__z'/m__U = omega^2, t2)

diff(diff(z(t), t), t)-(-1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))*nu+1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))+4.*G*(L*B/Pi)^(1/2)*`#mi("z")`*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2))/((nu-1.)*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2)*m__U) = F

(6.5)

This form includes the damping ratio , the natural frequency , and the external forcing term .  Consider only free vibration by setting

gen3 := subs(F = 0, t3)

diff(diff(z(t), t), t)-(-1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))*nu+1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))+4.*G*(L*B/Pi)^(1/2)*`#mi("z")`*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2))/((nu-1.)*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`ρ__s`*(L*B/Pi)^(3/2)))^(1/2)*m__U) = 0

(6.6)

NULL

sol1 := dsolve({gen3, z(0) = P, (D(z))(0) = V}, z(t))

z(t) = -(1000000000/1178791942081753609)*Pi*m__U*exp(-(1085721853/1000000000)*Units:-Unit(('s')/('m')^(1/2))*t/(Pi*((nu-1)^2/(`ρ__s`*L^2*B^2*G))^(1/2)*m__U))*(1085721853*V*Units:-Unit(('s')/('m')^(1/2))*((nu-1)^2/(`ρ__s`*L^2*B^2*G))^(1/2)*`ρ__s`*L^2*B^2-4000000000*(L*B/Pi)^(1/2)*Pi*nu*`#mi("z")`+4000000000*`#mi("z")`*Pi*(L*B/Pi)^(1/2))/(Units:-Unit(('s')/('m')^(1/2))^2*B^2*L^2*`ρ__s`)+(4000000000/1085721853)*`#mi("z")`*G*Pi*(L*B/Pi)^(1/2)*((nu-1)^2/(`ρ__s`*L^2*B^2*G))^(1/2)*t/((nu-1)*Units:-Unit(('s')/('m')^(1/2)))+(1/1178791942081753609)*(1085721853000000000*V*Units:-Unit(('s')/('m')^(1/2))*Pi*((nu-1)^2/(`ρ__s`*L^2*B^2*G))^(1/2)*m__U*`ρ__s`*L^2*B^2+1178791942081753609*Units:-Unit(('s')/('m')^(1/2))^2*P*`ρ__s`*L^2*B^2-4000000000000000000*(L*B/Pi)^(1/2)*Pi^2*m__U*nu*`#mi("z")`+4000000000000000000*`#mi("z")`*Pi^2*(L*B/Pi)^(1/2)*m__U)/(B^2*L^2*`ρ__s`*Units:-Unit(('s')/('m')^(1/2))^2)

(6.7)

NULL

NULL

 

Download Analysis_and_Design_of_Machine_Foundations_1.mw

Good Morning Mapleprime Community,

Would anybody please help in the attached worksheet. I'm trying to use the new function in Maple that is the clicable method, but I was having problem in some of my output such as zeta_y and zeta_phi as this two equations are generating an error message.

 

Regards,

Moses

I'm trying to solve a system of two differential equations of the second order in Maple. I set it up as a system of four differential equations of the first order, but after calling for the solution, all I get back is what I entered in without receiving a solution of any sort. What do I need to fix?

Here's what I did:

_________________________________________________

> with(plots);
print(`output redirected...`); # input placeholder

> m := 0.46e-1; d := 0.42e-1; v := 60; alpha0 := 12; g := 9.81; pa := 1.205; cd := .2; n := 100; omega := 2*Pi*(1/60);
                            
> p := 6*m/(Pi*d^3);

> k1 := (3/4)*cd*pa/(d*p); k2 := (3/8)*omega*pa/p;
                                        
> gl1 := vx(t) = diff(x(t), t);                   
> gl2 := vy(t) = diff(y(t), t);
                              
> gl3 := diff(vx(t), t) = -k1*vx(t)*(vx(t)^2+vy(t)^2)^(1/2)-k2*vy(t);
 
> gl4 := diff(vy(t), t) = -g-k1*vy(t)*(vx(t)^2+vy(t)^2)^(1/2)+k2*vy(t);


> init1 := x(0) = 0;
> init2 := y(0) = 0;
> init3 := vx(0) = v*cos((1/15)*Pi);                              
> init4 := vy(0) = v*sin((1/15)*Pi);

> sol; dsolve({gl1, gl2, gl3, gl4, init1, init2, init3, init4}, {vx(t), vy(t), x(t), y(t)}, type = numeric);

> sol(.1);
                            sol(0.1)

> odeplot(sol, t, x(t), t, y(t), t = 0 .. 1);
                   Error, (in plots/odeplot) input is not a valid dsolve/numeric solution


____________________________________________________________________________

After calling for the solution at t=0.1, I don't get anything back. I also tried plotting the solution, but then I receive an error message.

Is it possible to have an input box, where the student can give an input (integer) and this is then used in the following questions in an assignment?

e.g. in the first question the student is asked to give his student number, in the second question this number is used to create random parameters.

In Maple TA in blackboard I am creating an assignment. Each week a part of the assignment will be posted. I was wondering if it is possible to have the same random variables in differnet assignmemts. That way the students can use their prior work. 

So in week one the students will get a set of random variables. But in week two a new assignment is posted were I want the same variables to come up for each student. Is this possible? (all students will have their own unique set of variables)

Hi,

Following situation: I have Records with several members. These members in turn have varied expressions assigned to them: some have numbers, one has a Matrix, some have formulae. Example:

q:=Record(l=len,k1=kl/len,R=(a 6x6 Matrix dependent on len and kl/len));

I want to be able to use the limit command on each of the members of q such that each member gets assigned the correct limit of its expression. I.e. I want to write a function limit2 such that

limit2(q,len=0);

yields

Record(l=0,k1=infinity,R=(limit~(the Matrix,len=0))

The trick here is that the members of the Record vary for different Records but I want to write a function limit2 that works for all of these. I can make a list of the members by using exports(q) like this:

exlist:=[exports(q)];

and after some fiddling I found that I can run limit on each member in turn:

for nam in exlist do
  limit~(eval(parse(cat(elm,":-",eval(nam)))),len=0)
end do;

What I have not been able to do is putting the result back into the member of the Record. Usually I would use assign for such a task, but I am unable to get the correct name on the left side that lets me assign to it. These names would of course be q:-l, q:-k1 and q:-R in the above example. I tried the parse(cat(...)) construct above and variations, but in the best case the assignment does not happen, in worse cases I get an error thrown. Never do I get the actual assignment.

Any hint how to do this?

TIA,

M.D.

PS: FWIW, I am doing this on Mape 15.

 

But I have not found how to do it.

I'd like to tell a new worksheet to use assignments created in another document. This is to save time retyping equations.

And, is this something that others like to do ?

 

Thanks.

Cheers !

Hi,

 

  I have the following code for using "PolynomialSystem" solve equations of polynomial

 

*********

with(SolveTools):

f:=PolynomialSystem({x+y-3, x^2+y^2-5}, {x, y}):

print(x,y);
print(f);
f[1];f[2];
a:=f[1][1];b:=f[1][2];
print(a,b);
c:=-evalf(a);d:=-evalf(b);

****************

 

The output is

***

x, y
{x = 2, y = 1}, {x = 1, y = 2}
{x = 2, y = 1}
{x = 1, y = 2}
x = 2
y = 1
x = 2, y = 1
-x = -2.
-y = -1.

***

From what I have seen, I cannot subtract the values of x and y as 2 and 1. Is there any way that I can get the values of solutions of variables, namely I can assign a variable "a" as 2, and the other variable "b" as 1?

 

Thank you very much!

 

 

 

 

Greetings,

Maple 15 allows the following syntax

omega := sqrt(w0^2*(1+((z-zf)/z0)^2))

But it does not allow this one 

omega^2 := sqrt(w0^2*(1+((z-zf)/z0)^2))

Why is this so for functions and variables? Is there any way around this, I am really bugged by this issue. The Maple Math told me that the syntax was invalid so I had type the commands directly.

 

This seems such a simple/basic question I'm almost too embarassed to ask.

Anyway. this is causing me some headaches

 

> A := <0|0>;

         A:= [0 0 ]

> B := A:

> A(1,1) := 2 ;

         A:= [2 0 ]

> B;

         B:= [2 0 ]

What do I do to prevent the elements of B changing if A changes, after using the assignment B:=A (or should I not be using this assignment?)  I mean, I would like the same behaviour as 

> a := 0;

         a:=0

> b := a;

         b:=0

> a := 2;

         a:=2

> b;

         b:=0

which seems to work as I "expect"...

It is possible to add groups of questions to an assignment in Maple T.A. But how do you see the grades divided into these groups? As an example, suppose we have two groups of questions say 5 questions in the group "algebra" and 5 questions in the group "geometry". The class grades show the grades for all 10 questions all together, but I would like to see the grades for two groups individually.

 

 

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

1 2 3 Page 1 of 3