Skip to main content

Questions tagged [scripting]

For questions about Wolfram Language Scripts (formerly known as Mathematica Script), or running the kernel without direct user interaction.

Filter by
Sorted by
Tagged with
0 votes
1 answer
58 views

I want to represent the function based on specific variables in Mathematica

I have a function call S11 and I want the formula simplified with variables: Q, k, wn. But I new with Mathematica, don't know how to do it. And I can't find the function doing this. Please help me ...
CTChang's user avatar
6 votes
2 answers
108 views

Detecting and converting a number from a video (digital panel) into an actual number

Let's say I have video (mp4) of length 02:17:38 (hh:mm:ss), this video is a record of a temperature panel, as shown in the following image. How can I use mathematica to extract the temperature, given ...
Hussain-Alqatari's user avatar
0 votes
0 answers
40 views

Suppress preliminary output from wolframscript

$ /opt/homebrew/bin/wolframscript -code "AirTemperatureData[Here,Now] // First" ...
Steven Buehler's user avatar
2 votes
0 answers
49 views

Evaluation break in WolframScript

Astonishingly, I couldn't find this either by googling or tag search here. CTRL-C completely closes WolframScript (on my Windows 10). But I just want to break the evaluation (if it takes too long). ...
Hauke Reddmann's user avatar
0 votes
1 answer
70 views

Splitting an audio into multiple segments based on the pauses

I am not an expert in mathematica, I wanted to Split an audio into multiple segments based on the pauses. I asked AI if that is possible, it said: "it is possible". It provided me a code for ...
Hussain-Alqatari's user avatar
1 vote
1 answer
143 views

2D momentum type equation for compressible fluids

I have this program which displays errors in the declaration of terms, I've tried to modify it several times but it displays the same errors, apparently in the declaration of the term $(v \cdot \nabla)...
Kamal Khalil's user avatar
4 votes
1 answer
94 views

Changing line breaks in WolframScript

Is there any command parameter for WolframScript that changes after how many characteres a continuation line is inserted? For example, using // MatrixForm output ...
Hauke Reddmann's user avatar
1 vote
1 answer
112 views

Shadow contour and parametric plot with mathematica

I am trying to find black hole shadow contour with respect to temperature. with metricf[r_] := -((2*M*r^2)/(g^3 + r^3)) + (8/3)*Pi*P*r^2 + 1. So here is my code, <...
Debojyoti Mondal's user avatar
3 votes
4 answers
173 views

Sort Column as a Row

I have a = {1, 2, 3, 10}; b= {2, 3, 4, 8}; t= Do[If[a[[i]]+b[[i]]>3,Print[a[[i]]],"No"],{i,1,4}]; 2 3 10 I need to get the result; t={2,3,10}
Alyasaa Jasim's user avatar
4 votes
1 answer
126 views

Is the WolframScript error message "The product exited because of a license error" accurate? [closed]

I find that sometimes when I use wolframscript to run a .wls file (as part of a workflow involving hundreds of such files), its ...
Ed Bennett's user avatar
0 votes
0 answers
52 views

HeatMap visualization (ListDensityPlot)

I have two sets of values, e1 = {0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8} and ...
Mathematician's user avatar
4 votes
1 answer
167 views

Formulate and solve a system of linear, first-order ODEs in Mathematica

