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
1
vote
0answers
34 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
63 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
81 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
60 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
94 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
42 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
64 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
313 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
33 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 ...
6
votes
0answers
179 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
72 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
81 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
99 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
84 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
67 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
65 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
40 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
260 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
86 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
23 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
112 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 ...
0
votes
0answers
14 views

How do I combine evaluated expressions with unevaluated expressions

I want this function PrintEvalExpr[Sin[Pi/2]] Which outputs Sin[Pi/2] == 1 I can either not evaluate, or evaluate but not at ...
11
votes
2answers
246 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
41 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
124 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
45 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
34 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
41 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
186 views

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

For example, I have the following ...
8
votes
2answers
380 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
63 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
45 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
790 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
124 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: ...
17
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: ...
7
votes
1answer
141 views

AtomQ[Counts[{a, c, d, b, a, c, b}]] gives True. Why?

I don’t understand this: In[]: AtomQ[Counts[{a, c, d, b, a, c, b}]] Out[]: True It looks like an expression. Does this have to do with the realization ...
1
vote
1answer
77 views

Implement a math command on a list of numbers [closed]

I have a set of numbers and would like to do the same math process on all of them. Example: data1={1,2,3,4,5,6} Then have each number processed as Log(1), Log(2),..... This seems like such a ...
6
votes
2answers
90 views

Assert no unevaluated function applications

Background Suppose I have begun a fresh kernel session, and I have defined the following function alone: F[x_, y_] := x + y; One expected use of ...
5
votes
1answer
83 views

Plotting a NumericQ-protected function with the attribute HoldAll fails

Fixed in 12.1 This works: ClearAll[f1]; f1[x_] /; NumericQ[x] := x; Plot[f1[x]^2, {x, 0, 5}] This does not: ...
6
votes
1answer
161 views

Are Hold attributes Mathematica's way to implement lazy pattern matching à la Haskell?

I'm reading this and I'm having a hard time understanding lazy patterns; in particular I'm baffled with the server-client toy problem and why there is a 'problem' of matching "...too early". The ...
2
votes
1answer
75 views

Domain of `Sqrt[x]^2`

I'm just starting to work with Mathematica and this is simplified version of the problem I have: seems that Sqrt[x]^2 simplifies to just ...
1
vote
2answers
54 views

Assign numerical values to symbolic variables in a vector inside a do loop

I have vector k = {k1, k2, k3, k4, k5, k6}. I would like to assign numerical values to the elements of k in each step of a <...
3
votes
0answers
117 views

Calling custom function from C++

I'm programming a project where I use multivariate symbolic polynomials. At some point I need to perform a PolynomialMod over a prime modulus, but the library GiNaC which I use works only over the ...
0
votes
1answer
39 views

is the behavior of WriteString surprising?

WriteString["temp.txt","this string"] returns Null but creates an open stream which is reused if you again ...
1
vote
1answer
82 views

How to clear all variables? [closed]

I have noticed that the old trick of using: ClearAll["Global`*"] does not appear to work anymore. It does not clear the values of any of my variables. I assume ...
3
votes
1answer
78 views

Understanding how List head works

I am trying to understand how Wolfram Language is actually meant to work and here is something that I fail to understand. Apply[f, expr] replaces the head of expr by f. So how come I get different ...

1
2 3 4 5
11