# Questions tagged [code]

The tag has no usage guidance.

61 questions
Filter by
Sorted by
Tagged with
1 vote
73 views

### Solve system of ODE by fractional finite difference method

I am trying to solve the following system using fractional finite difference method: where e=0.1, a=1.3, m=0.3, p=10, g=3, k=1 and s1, s2, s3 it was mentioned in this paper that it is calculated ...
44 views

### How to solve this Third Order PDE using NDSolve; Showing some missing variable error

I just confuse why ***u[0,t]==Sin[\omega t] cannot be used as a variable error was showing ...
51 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 ...
61 views

### How can I calculate the negativity?

I tried to calculate the negativity that is defined as follows: $eq(1): N = Tr(Sqrt(A.A\dagger))-1$ The result should be ~0.41 in for example r~0.01 (when r is close to 0) and it decreases versus r. ...
53 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 ...
1 vote
160 views

### Order of Terms in Algebraic Expression

When I write an algebraic expression of the following form, B*OverBar[A]*C^3 + A*OverBar[C]*B B C^3 Overscript[A, _]+A B Overscript[C, _] the order of the ...
88 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
182 views

### Stepped Infinite Square Well [closed]

Here is the link for making the above graph for the Stepped infinite square well. The problem here is, all the eigenfunctions and energy eigenvalues are previously defined. Whereas, I want to use this ...
1 vote
72 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=...
227 views

### Finding a subset in the set of the digits of Pi

Well, I want to find the first position where the digits of Pi are {a,b,c,...,z}. So to find the first n digits of Pi and put them in listform I used: ...
252 views

### Graphic manipulation - Psychrometric chart

I'm working on a psychrometric chart on Mathematica. The code is as follows: ...
1 vote
234 views

### Can we solve the following integral by MATHEMATICA?

I am trying to solve the integral using the following Mathematica code. f1 = (t[m + 1] - t)^(\[Alpha] - 1)*(t - t[m - 1])*(t - t[m - 2]); ... 45 views

### Swap Composite Command Components

Let's take a composite Mathematica command: A[B[]] where A and B - two arbitrary ...
38 views

### Using barchart on outputs [closed]

I want to use barchart to make a plot with a series of outputs from the given command max1={max, arg} = NMaximize[{solutionI[t], 0 < t < 100}, t] here it is ...
71 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: ...
581 views

### Help understand a line of code

this is a weird question, but I read the following line of code: ...
38 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 ...
1 vote
103 views

### How do we find the limit of my code?

Suppose we have the following: ...
94 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 ...
1 vote
87 views

### Separating terms in an expression with many variables by their "nature"

I have an expression like this: $f=t_1(\sin(\alpha),\cos(\beta),\cos(\gamma)^2) \cdot r_1(x,y,z)+t_n(\sin(\alpha),\cos(\beta),\cos(\gamma)^2) \cdot r_n(x,y,z)$ Where $t_i$ and $r_i$ - functions of ...
42 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: ...
95 views

Could anyone please help with effectively defining a vector-valued function of tons of variables so that ...
1 vote
48 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 ...
1 vote
97 views

### How to solve ODEs using deep learning in Mathematica [closed]

I have a number of ODEs (58) with 16 parameters and 9 variables. I want to solve the ODEs to obtain the analytical relationship between the parameters and variables. It is obviously that the ODEs ...
47 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' ...
1 vote
73 views

### How can I access Mathematica on a more powerful machine remotely? [closed]

I have Mathematica installed on my machine. My code is taking a long time. It could be owing to my machine strength. Is there a way to run my code remotely on a cloud?
157 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 ...
32 views

### How to resolve problem during summation of functions?

I am trying to find out the output of this basic problem but getting an error. If anyone can resolve this will be helpful. ...
164 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 ...
250 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
49 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
72 views

...
63 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
77 views

77 views

### Alternative to Coefficient List

I was using CoeffientList to get the probabilities of this generating function... ...
647 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 ...
321 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) ...
83 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 ...
84 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. ...
111 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 ...
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{...