Items tagged with substitution substitution Tagged Items Feed

Dear Maple Users,

I'm solving quite a complicated task, so I tried to simplified an example.

There is an equation:

SOL := fsolve(Nz+int(int(StrssCctXY(x, y), x = -(1/2)*b .. (1/2)*b), y = -(1/2)*h .. (1/2)*h) = 0, {C1 = -(1/2)*h .. (1/2)*h})

 StrssCctXY(x,y) is piecewise function containing C1 variable, to solve an equation I had to use assumptions on C1 via assume(C1<num1, C1>-num2) command, after that C1 becomes C1~;

 

Hi,

I am working with equations on Maple which depends on a parameter (epsilon), which can assume only the values +1 and -1 (I intent to replace this value only in the end of calculation). When, however, Maple computes the expressions, the result contains severals powers of epsilon, for instance epsilon^7 or epsilon^4. Since actually we have that epsilon^7=epsilon and epsilon^4=1, respectively, it would be very usefull to me if Maple 

subs command bug?!

February 09 2012 by itsme 149 Maple

Hi:

Consider this trivial (very contrived) example:

restart:

a:=lambda+3;
b:=Vector([lambda-2, lambda+23]);

subs(lambda=1, a); #works as expected

subs(lambda=1, b); #works as expected

 
assume(lambda, real);  #seems like this causes a problem
subs(lambda=1, a);  #works as expected

subs(lambda=1, b);  #This substitution does NOT work - lambda stays as 'lambda'

I am using maple 15 on...

After understanding how one part of code works i also see that it uses trick of eval (namely "procedural substitution"):

restart;
r:=f(g(u), h(w)):
eval(r, [g=proc() ll; end proc]):

gets full substitution with arguments

and

restart;
r:=f(g(u), h(w)):
eval(r, [g=ll]):

do simple one 'by name'.

Where can i read about that?

Hello,

 

I have a derivation to do for my PhD thesis, and it is long and tedious. It is essentially a case of splitting sums, making substitutions and then simplifying. I believe maple can do this for me, but have not found how yet. Any suggestions would be more than welcome. I have done this for a third order problem (three nested sums) and the derivation runs to many pages. I now need to do so for the 4th order problem, and it is a more than daunting prospect

Hi

I have an expression as the following:

exp1:=E(z)*(diff(t(r), r))/(1-nu(z)^2)+E(z)*nu(z)*t(r)/((1-nu(z)^2)*r)+(E(z)*z/(1-nu(z)^2)-(4/3)*E(z)*z^3/(h^2*(1-nu(z)^2)))*(diff(y(r), r))+(E(z)*nu(z)*z/(1-nu(z)^2)-(4/3)*E(z)*nu(z)*z^3/(h^2*(1-nu(z)^2)))*y(r)/r-(4/3)*E(z)*z^3*(diff(p(r), r, r))/(h^2*(1-nu(z)^2))-(4/3)*E(z)*nu(z)*z^3*(diff(p(r), r))/(h^2*(1-nu(z)^2)*r);

I want to replace the following parameter instead of coefficients of t(r), y(r), p(r) and their derivatives as the following:...

=

I have to make following substitutions in a ODE:

alpha = x - 2

y(alpha) =  y(x) - 1

 

[Maple code starts]

The ode is 

ODE := diff(y(x), x) = (y(x)+1)/(x+2)-exp((y(x)+1)/(x+2));

 

I have used the following commands:

Rhsa := eval(rhs(ODE), {x = alpha-2, y(x) = y(alpha)-1});
lhsa:=subs({x = alpha, y(x) = y(alpha)}, lhs(ODE));

 

Sub_ODE:=lhsa = Rhsa;

I would like to calculate the power series solution of a set of ODEs. However, I know that this power series will contain non-integer coefficients, which are dependent on a (rational) parameter of the system, α. I'm solving the ODE by power series in the usual way, that is, by defining each of the solution variables as a function with the first few terms of their power series (with unknown coefficients), substituting these into the ODEs, and finding a series of the ODE which should be of the form:

I have the following variable

s1:=(1/2/Pi+Q*cos(k*phi))^3*cos(k*phi)/(1+beta^2*(1/2/Pi+Q*cos(k*phi))^2)^2;

 

and then I make a substitution as follows

s2:= subs(cos(k*phi)=((1-u^2) / (1+u^2)),sin(k*phi)=((2*u) / (1+u^2)), s1)*1/(1 + u^2);  -----(1)

 

Now if I set up a function f that maps u to the right hand side of (1) above as follows

f:=u->(1/2/Pi+Q*(1-u^2)/(1+u^2...

I am trying to make substitutions into a matrix using the subs() command, but it does not work.

for example

with(linalg):
A:= matrix([[a,b,c],[d,e,f]]):
B:=subs[inplace](a=1/L,b=-1/L,c=1,d=-1/L,e=L,f=1,A);

                                         ...

The following example tries to do the same thing two different ways.

Calling a procedure "M1" directly by name works fine.

Calling the same procedure by substitution fails to substitute, and when the substrituion is forced using "apply" I get an error message.

Why does the substitution not work, and where is the error?

Because of the complexity of my problem, I need to use substitute (or anything else equivalent) instead of directly calling the procedure by name.

In the name of God

Dear my friends

Hi

 I have a function as the following:

 temp:=phi(Lambda(tau, 0), tau, 0)+((D[1](phi))(Lambda(tau, 0), tau, 0)*(D[2](Lambda))(tau, 0)+(D[3](phi))(Lambda(tau, 0), tau, 0))*q;

 I have equivalent functions for Lambda(tau,0) and phi(Lambda(tau,0),tau,0) as the following:

 c[0](tau) instead of Lambda(tau,0)

y[0](c[0](tau),tau) instead of phi(Lambda(tau,0),tau,0)

Thank you

Your answer makes sense if Maple evaluates from innermost to outermost, so the substitution in T2c takes place AFTER Test is evaluated with a symbolic value of "n".

 But it doesn't explain why the "assuming" examples work - or don't work. If "Test" is evaluated first, then none of the examples should work; if the assumption is passed through "simultaneously" (whatever that means), then the wording of the error message doesn't make sense...

The attached file demonstrates that a substitution into a piecewise function appears (sometimes) to execute the wrong half of the function.

If I use "assuming" instead of substitution, the assumption appears to get through to the piecewise function, but only sometimes.

I don't understand why this happens. Can anyone clarify what is going on? See below.

Thank you.

 

______________________________________________________________

1 2 Page 1 of 2