Questions tagged [code]
The code tag has no summary.
77 questions
0
votes
0
answers
54
views
How can I colour the code? [duplicate]
I would like to colour the code like in this example:
Searching through the posts I have found that I should add code like this
...
1
vote
0
answers
76
views
Figuring out if I have a mistake or bug in computation of series expansion
I am trying to do some expasions of elliptic integrals. For that I need the following expansions first
...
0
votes
0
answers
88
views
How to design code for solution of the system of Equations?
I am studying a research article of fluid mechanics with title ``Influence of mixed convection nanofluid flow over a rotating sphere in
the presence of diffusion of liquid hydrogen and ammonia''
The ...
2
votes
2
answers
121
views
Simple example of running one notebook from another [closed]
I have two notebook codes 'calculation.nb' and 'caller.nb'. The first code simply generates and prints a random number. The second code I want to use to call the first code a set number of times (say ...
0
votes
1
answer
155
views
Converting HurwitzZeta function to PolyGamma function
A generalization produces a result in terms of Zeta[s,a] function, which can be converted to PolyGamma[s-1,a] using the ...
1
vote
0
answers
89
views
Help with a partial differential equation - inaccurate result
I'm trying to solve the following partial differential equation using NDSolve
...
0
votes
0
answers
121
views
Using CrossEntropyLoss function for basic neural network
Hi I am interested in understanding how to use the neural network functions in Mathematica. I have just started learning hence this is a basic query. The simple example I am looking at is as follows: ...
2
votes
3
answers
445
views
Saving formatted code [closed]
I am writing some ODE notes with lots of pictures generated using Mathematica, and I'd like to include the code used to generate them.
Currently I have a notebook where all the pictures are generated. ...
0
votes
0
answers
45
views
Matrix subtraction not working [duplicate]
I am using Mathematica to solve a hw question.
I have the following code:
...
0
votes
0
answers
99
views
Part specification error
I am doing a solved exercise shared here.
However, while running the code, I encountered an error on page-8, under the Dynamics section.
with error :
I think this error is due to the absence of ...
0
votes
1
answer
98
views
How to find a conditional solution of inequalities?
Im trying to find the conditions of:
a>0,b>0,c>1,d>0
(a + (2 a - b/c) d + (a + b - b/c) d^2 + (-b + (2 b)/c) d^3 + (b d^4)/
c - (b d^5)/c) > 0
I ...
0
votes
1
answer
145
views
Why can't the denominator be rationalized for such a result?
The root formula of the output is rational for denominator, and the result of FullSimplify output is the same.
...
1
vote
2
answers
148
views
Defining and executing large matrix operators on vectors efficiently
For an $N$-qubit system, I am interested in coding, in an efficient way, the following set of Kraus operators $\{A_c\}_c$ defined in the computational basis as
\begin{align}
\hat{A}_c := \sum_{m=...
3
votes
3
answers
368
views
Graphic manipulation - Psychrometric chart
I'm working on a psychrometric chart on Mathematica. The code is as follows:
...
-1
votes
1
answer
102
views
Swap Composite Command Components
Let's take a composite Mathematica command:
A[B[]]
where A and B - two arbitrary ...
0
votes
0
answers
107
views
How do we define the function near the end of my post?
Suppose I have two sets $F_{1,n}$ and $F_{2,n}$ written as:
...
0
votes
0
answers
61
views
Problem with ToExpression and TexForm changing two variables multiplied together into one multi-lettered variable
I have a problem where if I multiply two variables a c in Mathematica, then copy as LaTeX (or just use the Mathematica output) to get a c, then put it in ToExpression["a c",TeXForm], I get ...
2
votes
1
answer
121
views
Strange effect in the SphericalPlot3D [closed]
I found something odd in Mathematica when using the SphericalPlot3D command.
Ranges for $x,y∈[0,2 \pi]$ are the same. All I do is swap sine and cosine.
But when I ...
0
votes
1
answer
101
views
Updating the association with answers from the TrigProperties Function
I have created a list of rules I would like to update with values. My goal here is to be able to write the following:
...
1
vote
0
answers
81
views
Help me understand a part of this code (using Clock) [closed]
I'm a begginer in Mathematica and I need help understanding a part of some code that I took and adapt from another question in this forum. The code is to animate one by one a list of points (with x,y ...
0
votes
1
answer
101
views
FoldList type evaluation for multivariable function
In the example code which follows I define a two variable conditional function h[_i, _v], one variable denotes the integer index i, and the other is an N-dimensional vector v (I denote dimension 'N' ...
0
votes
1
answer
226
views
The list of coefficients of the "polynomial", which has the order of derivatives instead of degrees
I have some equation
eqn = (A + B).x''[t] + Transpose[x'[t]].(2 A - 3 B + 1).x'[t] +(СС - 5).y'[t]+ Sin[x[t]+y[t]]
I need to collect all the coefficients at ...
4
votes
1
answer
202
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 ...
1
vote
0
answers
84
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 ...
2
votes
1
answer
91
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 ...