Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about the function Assuming[], the $Assumptions system variable, and the Assumptions option of functions such as Simplify[] and Integrate[].
3
votes
Why does Assuming[...] work in one case but not in another?
Your function must hold its argument or the Simplify will evaluate before the function even sees it. Use:
Function[expr, Assuming[α > 0 && ϵ > 0 && t > 0, expr], HoldFirst]
Or:
SetAttributes[myAs …
4
votes
Detecting operator Set in Assumptions
Simplify::badSet = "Function Set used in assumptions where is likely in error.";
SetAttributes[mySimplify, HoldAll];
mySimplify[expr_, assum_] :=
Message[Simplify::badSet] /; ! … FreeQ[Unevaluated@assum, Set]
mySimplify[else__] := Simplify[else]
Now:
mySimplify[x + y, x = a]
Simplify::badSet: Set used in assumptions where is likely in error. >>
You could overload Simplify …
1
vote
Evaluating an expression assuming a value for a variable only in the local context
While m_goldberg's answer is correct*, provides a proper explanation, and uses only documented behavior, there exists a cleaner syntax for the example given:
x = 42.;
With[{q := x}, NIntegrate[x^2*q …
5
votes
Accepted
How to select TransformationFunctions based on Assumptions made when using Simplify?
Since Simplify is responsive to $Assumptions and by extension Assuming we can use it to check our Condition. …
3
votes
Attaching persistent assumptions to symbol definition
The TransformationFunctions option for Simplify and FullSimplify allows you to create custom simplification manipulations that can be used either in place of or in addition to the defaults. Combined …
5
votes
Accepted
How do I SetDelayed $Assumptions
A helper function to make this cleaner:
SetAttributes[mySet, HoldAll]
mySet[LHS_Symbol, RHS_] := (OwnValues[LHS] = {HoldPattern[LHS] :> RHS};)
Now:
mySet[$Assumptions, Print["y"]; x > 0] (* nothing … prints *)
and:
Refine[{x < 0, x == 0, x > 0}]
y
{False, False, True}
Also:
mySet[$Assumptions, Print["y = ", y]; x > y]
y = 1;
Refine[{x > 1, x > 2, x > 3}]
y = 2;
Refine[{x > 1, x > 2, …
2
votes
How make D[f,x] treat OverBar[x] as a constant
If you prefer not to have to make the replacement each time:
OverBar'[x] = 0;
f = a*x + OverBar[x]
D[f, x]
a*x + OverBar[x]
a
9
votes
Accepted
Simplifying conditional expressions using assumptions does not work
If you are willing to use Assuming, which acts by way of [$Assumptions](http://reference.wolfram.com/language/ref/$Assumptions.html), you can use an `$Assumptions-aware [Condition](http://reference.wolfram.com … [x ∈ Reals] is evaluated
Simplify uses the value of $Assumptions and determines that x ∈ Reals is True
The Condition passes and f[x] evaluates to "success!" …
3
votes
Accepted
Display returned integral containing assumptions with integral sign
Something like this:
MakeBoxes[
Integrate[a__, Assumptions -> _],
fmt : TraditionalForm
] := MakeBoxes[Integrate[a], fmt]
Now when you view the integral in TraditionalForm:
Integrate[f[x] Sin[( … :
Integrate[f[x] Sin[(n π x)/L], {x, 0, L},
Assumptions -> k > 0 && L > 0] // TeXForm
\int_0^L f(x) \sin \left(\frac{\pi n x}{L}\right)\, dx …