Solve Equations from Equations Mathematica

Well, I need a way to solve equations by another var got from other equation in Mathematica 8. Example:a + b = 2cc + 2 = dd = 2bIt will chose the best equation for the given values and solve the rest.With some given values, like a = 1 and c = 3, it solves the system, getting the values for the respective variable.*Will use this for physics' formulas....Read more

Monitoring progress of a parallel computation in Mathematica

I'm building a large ParallelTable, and would like to maintain some sense of how the computation is going. For a non parallel table the following code does a great job:counter = 1;Timing[ Monitor[ Table[ counter++ , {n, 10^6}]; , ProgressIndicator[counter, {0, 10^6}] ]]with the result {0.943512, Null}. For the parallel case, however, it's necessary to make the counter shared between the kernels:counter = 1;SetSharedVariable[counter];Timing[ Monitor[ ParallelTable[ counter++ , {n, 10^4}]; , ProgressIndicator[counter, {0, 10^4}] ]]with th...Read more

wolframalpha - How do I get the crosshair behavior of Wolfram|Alpha 2D graphics in Mathematica?

When the mouse cursor is over a 2D plot in Wolfram|Alpha, a pair of grey lines appear that help you read the coordinates off the x and y axes.For example, I have the mouse over one of the turning points in the following plot of the Airy function.The above can also be obtained inside Mathematica using WolframAlpha["Plot Ai(x)", {{"Plot", 1}, "Content"}]which has the added advantage of some sort of locator showing the coordinates.How can I emulate such behavior in a normal Mathematica graphics/plot?...Read more

wolframalpha - Is that possible that Mathematica can locate the maximum of a scalar function whereas Mathematica Alpha cannot?

I am trying to understand the difference between Mathematica that one installs in the laptop versus Mathematica Alpha on the web. Specifically, I would like to learn how their computational powers differ in term of solving an optimization problem.QuestionIs that possible that Mathematica can locate the maximum of a scalar function whereas Mathematica Alpha cannot?For information, Mathematica is the computational product by Wolfram Research; Mathematica Alpha, if I understand correctly, is the web demo version of Mathematica....Read more

wolfram mathematica - I would like to plot 2 listplots and one fitting curve in one system of coordinates, but overlay function shows me such a result

plot1 = ListPlot[MNvsAmp, PlotRange -> All, PlotStyle -> PointSize[Large], ImagePadding -> 85, Frame -> {True, True, True, False}, FrameLabel -> {"Time, s", "Number of atoms, 1000"}, PlotMarkers -> {marker1, .035}, PlotLegends -> "gamma = 1.903 beta = 2.173*10^(-20)"];plot2 = ListPlot[TvsTXTvalue, PlotRange -> All, PlotStyle -> PointSize[Large], ImagePadding -> 85, Frame -> {False, False, False, True}, FrameTicks ->{None, None, None, All}, FrameLabel -> {{"","Temperature, mK"},{"",""}}, PlotMarkers -> ...Read more

physics - What does /; mean in Mathematica?

Does anyone know what does /; mean for example:V[n_][i_/;i<=imax,0];=V[n][i,0]=0 in Mathematica?It's part of a program to draw the eletrical potential function of a rectangular metal trough using the finite-difference methods.Here's the improved one, but still cannot work.V[0][i_, j_] := 0;tol = 0.0025; imax = 20; jmax = 20;V[n_][i_, 0] := V[n][i, 0] = 0;V[n_][i_, jmax] := V[n][i, jmax] = 100*Sin[0.05*Pi*i];V[n_][0, j_] := V[n][0, j] = 0;V[n_][imax, j_] := V[n][imax, j] = 0;V[n_][i_, j_] := V[n][i, j] = (1/4)*(V[n - 1][i + 1, j] + ...Read more

finding function by points Mathematica

I have two list x and y. I combine them and receive list of point {x,y}. Using ListLinPlot I build a graphic. My question is - Can I find the function using points? I mean find formula/function f(x) if I know only points.For an example :{{2,5},{3,7},{7,15},{9,19}}So the answer will be:F(x)=2x+1It was easy example, but my graphic is not a liner function. The blue line is my function. I changed picture that better describe the problem...Read more

In Mathematica, what does @@@ mean?

I've been working through problems on Project Euler, and some of the solutions that other people have posted use a triple-at-sign, i.e. '@@@'. In the help browser for v7, I find an entry for @@ (which says it's the infix version of 'Apply') but none for @@@. What does it mean?EDIT: Here's an example, which I think I can post without violating the spirit of Project Euler:bloc[n_, f_][t_] := {f @@@ #, #~Tr~f} & /@ Join @@ Partition[t, {n, n}, 1];...Read more

linear algebra - Solving vector equations in Mathematica

I'm trying to figure out how to use Mathematica to solve systems of equations where some of the variables and coefficients are vectors. A simple example would be something likewhere I know A, V, and the magnitude of P, and I have to solve for t and the direction of P. (Basically, given two rays A and B, where I know everything about A but only the origin and magnitude of B, figure out what the direction of B must be such that it intersects A.)Now, I know how to solve this sort of thing by hand, but that's slow and error-prone, so I was hoping ...Read more

compiler optimization - Mathematica: using simplify to do common sub-expression elimination and reduction in strength

So lately I have been toying around with how Mathematica's pattern matching and term rewriting might be put to good use in compiler optimizations...trying to highly optimize short blocks of code that are the inner parts of loops. Two common ways to reduce the amount of work it takes to evaluate an expression is to identify sub-expressions that occur more than once and store the result and then use the stored result at subsequent points to save work. Another approach is to use cheaper operations where possible. For instance, my understanding is...Read more

Integrating notebooks to Mathematica's documentation center

If you have been using Mathematica for a while you probably have grown attached to the documentation center. There is always something new that you find in those pages. Let it be options for a function or just some examples that at some point did not seem useful to you.It is likely that you have written packages with your specialized functions that you use all the time. Sometimes you might think of a neat example to use with your function but it is likely that it ends up being forgotten somewhere in your hard disk. If you had written it to the ...Read more

wolfram mathematica - What are the benefits of switching from Rule and /. to OptionsPattern[] and OptionValue in a large application?

Old habits die hard, and I realise that I have been using opts___Rule pattern-matching and constructs like thisoption /. {opts} /. Options[myfunction] in the very large package that I'm currently developing. Sal Manango's "Mathematica Cookbook" reminds me that the post-version-6 way of doing this is opts:OptionsPattern[] and OptionValue[thisoption]. The package requires version 8 anyway, but I had just never changed the way I wrote this kind of code over the years.Is it worth refactoring all that from my pre-version-6 way of doing things? Are t...Read more

wolfram mathematica - Doing probabilistic calculations on a higher abstraction level

To the downvoters: this isn't a question about mathematics, it's a question about the programming language Mathematica.One of the prime characteristics of Mathematica is that it can deal with many things symbolically. But if you come to think about it, many of the symbolic features are actually only halfway symbolic. Take vectors for instance. We can have a symbolic vector like {x,y,z}, do a matrix multiplication with a matrix full of symbols and end up with a symbolic result and so we might consider that symbolic vector algebra. But we all kn...Read more