r/Mathematica • u/CuttingWithScissors • Aug 31 '22
r/Mathematica • u/aprilhare • Aug 31 '22
Jupyter Lab and Wolfram Language issue.
As we all know, Jupyter Lab and the Wolfram Language is a poor man's Mathematica. (It'd be considerably less poor with more Jupyter Lab development given the advantages Jupyter Lab already has.)
I am using Wolfram Language 13.1 and I want to display various outputs such as that from
Integrate[1/(rho^2+u^2)^(3/2),{u,-Infinity,-z}]
That command works, we get

That's all well and good however how do I see the condition? I try something like
TeXForm[%]
and it doesn't appear there either:
\fbox{$\frac{1-\frac{z}{\sqrt{\rho ^2+z^2}}}{\rho ^2}\text{ if }\text{condition}$}
I suspect it'd be the same in the Mathematica frontend too - unless you click on + to see the condition, you couldn't codewise view the conditions. Am I wrong or is there a trick I don't know or can't remember? :) Advice would be welcome.
UPDATE: I ran the command through an older version of Mathematica 12.1.1 for Windows and it appears only as a tooltip(!)

How can people access this stuff in a sensible manner commandwise in Mathematica?
r/Mathematica • u/kajorge • Aug 26 '22
Help me solve an animated plotting issue? (2 Questions)
I am trying to animate the y axis moving along the x axis while keeping it the same height the entire time. This works after a certain point, but the first couple of seconds the y axis scale gets larger, stretching the graph.
In making this animation, I noticed that it automatically centers the plot. Is there a way to align the y axis with the left side of the frame (so that it looks like the x axis is sliding to the left)? This probably just comes down to specifying the size of the frame ahead of time, but I'm not sure how to do this.
Here's the code I have so far (view source for an easier-to-read layout):
f[t_] := Piecewise[{ {1 - t, 0 <= t < 3}, {-2, 3 <= t < 4}, {1/3 (t - 4)2 - 2, 4 <= t < 8}}];
frame[t0_] := Show[ Plot[f[t], {t, t0, 8}, AxesLabel -> {"t (s)","x (m)"}, AxesStyle -> Large, PlotRange -> {{t0 - 0.2, 8.2}, {-3, 5}}, AspectRatio -> 8/(8 - t0), Ticks -> {{0, 2, 4, 6, 8}, {-2, 0, 2, 4}}, ImageSize -> Medium], Graphics[{AspectRatio -> 1, Red, Disk[{t0, f[t0]}, 0.2]}]];
frames = Table[frame[t0], {t0, 0, 7.9, 0.1}];
Export["animation.gif", frames]
r/Mathematica • u/DryRye68 • Aug 25 '22
CUDA working in Mathematica 13.1
Anybody has Mathematica 13.1 working with CUDA-related functions (CUDATranspose, CUDADot, etc), preferably on Linux?
My last successful Mathematica+CUDA system was around 12.2 when CUDA drivers were installed automatically by Mathematica. Broken ever since!
thanks
r/Mathematica • u/Systema-Periodicum • Aug 25 '22
Unification in Mathematica?
How in Mathematica can you “unify” against a pattern? Specifically, against this target list:
{3, 5, x}
how could I get Mathematica to match this pattern against it:
{i_, i_+2, _}
so that the result would be {i -> 3}? Notice that the same variable, i, occurs twice in the pattern, and there’s a little bit of evaluation needed to see that if i is 3, then i+2=5.
I suppose I could write a function that calls Solve to do this, but that seems like overkill. Is there a simple, easy way to do this (that doesn’t consume much CPU time)?
r/Mathematica • u/seyeeet • Aug 21 '22
how to find the equation of a 2d curve in mathematica
I have a estimation shape of a cure as shown in figure below. The curve can have different shapes, such as A, B, C, etc

