Items tagged with subs subs Tagged Items Feed

Hi Everyone,

I have an expression that contains a second order derivative: EXPR:=ay''(x) + bz'(x) + cf'(x)+... The variable y  obeys an ordinary differential equation, y''(x) = f(y,x). I would like to replace the second order deriavtive in my expression with f(y,x). So far I have tried applyrule([y''(x)=f(y,x)],EXPR), subs(y''(x)=f(y,x),EXPR) and algsubs(y''(x)=f(y,x),EXPR) and nothing seems to work. Any helpful suggestions?

 

Hi again,

 

I am lost... again. I worked with the Physics package and have obtained my result in form of a lengthy equation of commutators of non-commuting objects. So basically my problem is solved, except that I now want to compute some examples to see, if everything is correct. For that purpose I want to replace now the non-commuting objects with explicit matrices, compute the result and see if it agrees with numerical studies. However, I have no clue which command to use, because if I try it with subs, then the multiplication is of the wrong type and Maple won't multiply my matrices. I tried to use eval but wasn't successful.

Here is an exampe to see what I mean.

Test2.mw

 

Thank you for your time

 

NOh

The following MWE shows what I mean:

with(Physics):Setup(mathematical=true):

Setup(noncommutativeprefix={MX,MY,MZ});

test:=proc()

    local eq;

    eq:=-Commutator(MX,MY)-Commutator(MZ,MY);

    eq:=simplify(subs(MX=-MZ,eq));

    return eq;

end proc:

 

test();  # yields -[-MZ,MY] - [MZ,MY]

 

%  # yields 0

 

 

Any ideas how I can solve this? I would like to return the simplified version.

Hi

How can I substitute a function in a matrix? This is what I tried but it's not working at all:

lign1:=x-y+2*z=1:
lign2:=(-2)*x+y+z=0:
lign3:=(-4)*x+y+7*z=2:
lign4:=3*x-2*y+z=1:
T := GenerateMatrix([lign1, lign2, lign3, lign4],[x, y, z], augmented);

Then I'd like to substitute another function with lign1:

lign5:=x+y+z=6:
T2:=subs(lign1=lign5, T);

But T2 = T and that wasn't really the point.

 

Sorry if the answer is obvious no amount of searching has helped me so far. I hope this question isn't too ridiculous.

Thanks

kappa := Vector(7, [1,w[1]*(1-phi+phi*(1-1/(1+exp(-mu[p]-tau[p3]))))+(1-w[1])*
(1-phi+phi*(1-1/(1+exp(-mu[p]-tau[p3]-eta[p2])))),w[1]*phi/(1+exp(-mu[p]-tau[
p3]))+(1-w[1])*phi/(1+exp(-mu[p]-tau[p3]-eta[p2])),w[1]*(1-phi+phi*(1-1/(1+exp
(-mu[p])))*(1-phi)+phi^2*(1-1/(1+exp(-mu[p])))*(1-1/(1+exp(-mu[p]-tau[p3]))))+
(1-w[1])*(1-phi+phi*(1-1/(1+exp(-mu[p]-eta[p2])))*(1-phi)+phi^2*(1-1/(1+exp(-
mu[p]-eta[p2])))*(1-1/(1+exp(-mu[p]-tau[p3]-eta[p2])))),w[1]*phi^2*(1-1/(1+exp
(-mu[p])))/(1+exp(-mu[p]-tau[p3]))+(1-w[1])*phi^2*(1-1/(1+exp(-mu[p]-eta[p2]))
)/(1+exp(-mu[p]-tau[p3]-eta[p2])),w[1]*(phi/(1+exp(-mu[p]))*(1-phi)+phi^2/(1+
exp(-mu[p]))*(1-1/(1+exp(-mu[p]-tau[p3]))))+(1-w[1])*(phi/(1+exp(-mu[p]-eta[p2
]))*(1-phi)+phi^2/(1+exp(-mu[p]-eta[p2]))*(1-1/(1+exp(-mu[p]-tau[p3]-eta[p2]))
)),w[1]*phi^2/(1+exp(-mu[p]))/(1+exp(-mu[p]-tau[p3]))+(1-w[1])*phi^2/(1+exp(-
mu[p]-eta[p2]))/(1+exp(-mu[p]-tau[p3]-eta[p2]))]);

Download kappa.txt

Here is the expression, I am trying to simplify, given a set of rules. NEW_Cole.mw

I have tried different substitutions, using simplify with side rules, applyrule, eval, subs, algsubs.

But none seem to be working as the way I want them to be.

 

Is there a better way?

 

Thanks!

Hi!

 

Do anyone know the keyboard shortcut to the standard subsribt in Maple 18 on a macbook with OS X? 

 

Thanks,

Mads

I'm working on a complex problem in Composite Materials. I've gotten to a near-result 6x6 matrix, with several cells containing polynomial denominators. I have an equation for simplifying these, which boils the polynomials down to a single variable, but I can't seem to get it to substitute in. Can anyone help me solve this? The problem is also time-sensitive.

 

