Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

RS232 send string with quotation marks, encoded in a given page code

I managed to communicate via Wolfram Connected Devices Project, with the GDS2072A oscilloscope. The communication was made through the COM5 port, RS232. I successfully tested the connection with the ...
2
votes
1answer
35 views

Counting the number of elements

I have the following output: {{{0, 1}}, {{1, 1}, {1, 2}}, {{2, 1}, {2, 3}}, {{3, 1}, {3, 2}, {3, 3}, {3, 4}}} Using Length[] on ...
1
vote
2answers
70 views

To write mathematica code for summation using a given data

I am given a set like some terms from the partition of $20$: $\{\{17, 3\}, \{13, 7\}, \{11, 3, 3, 3\}, \{7, 7, 3, 3\}, \{7, 5, 5, 3\}, \{5, 5, 5, 5\}\}$. From the above data, $20= \underline{1}*17+\...
4
votes
3answers
242 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 ...
1
vote
2answers
50 views

Filtering solutions in PowerRepresentations

I have the following code: PowersRepresentations[10400, 7, 2] This produces Length[PowersRepresentations[10400, 7, 2]]=433789 ...
2
votes
1answer
74 views

Getting two different results for the same computation

I have the following two codes: ...
2
votes
0answers
51 views

Microcontrollerkit No longer compiles code after update

I recently restarted a project where I used MicrocontrollerKit to generate code for me into the Wiring language to be then imported into arduino IDE for editing and ...
0
votes
0answers
39 views

How to deal with unknown variables in NSolve?

I am trying to solve these equations by using NSolve and want to plot $p1^{2}+p2^{2}$ v/s P0. But there is some problem, it is showing running... but not showing any error. I don't know where I am ...
1
vote
1answer
44 views

How to unprotect/see the code of a command in Mathematica [duplicate]

How do you see the code form of a command in Mathematica? I know there is a command in Mathematica, "Unprotect[]", but how do you actually use this?
0
votes
0answers
21 views

InverseFourierSequenceTransform[F[kx,ky],{kx,ky},{x,y}]

Background: InverseFourierSequenceTransform is a very useful tool which makes it convenient to write a momentum Hamiltonian in real space. For such calculations some times I need for example following ...
1
vote
1answer
54 views

Formatted/modified Mathematica command

I know there is a way of making your own commands that outputs your desired information but I'm not sure how to do this. How do you format/modify/make your own command that outputs what you want. E.g. ...
2
votes
1answer
49 views

Implementing binomial expansion of (non-commuting) matrices in Mathematica

Given two matrices $A$ and $B$, their Binomial expansion is, in general, given by (see this page) $(A+B)^n = \sum\limits_{k=0, k=n[2]}^n \Bigg( \sum\limits_{r=0}^k \binom{k}{r} A^r B^{k-r} \Bigg) \...
0
votes
0answers
50 views

Alternative to Coefficient List

I was using CoeffientList to get the probabilities of this generating function... ...
5
votes
3answers
342 views

Writing a program that divide numbers until I hit a one digit number

Well, I have the following question: How can I write a program such that an input number $n$ is divided by the number $k$ as long as the resulting number does not have one digit, if the resulting ...
2
votes
0answers
73 views

How to use Mathematica code in LaTeX files?

How can you use Mathematica code in LaTeX files? any similar to A random number is RNUMBER and the square of RNUMBER is RNUMBER^2 appearing numbers instead the capital letters (or Mathematica code) ...
0
votes
0answers
75 views

How can I wirte Mathematica code in microsoft word

What I am trying to do is write Mathematica code in Microsoft word because I am doing like tutorial, so how can I insert code with the form in the picture. As an alternative what I am doing is to ...
0
votes
1answer
73 views

How to plot the roots of two complex equations?

I have these two equations as two variables '$a1$' and '$b1$', mentioned below and I want to plot the roots of $a1^{\dagger}*a1$ with respect to P0, which will give me bistable plot with three values. ...
0
votes
2answers
91 views

Solving a system of equations using the data generated by PowersRepresentations and ParallelTable

First of all, it is possible to check the code that I am asking for because I know that $x=3051$ must yield at least a solution to the problem. Well, I have the following system of equations: Now, I ...
3
votes
2answers
162 views

Finding 36 integer solutions to a set of 14 equations using various boundary conditions

What is good way to solve this system of equations? I have it run now for quite some time and it does not spit out a solution. ...
1
vote
2answers
65 views

Solving a big system of equations using certain conditions

I have the following problem: I want to solve a big system of equations for a certain number of variables which I call $a_k$, the variables need to satisfy the following conditions: all $a_k\in\mathbb{...
1
vote
1answer
64 views

Computing limits from the left and right and getting the same answer which isn't correct

When I use the following code: ...
0
votes
1answer
46 views

How do I assign values to variables which comprise a matrix?

I have a m x n matrix (5 x 5) and I wish to assign values for m1,m2, m3, etc and n1, n2, and n3 etc, without changing the a[m x n] values. I'm not looking so much for a direct solution but maybe a ...
1
vote
0answers
71 views

Solutions given by WolframAlpha [closed]

When I try to solve, the following equation over the integers using WolframAlpha: $$x^2(1+x)=y(3y-1)\tag1$$ WolframAlpha gives me the following solutions $(x,y)$: $$(-1,0),(0,0),(1,1),(4,-5),(6,-9)\...
2
votes
1answer
56 views

How to find the distances between two adjacent maxima in a solution from NDSolve

I try to find a general approach to plot the time evolution of horizontal distances from maximum to maximum in a solution of PDE. The solution u[x,t] normally have ...
4
votes
3answers
236 views

Writing a program that will filter the integer solutions

I've the following equation: b==(-12 + Sqrt[3] Sqrt[ 3 (-4 + r)^2 + 12 a^2 (-2 + r) - 4 a (-5 + r) (-2 + r) + 4 a^3 (-2 + r)^2] + 3 r)/(6 (-2 + r)) ...
4
votes
1answer
86 views

Why is my version of Euler's Method not working?

I am creating Euler's method for $\frac{dw}{dt}=(3-w)(w+1)$ for $\Delta t=0.5$ from $0\le t \le 3$. I tried the following. ...
2
votes
1answer
40 views

Finding the 3D-model of a function that is rotated around the x-axis

How can I find the 3D model that is created by revolving the function: ...
2
votes
3answers
70 views

Find the number of true's in a TrueQ expression

How can I find how many times the code: Table[TrueQ[FractionalPart[Sqrt[n]] == 0], {n, 1, m, 1}] Gives the value True back for a variable $m$? So, we know that ...
4
votes
1answer
60 views

Cantor type iterations in Mathematica

I am trying to draw the iterations of the IFS in which from an interval middle third is removed and in the resulting figure left line is shifted 1/6th to the right and right line is shifted 1/6th to ...
8
votes
0answers
75 views

Design Patterns for System Functions?

Using PrintDefinitions give one a great view into many system functions. Often the design of these symbols incorporate multiple patterns that I see again and again. ...
0
votes
0answers
53 views
4
votes
1answer
66 views

Strange bug in LUP Decomposition

I have written LU decomposition with partial pivot, but for some matrices, the entry L[[1,1]] isn't equal to 1 like it should be,...