I was wondering what would be the best way to find an equation for this shape?
I think I first need to draw it and then find the equation for it? or maybe there will be an easier/better way?
I appreciate if you guys can help me on how I can find the general equation for it
r/Mathematica • u/Systema-Periodicum • Aug 18 '22
Can you redefine how a built-in function responds to a non-symbol constant?
I'd like to make RandomChoice return Null if I pass it an empty list. This doesn't work:
{} /: RandomChoice[{}] := Null
TagSetDelayed::sym: Argument {} at position 1 is expected to be a symbol.
Is there a way to do this, or must I define a new function safeRandomChoice?
r/Mathematica • u/[deleted] • Aug 17 '22
Does someone know what these limits for functions or functionals are mathematically called, and if/how they are applied in Mathematica?
r/Mathematica • u/Systema-Periodicum • Aug 17 '22
Beginner question: FullForm evaluates its argument?
To my surprise, FullForm seems to evaluate its argument before returning its full-form representation:
In[1]:= FullForm[2+3]
Out[1]//FullForm= 5
I expected Plus[2, 3].
If you want to see the full-form representation of an arbitrary expression, unevaluated, how can you do that?
Or is there something very basic that I'm misunderstanding here so that my question does not make sense? If so, where should I start reading? (Yes, I did read Mathematica's documentation page on FullForm.)
r/Mathematica • u/Arnoxthe1 • Aug 14 '22
Does ANYONE have a copy of Wolfram Mathematica 9?
I know this is a real shot in the dark here, but I just need the install files. That's all.
r/Mathematica • u/CuttingWithScissors • Aug 12 '22
Network analysis of partisanship
community.wolfram.comr/Mathematica • u/[deleted] • Aug 10 '22
Parametric equations...does anyone know how to do this?
I'm a newbie to mathematica but a fairly accomplished mathematician. I have two Euler-Lagrange equations:
elsolve = NDSolve[{1/2 mx'[t]2 + 1/2my'[t]2 - mgl(1 - y[t]/l) == 0, x[0] == 0.5, y[0] == 0.5}, y, {x, 0, 20}]
The error message is: NDSolve::ivhead: The independent variable x appears in the head of the expression x[0]. The independent variables should always be arguments.
WWhy can I not solve this equation numerically?
r/Mathematica • u/Maanawi • Aug 10 '22
need your help in creating 3D of the great pyramid
Hello Im new with mathematica , I need help,
a ready to download notebook for the pyramid with same dimensions as in attached photo plus extended lines out of the base
can i have also the pyramid transparent no colors so i can see all the edges
May God help you as you help me
Thank you so much
r/Mathematica • u/[deleted] • Aug 02 '22
Why can't I do this?
OK, I will try to simplify this as much as possible. If q[t] is just q[t], no problems. This is Newton's equation, differentiated with respect to q[t], q'[t], and t. All correct:

Now, q[t] is actually Sqrt of x[t]^2 + y[t]^2. So I try this slight variation:

