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
3
votes
1answer
45 views

is it possible to stop/kill Mathematica Frontend from wolframscript?

I use wolframscript to generate hundreds of images like this visualization of 4fold symmetry of octahedron (to be combined in animation videos) like so: ...
1
vote
1answer
31 views

Logarithmic steps inside a Do

I have trouble, i need to do several computations inside a loop using values in a logaritmic scale, is this possible? Inside of the cicle i create a several data sctructures, and it currently works ...
1
vote
3answers
93 views

Mathematica Assist. $yx=qxy$

In Mathematica program, How to define a product of two elements $x$ and $y$ such that $$yx=qxy$$ with $q$ is a number commuting with both $x$ and $y$.
0
votes
0answers
32 views

TexForm Simplifies Equation but Holdform Doesn't Work

I have several functions , g1 through gn, that I want to export the LaTeX for. For each iteration of the loop, the function is named gg[x,t]. I want to export the ...
0
votes
0answers
31 views

Handling large data generated by a script file (using parallelization in Mathematica)

I want to write a script file Script_file.m which I am going to run on a server and collect all the data in a file named ...
2
votes
1answer
47 views

Make different Mathematica notebooks stop talking to each other [duplicate]

So basically I am working in two completely different notebooks. But, if I define something in one notebook, it will overwrite the same definition in my other document. Somehow these files talk to ...
3
votes
1answer
102 views

Stop a script. Just stop it

How can I stop a mathematica script? Abort[] does not stop the script, just jump over a number of lines and proceed with next lines of calculations. Also, killing ...
0
votes
0answers
19 views

MathKernel vs wolframscript and passing parameters from the command line

I have a script that works perfectly well when invoked with MathKernel -script. However I would like to pass it arguments. I can do this using ...
2
votes
0answers
42 views

Running a Mathematica script passing parameters from within another Mathematica file

What is the recommended way to run a Mathematica file file_loaded.m from another Mathematica file main_file.m passing an ...
2
votes
0answers
49 views

Help with script for running AceGen generated routine in ABAQUS

I am using the below configuration to run a AceGen-generated viscoelastic element in Abaqus. Abaqus version: ABAQUS 6.14-6, OS: Windows 10, Visual studio: 2013, Fortan compiler: Intel Fortran compiler ...
4
votes
1answer
96 views

How to determine the file type of a .m file?

Both Mathematica and MATLAB widely uses .m files, but with diametrically different syntaxes and usage. Currently WRI is moving towards the ...
16
votes
1answer
169 views

How to create a CLI for Wolfram language scripts?

Former question: How to use wolframscript to develop flexible command-line tools? I am currently changing a notebook into a wolframscript for a "production" environment, where I plan to ...
1
vote
2answers
67 views

Import all files in folder, perform operation, re-export with appended file name

I'm trying to write a short program that does the following over and over again. Import all files in a folder Automatically generate names for the imported files based on source file name. Perform a ...
4
votes
1answer
119 views

why does wolframscript start an instance of Mathematica frontend?

The following wls file surprisingly creates an instance of Mathematica (v12.1) on OS X 10.15.7: ...
1
vote
1answer
49 views

Wolfram script produces no output

I use Mathematica to create a series of PNG images in a for loop. I want to execute the notebook from the command line in macOS. I exported it as a wolframscript -- see below -- but nothing happens ...
2
votes
1answer
63 views

Copying Weights using NetTrain in Mathematica

I would like to implement the PPO algorithm - Reinforcement Learning - in Mathematica. And for that, I need to be able to copy network weights from say subnetwork NN1 to subnetwork NN2 as an update ...
1
vote
1answer
31 views

Reading specific data from files

I have a huge number of identically formatted .txt files. I would like to read some numbers at a specific position within the text file (row x, column y..) and put them in another file, then repeat ...
1
vote
0answers
27 views

Problem in redirecting output from wolframscript

I am having a very strange problem in scripting with wolframscript. As a MWE I have a .wls which prints its command line argument. I launch several of these scripts with a bash script, each ...
0
votes
2answers
98 views

Better method for computing streamlines

Can someone suggest a better way to solve for streamlines? P.S. StreamPlot is not providing accurate results. Here, velocity is...
1
vote
0answers
14 views

Initializing section header doesn't mark sub cells as initialization cell

I have some definitions organised into Chapter>Section>subsections etc in a notebook. I wish to run this code in wolframscript so I tried (following advise from various question on SE) exporting ...
1
vote
1answer
68 views

How to change the RandomReals each iteration

I am intending to use NestWhile in finding a solution with random real values as parameter. ...
2
votes
0answers
61 views

How to read input stream with no newlines?

I have a script named stdout.wl: ...
0
votes
0answers
25 views

numpad not working in wolframscript

I am not sure if this question is suitable here, if so please migrate or guide. I just installed wolframscript.exe via a WolframEngine installation. After launching ...
1
vote
0answers
112 views

WolframKernel not found when running WolframScript

While attempting to run wolframscript in linux, I get the error "WolframKernel not found. Use -configure to set WOLFRAMSCRIPT_KERNELPATH Or export WolframKernel=/yourpath/WolframKernel" I am ...
0
votes
0answers
94 views

WolframKernelException: Failed to communicate with kernel