a problem of subs...

August 17 2014 taro 110

Hello people in mapleprimes,

 

I want to modify the next equation: 

(**)  a:=sigma*omega*alpha = mu(H, H)*s*omega*gamma1*L+mu(F, H)*s*L-mu(F, H)*s*L*gamma1;

to be

(***)    sigma*omega*alpha = mu(H, H)*s*omega*gamma1*L+(1-gamma1)*mu(F, H)*s*L;

 

For that, first I defined b as

b:=sum(op(k,rhs(a)),k=2..3)=collect(sum(op(k,rhs(a)),k=2..3),{s,L,mu(F,H)});

, and substituted this to a with

subs(b,a);

 

But, what I could obtain was only the orignal equation (**) not (***).

Please tell me how to use subs to this problem to obtain (***)。

Thanks in advance.

taro

P.S.

I know

(****)collect(lhs(a)=rhs(a),{s,L,mu(F,H)});

works well as for what I wrote (**) as above.

But, originally, it was a result from substituting various equations into an equation.

For it, (****) does not work well.  

 

 

Hi there

I'm taking my first steps with maple and my question is not exactly briliiant

Putting in a simple way, I'm trying to solve sth that looks like this

> li := a*[cos(7*x+8*x*y+9*y)*cos(-7*x-8*x*y-9*y)];
             a [cos(7 x + 8 x y + 9 y) cos(-7 x - 8 x y - 9 y)]

and i want to replace

with

getting (if i do it by hand)

> algsubs(7*x+8*x*y+9*y = 20*y, li);
                    a [cos(20 y) cos(-7 x - 8 x y - 9 y)]

my question, is there an elegant way to do it? sth that would look like this?

 

 

thank you for any tips

Hi There

I'm getting started with maple and facing a doubt about using subs, somehow it does not seem to work, this is my expression:

 

> restart;
> theta := omega*t-k*x;
                                omega t - k x
> phi[1] := -(1/2)*H*c*cosh(k*(z+h))*sin(theta)/sinh(k*h);
                   H c cosh(k (z + h)) sin(-omega t + k x)
                   ---------------------------------------
                                 2 sinh(k h)              
> diff(phi[1], t, t);
                                                             2
                H c cosh(k (z + h)) sin(-omega t + k x) omega
              - ----------------------------------------------
                                 2 sinh(k h)                  
> td := simplify(subs(z = 0, %));
                                                          2
                   H c cosh(k h) sin(-omega t + k x) omega
                 - ----------------------------------------
                                 2 sinh(k h)               
> simplify(subs(cosh(k*h)/sinh(k*h) = 1/tanh(k*h), %));
                                                          2
                   H c cosh(k h) sin(-omega t + k x) omega
                 - ----------------------------------------
                                 2 sinh(k h)               
I cannot subs cosh/sinh = tanh. I would like to know why.

Any tips? Thank you

So suppose in one maple worksheet, I run:

>assume(w, real); y:=2*w;
>save y, "test.m";

 
And then I open another, and run

>read "test.m";
>subs(w=1,y);

The substitution won't work, while it works if I don't make any assumptions about the variable w.  However, in the piece of code I'm actually running (this snippet is just to illustrate the problem), I need to make the assumption that w is real for solving a system of equations (otherwise maple seems to run out of memory).  Is there a way to save my result y in such a way so that I can make substitutions for w later?

Hi everyone,

I wanted to plot the fourier series up to a given order of a step function using the code I attached, to change the order I used a sum with upper boundary M. When setting M to a particular value and plotting the function the result is obtained within a second, when on the otherhand using plot(subs(M=11,...),...) it takes close to a minute to produce a picture.

This might be a misuse of subs, in any case, I wanted to share my experience and maybe get an explanation about why this takes that much longer.

Cheers,

Sören

restart

f := proc (t) options operator, arrow; sum(-4*sin((2*n+1)*t)/(Pi*(2*n+1)), n = 0 .. M) end proc

proc (t) options operator, arrow; sum(-4*sin((2*n+1)*t)/(Pi*(2*n+1)), n = 0 .. M) end proc

(1)

plot(subs(M = 11, f(t)), t = 0 .. 2*Pi)

 

M := 11; plot(f(t), t = 0 .. 2*Pi)

 

Download fourier_subs.mw

I wish to substitute Re=W[0]/V[0] in the expression V[0]/W[0] * diff(u(t),t). I tried using the subs command but it didn't work. Any help would be appreciated !

Help!!

Why do the first two of the following 4 examples not work in Maple 15?

subs(m=21,`mod`(m, 4));
subs(m=21,m mod(4));
                               21
                               21
`mod`(21, 4);
21 mod(4);

                               1
                               1
Is there a (simple) workaround?

Thanks.

1 2 3 4 Page 1 of 4