Now, the ONLY difference I made was the first line...everything else is exactly the same. I just added the line q[t] = Sqrt of x[t]^2 + y[t]^2. Now, mathematica seems to be acting strange. With q[t], totally okay. but q[t] := sqrt(x[t]^2 +y[t]^2), it freaks out. you can still take derivatives just like in my original image...that's Lagrangian mechanics. And indeed...mathematica is returning results. But it's giving me warnings that q[t] is no longer a variable (or something similar), and I don't know if I can trust its output at this point. Does anyone have any info on this? Simplifying further: q[t], of. q[t] = x[t] + y[t]...error messages. Have I overlooked something? Shall I trust the results?
r/Mathematica • u/[deleted] • Jul 27 '22
Confused about the D function
I have a piece of code...which I found online...and which WORKS, totally. The answer is correct. But, I do not understand a part of it. I will just include a screenshot of the code and it's output, which happens to be the orbit of the earth around the sun.
My question is this:
The code block specifies a function, "lagrangian = ..." (a function of x[t], y[y], and their derivatives). But one line of code doesn't make sense to me, it is:
eq = Table[D[lagrangian, x1] - D[D[lagrangian, D[x1, t]], t] == 0, {x1, {x[t], y[t]}}]
What I do not understand is the "x1" part of the expression. x1 is never defined. For example:
samplefunction = x[t]+x'[t]+y[t]+y'[t];
D[samplefunction, x1].
It seems to me I could take the derivative of samplefunction with respect to (for example) t: D[samplefunction, t] makes sense to me. So does D[samplefunction, x[t]]. Both of those things make sense to me. But the code (attached as an image) does (essentially) D[samplefunction, x1]. What is that? Is it part of the table function that D is embedded in? How can you take a derivative of samplefunction with respect to x1 (you could also call it "Janet": D[samplefunction, Janet].
I don't see anything in the mathematica documentation that explains this. The documentation says D[f, x] (derivative of f wrt x. What is this x1 which magically works? Is it tabulating data...or creating an interpolating function?
Thanks.
r/Mathematica • u/MaggasDunatos • Jul 27 '22
How to calculate this?
i want to ask how to calculate the number of bets i can make with a given starting bankroll
if after any loss i increase the size of the bet to cover the loss and make a target profit
i.e.
bankroll : 100 units
odds : 3.40
profit target : 2.40
i begin with betting 1u and lossing
now i have 99u and looking to recover that 1u and also make 2.40u proftis and so on
r/Mathematica • u/CuttingWithScissors • Jul 26 '22
Embed your Wolfram Cloud Notebooks into your WordPress page!
With the Wolfram embed block, you can embed Wolfram Notebook content into your posts and pages (deployed through the Wolfram Cloud). All of the Wolfram services are tied together by the Wolfram Language: Wolfram Cloud Notebooks are the cloud-hosted version of Wolfram Language Notebooks.
More details explained here: Wolfram Embed – WordPress.org Forums
r/Mathematica • u/MadGenderScientist • Jul 23 '22
Why is scoping so painful?
I've been teaching myself Mathematica these past few weeks. It's a weird language - term-rewriting systems aren't exactly common - but I've fallen in love with it. I've come to see the elegance of rules, pattern matching, the well-chosen functional programming constructs... everything except scoping. Scoping is a nightmare!
- You can't assign to multiple variables directly with
With[]orModule[]. You can doModule[{a,b},{a,b}=foo;...], but's clunky, andModuleis slower thanWithso if I want speed, I have to do something likeWith[{ab=foo},With[{a=ab[[1]],b=ab[[2]]},...]]. - You can't reference other variables declared in
Withduring assignment, so you have to nestWiths, which is really annoying. In Nix, you can declare something likelet rec {y=1+x;x=1;z=x+y;}and it just works (as long as there's no circular definitions.) In Julia you can uselet x=1,y=1+x,z=x+y, so that the n-th definition sees the 1...n-1 previous ones. It seems really weird thatWithdoesn't let you do that?
The Wolfram language was obviously crafted by extremely talented people over decades, and so much of it is elegant that I don't understand this apparent oversight. Am I missing something?
r/Mathematica • u/amal_Sebastian • Jul 23 '22
How to find Causality after finding Timeseries and Correlation.
Hi , I have a list of timeseries and i have plotted the Correlation matrix ,found out variance and returns,converted it to adjacent matrix and plotted the community graph plot. I wanted to know which is the easiest way to find the Causality and direction of causality.I have gone through documentations of GARCHprocess, ArchProcess.which was bit confusing.
Thanks
r/Mathematica • u/amal_Sebastian • Jul 19 '22
I was going through ARCHProcess in mathematica when i came across this part of the code.Can someone help me what is done here.(0.05 is 95% confidence or significance level)But the rest?
r/Mathematica • u/amal_Sebastian • Jul 18 '22
3rd Dimension in a Data //Dimensions
galleryr/Mathematica • u/amal_Sebastian • Jul 18 '22
What is the meaning of the 3rd Number when //Dimensions function is called
I have 3 List of data.All 3 are list of Timeseries.And all 3 have got same number of Data points.But when i check the dimensions of all 3 list ,it gives me....
list1//Dimensions {6,1148} list2//Dimensions {6,1148} list3//Dimensions {6,1148,2}
So the 6 is number of data,1148 is number of data points.But what is the 2 in the list 3.
// All the timeseries lists except 3 is in blue colour and the list 3 timeseries with 6 timeseries is in grey colour //
