Questions tagged [core-language]

Questions on the basic structure of the Mathematica language (Wolfram language) including atomic data types, syntax etc

Filter by
Sorted by
Tagged with
3
votes
1answer
106 views

Alternatives in pure function construction

When I declare a function f in the following form: f[a|b] := 1 then I can use it like: ...
3
votes
1answer
38 views

Type formation rules for 1-position expressions

I made a summary of the rules for formation of types for simple 1-position expressions, as I understand them. Here it is in textual form: A symbol, say, α, is a discrete entity, represented by a ...
0
votes
1answer
45 views

Debugging code with Plot function. Full details

This is some code: The first plot (with the f[x,3]) gives me a graph. The second plot (with the 'numerical' form of f[x,3] given) does give me a plot How can I fix this so that the first line gives me ...
11
votes
1answer
273 views

What is the relationship between the Wolfram executables? Where is this documented?

The relatively new wolframscript now accompanies the traditional math and wolfram binaries. ...
3
votes
3answers
130 views

How to swap SetDelayed expressions?

Suppose, there are two delayed expressions D1:= RandomVariate[UniformDistribution[{-1, 0}]]; D2:= RandomVariate[ UniformDistribution[{0, 1}]]; ...
1
vote
2answers
70 views

What are the limitations of RecurrenceTable?

Background Consider a recurrence relationship defined in terms of the following recursive functions (which works correctly): ...
3
votes
1answer
64 views

Conditional Output of Solve as a piecewise function

I am solving a set of equations, and Solve gives me (as expected) conditional assignment rules. Now I would like to define a piecewise function with that output, and use both the solutions and the ...
2
votes
1answer
42 views

alternative approaches to selecting elements from two vectors conditional on a third

The following will convey the idea: build a new vector based on an existing condition (boolean) vector. For simplicity, I'll build the conditioning vector (cond) in ...
1
vote
1answer
55 views

Assiging Plot Range to Variables Works For X but Not Theta

Observe the following Mathematica code: ...
0
votes
2answers
41 views

Create list of functions, domains, and iterate over (compare to Python code)

In Mathematica, I want to do a mass export of many different animated plots of specific functions with different domains. Because I don't necessarily want the plots to always have exactly the same ...
1
vote
1answer
27 views

Substitute a function

In the following code, I'm trying to substitute Sin[x] for f[x]. What's the right way to do it so that f'[x] gets replaced with <...
0
votes
0answers
46 views

What is the best way to remove dataset rows with missing values?

Consider a rectangular dataset produced by SemanticImport from a CSV file where the first row has the headers. Some values are Missing. I want to delete all the ...
1
vote
0answers
42 views

Intervals v.s. Domains: when to use which and why?

or: How to use Interval correctly? Mathematica provides these constructs for various symbolic deductions tasks. Among those constructs are symbolic number sets ...
0
votes
1answer
69 views

Strange little bug: Simple real number replaced by Times[0.805`, \.00] [closed]

I had a bug in my code which I tracked down to the simple number 0.805. So I looked at the FullForm of this number and I got Times[0.805`, \.00] It isn't a big ...
1
vote
0answers
82 views

Converting negative value to zero [closed]

I would like to convert the negative outcome of $r_2$ to zero. I have used the following code, but it still gives me a negative value. Is there any option to turn the negative outcome directly to ...
2
votes
0answers
62 views

Should I redefine 0^0 [duplicate]