I know this code is wrong, but I am not sure why. I have a system of coupled differential equations. The model is given by the following equations: $\frac{dS_0} {dt} = (1 - \mu_0) \rho_0 S_0 \frac{S_\...
Ben Hardisty's user avatar
2 votes
1 answer
139 views

Consumer Maximization Problem Doesn't Work in Wolfram Mathematica

I'm trying to solve a problem that can be seen in the paper "The Role of the Structural Transformation in Aggregate Productivity". The problem is: Manually it is difficult to find the ...
mjr's user avatar
  • 21
1 vote
1 answer
82 views

Insert a nonlinear PDE in Mathematica

I am new to Mathematica and trying to learn its language. I want to solve a non-linear PDE but don't know how to insert it. Would you please help me or give me some tutorial about it?
AWer's user avatar
  • 35
3 votes
1 answer
87 views

Is it possible to speed up loading time of Mathematica script?

Even a simple #!/usr/bin/env wolframscript (* ::Package:: *) Print[1] takes 3 seconds to finish on my computer. Can Mathematica script load only what it needs for ...
matheorem's user avatar
  • 17.2k
1 vote
0 answers
65 views

Export data vertically

I have data that I want to export to a text file. ...
Alyasaa Jasim's user avatar
2 votes
0 answers
52 views

File formats of the Wolfram language [duplicate]

I am new user of Wolfram language and Wolfram Mathematica. And want to understand differences and purpose between file formats of ".m", ".wl" and ".wls". I have read ...
Binnat's user avatar
  • 21
0 votes
0 answers
33 views

How Do I Graph an SVEIAR function with the reproduction Number

Just need help figuring out how to plot a graph of an SVEIAR model with its' reproduction number. I'm a bit confused on how to properly make a graph based off the model and reproduction number. ...
izayafiji's user avatar
0 votes
0 answers
52 views

I need help with plotting and SVEIAR Code with the Reproduction Number on Mathematica

I need help because everytime I plot it doesn't work. ...
izayafiji's user avatar
1 vote
3 answers
169 views

Converting Wolfram Language Scripts (.wls) into PDFs

I have just discovered the free (as in free beer) Wolfram Engine, coming with a generous licence. After playing with Mathematica for a while, and missing the notebook feature, I would like to generate ...
antonio's user avatar
  • 111
3 votes
2 answers
226 views

Importing a text file of values and converting it to table

I just started using Mathematica. I got some output in a txt file from some computations in Pari/GP which looks like this: $$ [1,2,3,4; 5,6,7,8]$$ Here I want to import the data into Mathematica and ...
Aditya Ghosh's user avatar
0 votes
0 answers
28 views

How to solve unexpected behaviour with function calls in wolframscript?

I have the following piece of code saved as script.wls that is called using wolframscript -file script.wls <inputs> ...
Bharath Radhakrishnan's user avatar
0 votes
0 answers
89 views

How to pass variables from Python to Mathematica?

I have a Mathematica code that I want to run via Python using subprocess. The Mathematica code contains two variables that I want to pass through Python. However, when I tried to do that, I always got ...
j.doe's user avatar
  • 123
5 votes
0 answers
72 views

What is the most convenient way to organize dependencies from paclets?

Do you have any ideas on how to most conveniently and easily organize package dependencies for Wolfram Language projects. I would like to have something like a list of packages in projects for .Net ...
Kirill Belov's user avatar
2 votes
1 answer
574 views

Wolframscript kernel in Visual Studio Code

I installed the free Wolfram Script and Wolfram Engine on my Mac (I do not have Mathematica), and I generated free activation keys. After entering these keys into the terminal, I am able to run ...
Joe's user avatar
  • 151
-1 votes
1 answer
84 views

Finding the dimensions of the cylinder that can cover $n$ given smaller cylinders (based on empty space, not least materials)

Let $r_k$ and $h_k$ be, respectively, the radius and the height of the $k^\text{th}$ cylinder. We have $n$ cylinders. Let $R$ and $H$ be, respectively, the radius and the height of the big that can ...
Hussain-Alqatari's user avatar
0 votes
1 answer
197 views

Can I use WolframScript to solve this system of equations?

I have these three equations: ...
Lawton's user avatar
  • 103
0 votes
1 answer
135 views

Is there a way to make WolframScript give outputs as a single line?

When the output of a calculation includes exponents or fractions, WolframScript is writing them out on separate lines (exponents one line above, then a line with the rest of the numerator, then a line ...
Lawton's user avatar
  • 103
0 votes
1 answer
70 views

Way to stop reading script file based on conditions, without an "if" block wrapping the entire file

I have a bunch of definitions written in a file that I load with Get["..."], . I would like add a line into the the file so that the evaluation of these ...
Mercan's user avatar
  • 3
1 vote
0 answers
80 views

Plotting equipotentials line of a Julia set in Mathematica

I need to plot the equipotential lines of the Julia sets of the polynomial $f(x)=x^2-1$ by using Mathematica, but I don't have a good background in programming. Given $f$, with equipotential lines I ...
cartesio's user avatar
  • 111
6 votes
2 answers
198 views

Passing negative parameters to a wolframscript

How do you pass negative values as input for a wolframscript? This documentation page explains that the syntax for passing parameters is: ...
mattiav27's user avatar
  • 6,757
0 votes
0 answers
38 views

Data Export not working when running module using Wolframscript compared to executing in notebook

I have a Mathematica module im_solver.m that I wish to iterate through Python or a bash script. The module runs a bunch o' other modules. At the end im_solver.m executes a diagnostic.m that collects ...
Nick Valverde's user avatar
3 votes
1 answer
221 views

Shading an area enclosed by a loop

I am plotting the folium of Descartes as a parametric plot, and trying to find the arclength and the area enclosed by the loop. I got both of them covered result-wise, but my professor wants us to ...
Jakob's user avatar
  • 276
3 votes
2 answers
155 views

Entering matrices interactively

I am looking for a way to enter an m*n matrix interactively using a dialog or a Graphical User Interface(GUI). Further, I would like to use this matrix later for ...
Fermat Agenuine's user avatar
0 votes
0 answers
268 views

Correct way to plot with wolframscript

I am trying to run a .m file with wolfram script. I use the command wolframscript -file name.m It works until the program arrives to a ...
mattiav27's user avatar
  • 6,757
2 votes
1 answer
140 views

WSL/Ubuntu breaks evaluation of WolframScript batch file via symbolic link

I have a very useful bash script for pre-processing a Mathematica notebook before committing it to my local git repo. It works fine under Windows/Cygwin and under Linux. I like to keep one master copy ...
jjoIV's user avatar
  • 173
5 votes
5 answers
2k views

How can I ignore an argument?

I made some code (attached below). It is meant to make a list of random numbers that is not divisible by some value k. I wish to be able to not enter a value k, and have the code run regardless. It ...
Robin Hansen's user avatar
3 votes
3 answers
461 views

How to make a function take another function as an input?

I am quite new to mathematica, and I simply want to know how to make a custom function, take another arbitrary function as an input. I have attached code that shows what I am trying to accomplish (...
Robin Hansen's user avatar
4 votes
6 answers
150 views

How to make an element in a list nested within a list have a default value?

I would like to be able to skip the necessity of entering the last element in the nested lists, and get some default value instead if they are not entered. Below are two lines of code. The first line ...
Robin Hansen's user avatar
1 vote
2 answers
278 views

Function within For Loop wont give me any output [closed]

...
Robin Hansen's user avatar
2 votes
0 answers
127 views

How to run Mathematica from a bash script file? [closed]

I would like to run a Mathematica package math-simple.m file inside of a bash script file. Howeever, when I write inside of the bash script as: math -noprompt -script math-simple.m I get a warning as /...
Kazim Ahmet Hasim's user avatar
0 votes
0 answers
99 views

How can I retain an old version of wolframscript during an upgrade?

During the process of upgrading Mathematica to a newer version, we are presented with the choice of retaining or uninstalling an older version. But it seems that this choice does not extend to ...
Shredderroy's user avatar
  • 5,281
3 votes
1 answer
55 views

How to force standard output as FortranForm while calling a script from terminal

Here's a simple script saved in the file fortranOutput.wls x = ToExpression[$ScriptCommandLine[[2]]] d=FortranForm[x] Print[d] When I call this function from the ...
Ahmed Abdullah's user avatar
0 votes
0 answers
58 views

Can Mathematica automatically submit a code for evaluation every 10 seconds?

I would like to automatize Mathematica to run the code: [Geolocation] every ten seconds. Is that possible? I have searched online, but could not find any ...
Superunknown's user avatar
1 vote
2 answers
235 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]); ...
user avatar
2 votes
3 answers
119 views

Removing lists containing some rules

Consider a big list of lists of rules, namely ...
Smilia's user avatar
  • 592
4 votes
1 answer
87 views

Graphing the equation only after the right answer is picked

I need the equation in the question to be graphed only after the right answer is picked I'm using this form to write questions : ...
Tt Tt's user avatar
  • 339
1 vote
0 answers
56 views

how to add questions with grades

I want to add questions with grades, I'm using this form to write questions : ...
Tt Tt's user avatar
  • 339
0 votes
1 answer
57 views

Getting 3 points although the code describes 1 point in the plane

I'm trying to plot the closest point in the plane to the point P (the one that can be dragged) but in the graph appears 3 points. in the graph I'm plotting a plane and a point P, I want to add another ...
Tt Tt's user avatar
  • 339
10 votes
2 answers
233 views

Controlling point in graphics 3D with locator

I want to control a point in 3D graph by dragging it with the mouse lets say this is my code and I want to add some functionality like the way locator works in 2d graphics ...
Tt Tt's user avatar
  • 339

1
2 3 4 5
8