Tag Info

New answers tagged

3

$PrePrint = Chop will work fine for suppressing small approximate numbers in the display of your results. However, it won't have an effect on the the output generated by Print: expr = FourierDCT[FourierDCT[{0, 0, 1, 0, 0}, 2], 3] {0, 0, 1., 0, 0} Print[expr] {0., 0., 1., 2.64289*10^-17, 1.54951*10^-18} That's because $PrePrint (and also ...


1

What you are encountering is something all Mathematica users encounter because it is the way Mathematica works. Szabolcs has explained this well. However, I would like to add that you can fix the "problem" by using Simplify Simplify[(2*I*k)^(1 + 0.1*I) (2*I*k)^(I*m) == (2*I*k)^(1 + 0.1*I + I*m)] True Simplify[(I k)^(N[Pi]) (I k)^(I m) == (I k)^(N[Pi] ...


3

This is not a bug. It's a misunderstanding about what TrueQ does. From the documentation, TrueQ will return True only if the input is explicitly True To put it more explicitly, it's equivalent to trueQ[expr_] := If[expr === True, True, False]. The expression (2*I*k)^(1 + 0.1*I) (2 I k)^(I*m) == (2*I*k)^(1 + 0.1*I + I*m) is not the symbol True ...


0

q1 = l1 E^(2 \[Pi] I t1) + l2 E^(2 \[Pi] I t2) q2 = q1 // ExpToTrig (Drop[q2, 2] // Factor) + Drop[q2, -2] (* E^(2 I \[Pi] t1) l1 + E^(2 I \[Pi] t2) l2 l1 Cos[2 \[Pi] t1] + l2 Cos[2 \[Pi] t2] + I l1 Sin[2 \[Pi] t1] + I l2 Sin[2 \[Pi] t2] l1 Cos[2 \[Pi] t1] + l2 Cos[2 \[Pi] t2] + I (l1 Sin[2 ...


1

Since l1, l2, t1, t2 are known, you just need to plug them in: q=l1 E^(2 \[Pi] I t1) + l2 E^(2 \[Pi] I t2) /. {l1->0.2, t1->0.1, l2->5, t2->-1} gives 5.1618 + 0.117557 I


5

Here is another possible solution which doesn't require you to use Simplify: Clear[f, a, g, r] f[arg_] := a - I arg Conjugate[g[r_]] ^:= g[r] Conjugate[f[g[r]]] (* ==> Conjugate[a] + I g[r] *) This uses UpSetDelayed to make the desired assumption part of the definitions associated with g.


6

Your assumption should be made on the value of g[_], not of plain g. Otherwise, your assumption can be introduced globally through $Assumptions, or as a second argument to Simplify, or using Assuming, all with the same result. Clear[f, g, r] f[arg_] := a - I arg Conjugate[f[g[r]]] (* Out: Conjugate[a] + I Conjugate[g[r]] *) Assuming[g[_] ∈ Reals, ...


4

This is because Mathematica doesn't have definitions for the derivative of Abs and Arg, so it can't do series expansions of expressions containing them. Consequently, it doesn't evaluate the Residue of such expressions either. But you could define a new function residue that knows how to extract the harmless logarithm before going on: Clear[arg, log]; ...



Top 50 recent answers are included