Tag Info

New answers tagged

2

The reason is, that the nicely formatted subscripts in the frontend looking like $c_f$ are no "real" variables, but are represented as Subscript[c,f]. You can see that, if you use FullForm on one of those subscript-lookalikes. Therefore, your code does end up trying to create the derivative of the Mathematica-function Subscript, but of course there is no ...


1

Adding a semicolon at the end of your command will suppress its output. result = Solve[...]; The result is saved in the variable result for further processing. You can get the constants by, for example, constant1 = C1 /. result;


1

f[x_] := x^2 - 1; df = D[f[x], x]; lastX = .7;(*guess*) k = 1;(*counter,just in case*) err = Infinity; SetOptions[$FrontEnd, PrintPrecision -> 16] r = First@Last@Reap@While[err > 0.000001 && k < 10, Sow[{k, err, lastX}]; currentX = lastX - f[lastX]/(df /. x -> lastX); err = Abs[f[currentX] - f[lastX]]; lastX = ...


1

Starting with your code, corrected as in my comment, z[x_, y_] := x + y*I F[z_] := (25*Pi*z*I)/(1 + 10*Pi*z*I) you can plot the imaginary part of F as follow ContourPlot[Im[F[z[x, y]]], {x, -.2, .2}, {y, -.2, .2}, PlotRange -> All, Contours -> Range[-5, 5, .5], ContourLabels -> True] and similarly for other quantities. Many different ...


0

The thing that made this work in the end was using dummy variables as the function parameters. This then allowed me to use /. to replace variables. solution[mm_, gg_] := NDSolve[{eqn /. {m -> mm, g -> gg}, z[0] == 0, z'[0] == 0}, z[t], {t, 0, 10}] I think this is a pretty unintrusive solution, since it only affects one line of code and I can ...


4

In the Standard Evaluation Sequence the heads of expressions are evaluated first: If the expression is a raw object (e.g., Integer, String, etc.), leave it unchanged. Evaluate the head h of the expression. Evaluate each element of the expression in turn ... Therefore since f[1] is the head of f[1][2] it will evaluate if it has a definition that matches. ...


3

AddAssumption[assumption_]:=$Assumptions=DeleteDuplicates[$Assumptions&&assumption] You need to also check which functions use $Assumptions by default. Simplify, Refine and FullSimplify use it. To reset the assumptions use: $Assumptions=True Example: AddAssumption[x>0] Simplify[Sqrt[x^2]] Out: x



Top 50 recent answers are included