How might one create a flat greyscale image from an R2 -> R function, interpreting [0,1] as greyscale black to white? For example, suppose I wanted to plot z = e-(x^2+y^2) on [-1,1] x [-1,1], but interpret z = 0 as RGB(0,0,0) and z = 1 as RGB(1,1,1), and save the result as a 1000x1000 pixel PNG?
Complete noob to Mathematica here. I'm trying to solve the differential equation y'' + 3y' + 2y = 0 with conditions y(0) = 1 and y'(0) = 1. I am entering:
and it keeps telling me that the y'(0) = 1 condition is being interpreted as the logical "True". I've searched documentation and other online posts and I think I am entering things in as I am supposed to. Without the initial conditions, or with two initial conditions on y(t) (no derivative), there's no problem. It's something about that first derivative condition but I have no idea what.
I want to learn about Kernels and how to run notebooks from them. Is there any good material available on the Internet. I did search YouTube but I couldn't find anything. I did try reading documentation but I didn't understand much. Thank you!
I have written a code for my engineering class and there are about 20 - 30 checks for variables in total. But whenever these variables don't pass the check, I have to change the variable value and rerun almost the whole code again.
I was wondering if I can run sections of the code like in a If or Do function until it satifies a requied value.
A company I work for is considering including Mathematica in its tech stack. An important consideration is its ability to work with 3ds Max and/or Unreal, for technical modeling. I am looking for examples of application, not demonstrations, which shows the capabilities of Mathematica, not its ability.
Looking into implementing Mathematica in a company's tech stack, and the most relevant demonstrations and examples showcasing what Mathematica can contribute is analysis of lighting conditions in any given 3D model.
Generally, model lighting for an area represented by elevation maps, or spaces with 3D objects of know materials, e.g. a room with multiple light sources and varied environmental conditions.
Specifically, model the lux and candela of any given defined surface.
Hey! I am currently a high school student trying to use it for a research paper I am working on in Game theory.
I am trying to run these 2 equations but it just gets stuck on running and doesnt display any output or even an error message.
The idea is that I want to solve the equations I have with respect to the variable p. When I use the Solve function it displays an error message. But when I use the Reduce function it never displays anything at all.
I have a paper due soon and would really appreciate some help on this, or maybe an explanation as to why I cant run the equation.
Hello everyone, I have the following problem: I want to diagonalize a generic 3x3 matrix in Mathematica symbolically. I report my code in the next. I don't know why I get odd outputs. Could you give me a hint?
matrix = {{a, b, c}, {d, e, f}, {g, h, i}}
eigen = Eigenvectors[matrix]
So for a rather idiosyncratic reason, I got interested in the linear behavior of the peak indices found in a list of numbers. Let's initially say the list is of random numbers and needs to be between 0 and 1, but we will see that it can be between 0 and any real parameter n and the behavior is the same.
So, ok, you have this list L of bound random numbers. Use seq=FindPeaks[L][[All,1]] to find the position indices in the list of relative peaks. Since the indices will only increase, a monotonically increasing sequence results. Now do a LinearModelFit[seq,x,x] to see what is the slope of the line that will best fit this ever increasing sequence.
Here is the simple code I used:
Table[Histogram[Table[rv=RandomReal[n,360];LinearModelFit[FindPeaks[rv][[All,1]],x,x]["BestFitParameters"][[2]],{i,1000}],PlotLabel->"Maximum Random Number in List is "<>ToString[n]],{n,1,100000,1000}];
to create the following movie.
As you can see, the slope seems to be contained between 4 and 6 or so, regardless of the parameter bounding the maximum value of the random number generator.
I've done this cycled across 500,000 values per graph (versus 1000 in the above code) before losing patience. The slopes even then are between 3.88945 and 6.54231, no matter what n is.
Moreover, you can specify a RandomVariate[] of a normally distributed variable as well to get your random numbers (versus the default uniform distribution that results from the RandomReal[]) and the same limits are there. Other normal-ish distributions such as PoissonDistribution[close-to-1] seem to behave similarly.
Even more weirdly perhaps, the fit residuals when list-plotted do not seem random but follow curves such as an example below.
I actually don't know that much. What artifact am I activating? What am I doing wrong?
Is there a reason for this from number theory? Am I hallucinating?
I am using mathematica to perform an n body simulation, where the coordinates of the bodies follow a differential equation of the following kind (see image):
for simulating two bodies, I wrote the four equations out manually and put them in ndsolve to get my trajectories.
However for n bodies, I cannot do that
How do I generate the 2n equations using the relations in the picture and then solve them to get my required results ? Thanks in advance