I am an absolute beginner of Mathematica!! .. I have downloaded, installed and activated the wolfram engine (12.1) on Windows. I have installed the WolframClient and kernal location is in kernelLoc = '...
3
votes
3answers
247 views

Polar Bubble Chart

I would like to create a plot similar to that in the figure 1. I tried using both ListPolarPlot and BubbleChart, but they do not have the right option for creating a polar bubble chart. Any suggestion?...
5
votes
1answer
123 views

Rendering graphics: UsingFrontEnd vs using a front end

I'm trying to understand how Graphics expressions are rendered. I create an invisible notebook, write a cell and evaluate it, then rasterize the notebook. ...
0
votes
0answers
67 views

Question about Clear function

I have a script starting with Clear ["r*", "data*", "file*"]. Does this clear all variables starting with "r" or "data"or "file"? Also, I ...
1
vote
3answers
42 views

Variable depth of nesting inside Table [closed]

I need to create a table where there are variable number of iterators. something like Table[s_1 *s_2 *... s_n,{s_1,1,5},{s_2,1,5},....,{s_n,1,5}] where n is a ...
1
vote
0answers
39 views

How to retrieve the original mathematical expressions from some sort of scripts?

I quit my Mathematica notebook session mid-computation. When I reopen it, the mathematical expression disappeared leaving something like ...
2
votes
1answer
37 views

wolframscript output differs when code is stored in a file

I noticed that the output from wolframscript appears to be different when running interactively and when running with code in a file. I tried searching for this, ...
1
vote
1answer
53 views

How to calculate the variation of curvature along the horizontal axis

I have a data set with $(x,y)$ coordinates. I do the following to import the data ...
0
votes
0answers
37 views

Why does Region[] not work with Wolframscript on MMA 12.0.0

On my computer: wolframscript In[1]:= polygon = Import["https://pastebin.com/raw/d3MRBb8K"]; In[2]:= rmesh = Region[polygon]; The code ...
0
votes
0answers
55 views

Is it possible to generate and export plots in a high-performance cluster environment?

I have access to a cluster that uses SLURM. I am not very knowledgeable about using clusters, so figuring out how to submit Mathematica jobs was a challenge but eventually something was worked out. ...
2
votes
0answers
83 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) ...
6
votes
0answers
202 views

How to properly call Wolframscript from Python?

I am using Windows 10 x64. If I run the following code in Command Prompt: wolframscript -code ToString[TeXForm["Integrate[Tan[x],x]"]] I get the following ...
3
votes
1answer
121 views

Entering natural language input in WolframScript

What is the equivalent of typing = at the beginning of a line to specify natural language input in WolframScript?
7
votes
1answer
431 views

Difference between math and wolframscript

It seems that both math and wolframscript can be used to run Mathematica scripts on the ...
1
vote
0answers
44 views

Running mathematica from terminal

I was looking information about how to run a mathematical script from shell in a remote cluster. Normally, I used this command: math <file.m> file.out& ...
6
votes
0answers
47 views

Logging modules in Mathematica?

Is there any logging module or functions or scripts that one can use to store all the information of what happens during executing mathematica program in Wolfram? For example, one might look up log....
12
votes
1answer
1k views

What is the difference between Wolfram Script and Wolfram Engine?

I don't understand the difference between these products: Wolfram Script Wolfram Engine Would someone help me understand what these are? And how it differs from just using Mathematica in the ...
2
votes
1answer
108 views

Run .m file in terminal

I have the following .m file (* ::Package:: *) (* ::Input:: *) (*out=1+1;*) (*Print["Test"];*) (*Export["/path/test.txt",out];*) and I am trying to run it in the ...
2
votes
0answers
68 views

Characters don't print right in WolframScript

Mathematica version: 12.1 & 11.3 Platform: Windows 10 Since windows's cmd is GBK, so my file is GBK. ...
0
votes
1answer
98 views

Problems in running mathematica file in the background

I have converted my Mathematica notebook into .m file and need to run it in the background on a remote server. I am launching the run from my laptop, on a remote workstation. I need it to obey the ...
1
vote
0answers
31 views

Error while exporting multiple files

I have two questions. I am trying to export results from my calculation when I iterate. I am processing multiple files using code below: ...
2
votes
1answer
109 views

Can't save output in the script mode

I encounter the problem that I can't save any output from Mathematica script. Here is a minimal example. test.m ...
1
vote
1answer
48 views

Missing decades in LogLinearplot

I wanted to display all the decades (from 1 to 10^8 like 1 ,10, 10^2, 10^3 etc) in LogLinearPlot and also tried the solution of why-is-listlogplot-skipping-entire-decades. And my code is something ...
-1
votes
1answer
57 views

Need help to find a value to linearize the data [closed]

I have a two column data which is y vs x. I want to linearize the data by this formula 1/(x-b) but I don't know how to determine the b value such that the ln(y) vs 1/(x-b) becomes a linear line. So I ...
2
votes
0answers
80 views

Difference between versions of WolframScript

On my computer (Windows 10) I currently have installed 4 instances of wolframscript.exe. They represent different versions of WolframScript program and each file is ...
6
votes
1answer
141 views

How to create a progress bar using Wolframscript?

I am using Wolfram script with a Mac OS. I have a long while loop dependent on the length of a list. i.e.: ...

1
2 3 4 5 6