I've found some times, while playing with combinatorics, that Mathematica can't calculate some functions because $0^0$ is not defined as $1$. (I know that some people think that $0^0$ should be left ...
1
vote
2answers
107 views

'Do' loop acting on a global variable

I need a code that will allow me to alter a matrix (a global variable) iteratively using a function update (which depends on ...
0
votes
1answer
43 views

Expression unexpectedly not evaluating to a numerical value [closed]

When I calculate the below, I get an unexpected output, not giving me the density, but rather a value M * .. ...
3
votes
2answers
66 views

Basic replace with parameters questions

I have looked over MMA SE but seen nothing to help clarify this for me. what I want to do is set some parameters for a curve, and then I want to automatically replace the x,y,z of, say, a vector field ...
16
votes
1answer
339 views

Broken ValueQ function in Mma12.2?

f[x] ^= 1; ValueQ[g[x]] returns True in Mathematica 12.2. Is it a bug?
1
vote
0answers
34 views

How to Inherit Arrowheds size?

I'm trying to write a Module that produces some arrows with custom Arrowhead shapes. However, I want the code external to the <...
0
votes
0answers
27 views

does Mma provide exact critical values of Mann Whitney U (small samples)

Does Mma provide exact critical values for the Mann Whitney U test, along the lines of haskell? Or just as good, for given two small samples, can I easily ask ...
8
votes
0answers
245 views

InLine TeX input seems unstable

In the documentation of version 12.2 there is a new feature to input TeX as mentioned by Stephen Wolfram. See: InlineTeXInput in the documentation. After typing CTRL$ you can type in some TeX, and ...
0
votes
0answers
40 views

The command Total sums the entries of a list, is there a comparable command for the product of entries of a list? [duplicate]

I recently just found out about the command Total that gives the sum of a list. Was wondering whether there's an analogue that gives the product of the entries of a list? I see that there is the ...
1
vote
0answers
73 views

Can you create an indexed list of all Wolfram functions within a notebook? [closed]

Can you create a summary list of all Wolfram functions used within a whole notebook? Searched long and hard- no clear documentation found.
3
votes
0answers
86 views

How do I get built-in functions to use custom objects as if they were e.g. List?

(This is part 2 of my earlier question, Can I overload Part for specific heads (a la overloaded array subscripting)?, which was well-answered as asked.) Overview: My goal is to create a custom object -...
6
votes
1answer
118 views

Undefined Indexed Variable

I searched already a lot about indexed Variables, and it tends to be the most applicable way to use tensor notation. But I am having a hard time to solve for undefined indexed variables: Here my ...
1
vote
1answer
92 views

Can I overload Part for specific heads (a la overloaded array subscripting)? [closed]

Mathematica/Wolfram Language newbie here. The behavior I am after is to be able to "overload" the subscripting of me-defined objects/Heads and thereby use them as if they were ...
2
votes
0answers
24 views

Should `DiscreteLimit` work when the argument type is specified?

Is it expected that DiscreteLimit fails to evaluate whenever the argument type is specified? E.g., ...
0
votes
1answer
68 views

Computmg the powers of a complex number? [closed]

this is the complex number im dealing with zb=(1/7)* (Cos[Pi/3]+I Sin[Pi/3]) I need to represent for the first 10 powers in the plane. I also need to label the ...
0
votes
0answers
67 views

Why does Log[Abs[#]] return a complex number?

For a nonzero number $x$, $\log|x|$ should be a real number. Why does the following NestList contain non-real numbers when no numbers involved are close to zero? Is it a bug? ...
1
vote
0answers
41 views

How to eliminate a variable from coupled ODEs?

I found this question with an answer: How to eliminate variables in ODE? ...
4
votes
3answers
283 views

How to programmatically modify a function definition

I would like to know an efficient method (without converting Mathematica Code to strings and string processing) of modifying a function definition programmatically. For example, I would like to tidy ...
2
votes
0answers
89 views

Why Does Subsets[…,{n}] not Output a Packed List, Even Though it Doesn't Unpack?

Assume list is packed. I expect Subsets[] is a structural operation because it depends on the number of elements, not on what ...
0
votes
1answer
25 views

Speak misses words when executed first time in new cell

Version->12.1.1 for Microsoft Windows (64-bit) (June 19, 2020) ReleaseID->12.1.1.0 (6959458, 2020061902) PatchLevel->0 When I evaluate for the first time in a new input cell: ...
3
votes
0answers
166 views

Vector arrow notation in Mathematica

I want a fast way to type vectors in Text boxes like this: $\vec a$ I can do this manually with ctrl+7+"-> " which creates this ...
11
votes
2answers
249 views

i_:0|1 varies in v12.1: incompatible change or bug?

Just check i_: 0 | 1 // FullForm In v12.0 or earlier the output is Alternatives[Optional[Pattern[i, Blank[]], 0], 1] But in ...
0
votes
0answers
47 views

Extention of Times operation causes bug in Expand?

I have the following code in Mathematica 11.01 : ...
2
votes
1answer
46 views

Splice matching function arguments

Mathematica 12.1 introduces Splice that replaces the old way of using Sequence@@ to "melt" a list of entries. However, the ...
1
vote
1answer
193 views

How do I evaluate my functions over a range of values? [closed]

I want to use the list of data which will come from MapData1 (in code); the first element is θ and second is Action(I). I want to use this Action(I) and Angle(θ) in ...
3
votes
1answer
48 views

Evaluate a Number head as a constant function

I wanted to use the parameters of a function in a distributive way, so for example In[1]:= Through[(Cos+Sin)[x]] Out[1]:= Cos[x]+Sin[x] It works without problems ...
1
vote
1answer
35 views

Help with Evaluation controll/hold all attributes?

I'm making a sort of symbolic derivator, which needs to take its formulas in unevaluated form. ...
1
vote
0answers
42 views

If it possible to define a “function” such that the normal form will have the arguments in order? [closed]

I'm looking for something that acts like this. How could ord be defined for 2 arguments? What about n? Since Mathematica is a term-rewriting system it should be possible, but all my attempts were ...
5
votes
2answers
198 views

Is it possible to pipe(afterthought apply function) with options?

For example, I have the following ...
8
votes
2answers
387 views

How can I plot a parametric equation with ±?

I want to draw a parametric equation with ± like the figure below: But I don't get the result I want when I run the following code. What can I do to get it? ...
2
votes
1answer
64 views

odd output from DifferenceDelta

I would appreciate an explanation of why DifferenceDelta produces a complicated expression for a simple quadratic. I see that this is caused by the Real value <...
1
vote
1answer
58 views

Extracting argument of a specific functions in a large expression

I have a large expression, for example Cos[x]Sin[y]Sqrt[1+z]/(1+x^2)-1/(1+y) I wish to extract the argument inside Sqrt ...
13
votes
7answers
793 views

Getting the “root” Head

I have a dynamic list of function names, like {f1, f2, f3, ...}, and they will enter in computation in various forms ...
5
votes
1answer
156 views

How to label parameters in Manipulate

How do I label the "2" and "3" so they show "square" and "cubed" in Manipulate controls? The following is my code: ...
19
votes
6answers
1k views

A clean way to conceptually extract Parts from a circular list

I quite often run into a situation where I want to treat a list as a circular (repeating) list, and want to take a specific sublist of it, such as... One past the end of the list: ...

1
2 3 4 5
11