Questions tagged [code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
1answer
138 views

A system of nonlinear ODEs

I am working with Mathematica to plot a system of Nonlinear ODEs, I did a program but it doesn't work. I don't know exactly where is the problem? If someone kindly can help with a remark or a ...
0
votes
0answers
67 views

How to convert a Python code to a Mathematica code?

I've written the following code in Python. I want to write this code in Mathematica but I don't know Mathematica. How can I convert this code to a code in Mathematica? Thanks in advance. ...
1
vote
0answers
34 views

Show Code Assist

I want to cancel the Auto Popup in the options menu. It turns to False but when I come back to the code it turns to true again. I clicked in Apply. I need to turn it off because it sometimes does not ...
1
vote
0answers
69 views
0
votes
0answers
31 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
48 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
71 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
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 ...
1
vote
2answers
56 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
83 views

Getting two different results for the same computation

I have the following two codes: ...
2
votes
0answers
56 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
41 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
52 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?
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
61 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
57 views

Alternative to Coefficient List

I was using CoeffientList to get the probabilities of this generating function... ...
5
votes
3answers
364 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
99 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
77 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
78 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
100 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
170 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
78 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
76 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
55 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 ...
2
votes
1answer
145 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
244 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
91 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
43 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
84 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
61 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
81 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
60 views
4
votes
1answer
77 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,...