Items tagged with applyrule applyrule 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?

 

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 everyone,

I have a maple program that generates a polynomial g(y)=(80y^8 + 68y^6 + 12y^4 -4y^2 -1). This polynomial has two real roots (irrational roots), call them +/- y*. My code does a sequential calculation, and often sI am left with a higher order polynomial in y that has the form h(y)= p(y)*g(y), where p(y) is also a polynomial in y. This polynomial h(y)=p(y)*g(y) is not in factored form (i.e. it would look like expand(p(y)*g(y)). Is there a way to instruct maple to recoginize that +/-y* is also a root h(y)=p(y)*g(y)? So far I've tried things like applyrule([g(y*)=0],h(y*)), but nothing seems to work (I suspect because Maple cannot recgonize that g(y) is a factor of h(y)). I am not interested in computing this numerically. I am just trying to find a way to instruct Maple to recognize symbolically that h(y*) =0.

Thanks a million for anyone who has any idea.

Best,

 

Justin

I am trying to make a substitution:

> restart;
> f1 := conjugate(z)^2*z^2;
> f2 := applyrule(z*conjugate(z) = x, f1);

however the result is

f2 := conjugate(z)^2*z^2

Do you have any ideas how to solve the problem? Thank you.

I have the following expression (obtained from an earlier calculation):

I want to collect all the terms under one summation. So I define a rule:

collectf:=proc(f)
A::algebraic*f(a::algebraic)+B::algebraic*f(b::algebraic)\
 +C::algebraic*f(c::algebraic)+D::algebraic*f(d::algebraic)=f(A*a+B*b+C*c+D*d);
end proc:

and then

applyrule(collectf(Sum),%);

I get

Error, (in +) unable to identify A::algebraic

I used similar constructs before so I think the rule is constructed correctly. I should, however, mention that I use the Physics:-Vectors package and in fact the expression I start up with here reads, in 1-d Maple inputform:

Physics[Vectors][`+`](Physics[Vectors][`+`](Physics[Vectors][`+`](-y*(Sum((diff(a[n](r), r))/(exp(I*Pi*n/L))^2, n))/r, (2*I)*(Sum(a[n](r)/(exp(I*Pi*n/L))^2, n))*k0), y*(Sum(a[n](r)/(exp(I*Pi*n/L))^2, n))*k0^2), -y*(Sum((diff(a[n](r), r, r))/(exp(I*Pi*n/L))^2, n)))

Is my problem related to the use of Physics:-Vectors? If so, how can I get around that?

TIA,

Mac Dude

Greetings,

I have a differential equation:

an the solution:

I want to substitute

ekf := omega = sqrt(c/m);


algsubs(ekf, sol);
but sol does not change.

This works a bit but does not substitute everything in a way that you would expedect

This is the result:





Thanks in advance

Hi,

I have an expression which contains terms like cos(3*x)*cos(x) + sin(3*x)*sin(x). In this expression, I replace the prevous terms by using applyrule as:

applyrule([cos(3*x)*cos(x)=1/2*(cos(2*x)+cos(4*x)), sin(3*x)*sin(x)=1/2(cos(2*x)-cos(4*x))],expr);

 

Is there a way to generalize this so that I may replace all forms of sin(n*x)*sin(m*x) = 1/2(cos((n-m)*x)-cos((n+m)*x))?

 

Thanks for your help.

I have a question about the "applyrule" function. I have an expression that looks like:

 

exprsn1:=sin(z)(Acos(z) + Bcos(x)cos(2z) + Ccos(x));

 

I would like to express cos(2z)sin(z) in the form 1/2(sin(3z)-sin(z)). However, when I use the "applyrule" as:

exprsn2 := applyrule(sin(z)cos(2z)=1/2(sin(3z)-sin(z), exprsn1);

it returns the same expression. Is there something else I should be doing before I use applyrule?

Following an earlier thread (Collect-And-Sqrt) where a solution using applyrule was proposed (and that solution works), I tried to use applyrule to implement some of the trig half-angle relationships. Immediately I ran into trouble:

Say I want to use the rule

r:=cos(th::algebraic)=2*cos(th/2)^2-1;

so I say

applyrule(r,cos(alpha));

and Maple promptly goes into an...

here is an equation

eq := I*`ℏ`*(sum((diff(c[n](t), t))*f[n](r)*exp(-I*omega[n]*t), n = l .. k)) = (1/2)*E[0](e_.r_)*e*(sum(c[n](t)*f[n](r)*omega[n]*(exp(I*t*(-omega[n]+Omega))+exp(-I*t*(omega[n]+Omega))), n = l .. k))

req := Int(conjugate(f[m](r))*rhs(eq), r)

leq := Int(conjugate(f[m](r))*lhs(eq), r)

sup:=Int(conjugate(f[m](r))*f[n](r), r) = delta[m, n]

ans:=applyrule(sup,leq=req)

how can get the result as

ans := I*`ℏ`*(diff(c[m...

applyrule...

November 24 2010 acer 10356

@Alejandro Jakubi Alejandro this is something like the 3rd time in as many weeks that you have used applyrule to nice effect, deftly providing a more general solution.

This is great because applyrule deserves more notice, if not as a bug-free command then certainly as representative of a symbolic problem-solving methodology. (And heavier use can lead to more bug...

Page 1 of 1