## 80 Reputation

4 years, 220 days

## How to specify solution range for solve...

Maple

Hey,

I want to solve this equation and looking at the plot there are at least 3 solutions. I want the greatest/smallest negative solution. Unfortunately using solve with assumptions produces no results and solve without assumptions only finds two solutions.

 > #select greatest negative value from solution
 > restart:
 > expr:= ax*cos(lambda)+ay*sin(lambda)-(a+b*lambda)
 (1)
 > ax:=1:ay:=2:a:=0.5:b:=0.25: #examplanatory values
 > plot(expr)
 >
 > assume(-2*Pi
 >
 > sol_lambda:=[solve(expr=0,lambda, useassumptions)];# returns empty list even though without assumption one solution is found
 (2)
 > sol_lambda:=[solve(expr=0,lambda)]; #returns only two solutions even though looking at the plot 3 are there
 (3)
 > sol_l_v:=evalb~(sol_lambda<~0); #dirty workaraound
 (4)
 > sol_l_add:=[ListTools:-SearchAll(true,sol_l_v)] ; #this seems overly complicated
 >
 (5)
 > lambda:=sol_lambda[sol_l_add[-1]];  #to select the last entry
 >
 (6)
 > expr; #test
 >
 (7)
 >

Thanks!

Honigmelone

## Problem with applyrule...

Maple

Hi,

can you please help me with the usage of applyrule? I have the following problem that I cannot isolate. I have a rule that I want to apply, but instead of applying the rule to the expression, the rule seems to be applied to itself. In an isolated worksheet everything is fine:

 > restart;
 > rule:=abs(''a''::algebraic)^2=''a''^2;
 (1)
 >
 (2)
 > applyrule(rule,myexp);
 (3)
 > rule
 (4)
 >

What happens when I try to use this rule in my script is this:

 > restart;
 > rule:=abs(''a''::algebraic)^2=''a''^2;
 (1)
 > applyrule(rule,abs(x)^2)
 (2)
 > rule
 (3)
 >
 >

I want to clarify, that the script that is read before applying those rules does not apply a similar rule. Also the variables rule and x were free. Can you please help me to locate the problem?

Thanks!

Honigmelone

## Forget very small numbers...

Maple

Hey,

at some point in my maple calculations I have to read some symbolic constants because otherwise the expressions become to big. All my constants are in a range 1e-3 to 1e6 or something. No matter how exact I calculate my result always has some Numbers in the range of <1e-20 (how small they actually are varies with Digits) together with numbers 1e-3..1e6. I presume those 1e-20 are just zeros. Can I somehow tell maple to forget/drop very small numbers and assume them all to be zero?

Thanks!

Honigmelone

## Eval Physics[diff]...

Maple

Hey all,

I want to symbolically differentiate a function and recalculate the result later. Here is what I have tried so far:

 > restart;
 > myexp:=dfdb+sthlong
 (1)
 > b:=;
 (2)
 > dfdb:=Physics[diff]~(f(b),b)
 (3)
 > f:=b->b(1)^2+b(2)
 (4)
 > eval(myexp);  #actual result
 >
 >
 (5)
 > dfdb:=Physics[diff]~(f(b),b):
 > eval(myexp); #expected result
 (6)
 >

I wonder if this is even possible, or if I missunderstand something. Can you please help me?

Thanks

Honigmelone

## How to simplify this expression?...

Maple

Hey,

is there a way to substitute funktion combinations when they have the same arguments? I want to substitute abs(exp)*abs(1,exp) with exp. Algsubs works as long as I know the excat expressions. However, I want to do this substitution for any exp. Simplify doen't work here ether.

I also tried to write my own simplification rule with no success:

 > restart:
 > f:=abs(a)*abs(1,a);
 >
 (1)
 > siderel:={abs(x)*abs(1,x)=x};
 (2)
 > simplify(f,siderel);    #expected result: a
 (3)
 >
 >
 >