Pierre ALBARÈDE
  • Member for 6 years, 1 month
  • Last seen this week
Using Mathematica for tensor analysis
5 votes

The link for Tensorial above is dead, you may find something interesting on J. F. Gouyet's page. I prefer in general not to use packages and make my own simple cooking. Also there are two functions ...

View answer
OptionsPattern does not match rule with compound left hand side
4 votes

When OptionsPattern[] is used, OptionValue@k2 is supposed to work too, so behind the scene there is something like k2/:OptionValue@k2=3 which fails if k2 is replaced by f1[k2]: you would get a "...

View answer
Is Mathematica an Implementation of the Wolfram Language?
4 votes

The Wolfram language is more an informal abstraction than an implementation of Mathematica. A formal or normative definition does not exist yet after many years but three important events have ...

View answer
Manipulating a list to make it nested
3 votes

{x, y, g, a, b, c} /. {x_, y_, g_, next___} :> f1[{{x, y}, g}, f2@next] and replace f1, f2 by whatever you need.

View answer
Can Mathematica help to rearrange an equation?
3 votes

Since the question was asked, AddSides etc *Sides have been added to Mathematica for the purpose. Simplify makes some things automatically.

View answer
Solving a system of 4 linear equations with 4 variables
3 votes

Replace simplify by Simplify. To begin with, make sure that all coefficients have numerical values before launching Solve so that the solution will also be numerical. Then try again by clearing some ...

View answer
Is Function broken is this example?
2 votes

The actual output is Function[0, 999][0]. I have guessed (I hope correctly) that the expected value was 999 as from Function[a, 999][0]. In Trace[f[999], TraceOff -> Message], the essential part ...

View answer
Is Mathematica an Implementation of the Wolfram Language?
2 votes

By analogy with Python for example, I suggest that the Wolfram language be everything that can be interpreted in the command line. e. g. wolfram on the Raspberry pi or mathematica on other machines. ...

View answer
Function incorrectly renaming variables in Rule Pattern
2 votes

In[28]:= q_ -> # &@2 Out[28]= q_ -> 2

View answer
How can I remove a horizontal line I inserted into my notebook?
2 votes

v12.2 update. If you have just inserted the line, then Undo will remove it. If the line is at the same height as an edge of the right bracket of a cell, then select this cell, go to menu Insert > ...

View answer
Is Mathematica an Implementation of the Wolfram Language?
1 votes

I add an answer because I need more space. Consider for example Wolfram for Software Developers and more particularly the link Wolfram language for Jupyter. The Wolfram language being passed to ...

View answer
Sow and Reap returning different results for the same expression
Accepted answer
1 votes

You play a syntax puzzle. In order to see what is going on: {Sow[1]; 2; Sow[3]; 4; 5} // (Reap1 /* Last1) (* Last1[Reap1[{5}]] *) The Last of a Reap that sows nothing is obviously the empty list. {...

View answer
Using the solution of AsymptoticSolve into another function
1 votes

The normal way is simply FD1[(d - 1)/t, η] - FD1[(d - 1)/t, η - vd]/.AsymptoticSolve[eqn, {ηs, 2^(-(t/d)) nd^(t/d)}, {vd, 0, 2}]

View answer
CDF deployment issues
1 votes

I can answer on that: Why the hell is there no straightforward way to embed entire custom stylesheets in a notebook? Don't hack this on any important document! Open the notebook where you want ...

View answer
Limiting the Domain of a Function
Accepted answer
1 votes

Try f[t_] := 0 /; 0 < t < 1 see also Step and PieceWise in the documentation.

View answer
Finding the roots of quintic equation
Accepted answer
1 votes

For Newton FindRoot[{x^5 - x + 1 == 0}, {x, 1}] Then check the details with Options@FindRoot Check in the documentation the option Method in particular. For the bisection method, NSolve may use ...

View answer
Plotting a complete response to an oscillation; already have particular solution, not sure how to solve for constants in homogeneous solution
1 votes

In general you would use Solve but here it is straightforward: C1=0.2-xp[0] and I let you write the initial equation for C2.

View answer
How can I define an alias for OptionValue?
1 votes

In your program you can replace "a" by a to make it more general. As Mathematica is symbolic, you don't need to quote symbols. Replacing x by OptionValue@x or even OV@x in a complex expression may ...

View answer
How to edit stylesheet to change automatic numbering of Reference type to numeric, not alphabetic?
Accepted answer
1 votes

Let me rephrase as a recipe. Do Format > Edit style sheet. The private style sheet opens: it is a notebook titled "Private style definitions for [your notebook]". In this notebook, click on the link ...

View answer
Writing a program to convolve two inputs
1 votes

Without ListConvolve: myListConvolve[kernel_, list_][n_] := Dot[Reverse@kernel, Take[RotateLeft[list, n - 1], Length[kernel]]] example: myListConvolve[{x, y}, {a, b, c, d, e, f}] /@ Range[5] ...

View answer
Steady State case for differential equations
1 votes

The equations reduce to algebraic : {0 == (1 - x)*x + q y - x y, 0 == -q - x y + 2 f z, 0 == x - z} You can use Solve or NSolve.

View answer
How to force Mathematica to do infinite-precision calculations?
0 votes

"I want to get a decimal representation" is not compatible with infinite precision because some rational numbers like 1/3 have infinite decimal representation that does not fit into a ...

View answer
Superscripts and subscripts in graphics causes italics
0 votes

An example, just to summarize the main points: test = Text[ Style[#, FontSlant -> Plain, FontSize -> 32], {0, 0}] & /@ {Indexed[P, {i, j}], P} Graphics /@ test Graphics[#, ...

View answer
Numerical simulation
Accepted answer
0 votes

You get a lot of red ink. Try to simplify. Avoid complicated notations. The most useful formula: f1[x_,y_]:=f2[x,y] where f2 must not call f1 to avoid recursion (unless you want it). Don't use ...

View answer
Implement the Bisection algorithm elegantly and easily
0 votes

My program is not bad but has design flaws: the Rational option is useless and the interface will fail in certain cases. So I need to update: Attributes@bisection = {HoldAll}; bisection::...

View answer
Implement the Bisection algorithm elegantly and easily
0 votes

Attributes@bisection = {HoldAll}; bisection::nochangeofsign = "sign does not change, try other bounds"; Options@bisection = {AccuracyGoal -> $MachinePrecision/2, Rational -> False}; Clear@...

View answer
Is WM able to solve PDEs (non-linear with variable coefficients) with variable initial conditions?
Accepted answer
0 votes

Question 1 : pressure is arbitrary for any uniform shift because the gradient of uniform function is zero. There is little relation between the downstream BC and the initial conditions on pressure. ...

View answer
Is WM able to solve PDEs (non-linear with variable coefficients) with variable initial conditions?
0 votes

[Sorry this is comment again but does not fit in the box so I put answer again.] I have had a look at the tutorial and the program. There is inconsistency in your question but maybe not in the ...

View answer
Is WM able to solve PDEs (non-linear with variable coefficients) with variable initial conditions?
0 votes

Very interesting but not clear. "initial pressure value from 𝑝(0,𝑥,𝑦)=0" so first coordinate must be time. Then "the boundary condition says 𝑝(0,𝑥,𝑦)=0,𝑥==𝑒𝑛𝑑". If the first coordinate ...

View answer
How to check if an arbitrary equation is a polynomial?
0 votes

I suspect that the problem is undecidable, except for particulars classes of expressions, e. g., rational expressions.

View answer