Tag Info

New answers tagged

1

First of all avoid using For loop better (and faster) use Do instead. stream = OpenWrite["c:\\1.txt"]; Do[ z = Exp[x^2]; Write[stream, z] , {x, 0, 100000, 0.5}]; Close[stream]; PS: it is best to avoid cycles for functional analog


2

This will probably be closed as a duplicate of either: What are the use cases for different scoping constructs? Passing function as argument In the meantime the simple answer is that you need Module rather than Block, because the former creates a new Symbol whereas the latter merely temporarily changes the value of Symbol. myf = Module[{f}, f[3] = 33; ...


0

I just had the same question - and one thing that helped me with Mathematica was the Formula Manipulation help site which shows functions like Simplify, Expand, Factor, Reduce, Collect, Together, ... etc. Maybe it's possible to shrink your equation - or at least Expand or Factor out something to be able to make it a multiline equation.


4

You have a typo in your second equation. eqns = {2 + 2 a*d + 2 a*e == 0, 1 - 2 e + 2 d*b + 2 e*b == 0, 1 + 2 d*c + 2 e*c == 0, -2 + a^2 - 2 b + b^2 + c^2 == 0, -2 + a^2 + b^2 + c^2 == 0}; Solve[eqns, {a, b, c, d, e}] // Simplify


5

Oh, you just incorrectly type the equation in Mathematica, your second one should be: 1 - 2 d + 2 d b + 2 e b == 0, check the 2 d term. It's not a 2 b. Solve[{2 + 2 a d + 2 a e == 0, 1 - 2 d + 2 d b + 2 e b == 0, 1 + 2 d c + 2 e c == 0, a^2 + b^2 + c^2 - 2 == 2 b, a^2 + b^2 + c^2 - 2 == 0}, {a, b, c, d, e}] (* {{a -> -2 Sqrt[2/5], b -> 0, c ...



Top 50 recent answers are included