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
0answers
5 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
95 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
59 views

How to read input stream with no newlines?

I have a script named stdout.wl: ...
0
votes
0answers
19 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
60 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
52 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
228 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
106 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
62 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
37 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
33 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
48 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
32 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
40 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
74 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) ...
5
votes
0answers
112 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
94 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?
6
votes
1answer
178 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
33 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& ...
5
votes
0answers
42 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....
9
votes
1answer
361 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 ...
0
votes
1answer
60 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
60 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
73 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
29 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: ...
0
votes
1answer
53 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
56 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
54 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
128 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.: ...
0
votes
0answers
43 views

Notebook ran as batch and CloudDeploy

i am new to mathematica, and i am trying to run a notebook as batch job(i will elaborate on this later). According to the documentation, running mathematica from command line using the -script ...
1
vote
0answers
19 views

Start New Notebook with Wolfram Snippet from Linux Console

Is there a way to evaluate a snippet of Wolfram code from the Linux console (via wolframdesktop, etc) in such a way that the snippet launches a front end (with ...
0
votes
1answer
64 views

solving Impedance divider

How to represent this equation $$ Z1 = \frac{1}{{\frac{1}{R_1} +j \cdot w \cdot C_1}} $$ in this form in mathematica: $$ Z_1 = \frac{R_1}{{1 +j \cdot w \cdot C_1 \cdot R_1}} $$ And then to solve ...
6
votes
2answers
141 views

Destructuring a list containing two items to use it as arguments to a binary function

I'm experimenting with the Through function. I suspect there is a way to use that function to obtain both the mean and difference of two values. But this doesn't ...
2
votes
2answers
120 views

is there something like a “foreach” mode from the command line? Like in perl?

With perl we can run perl -p . That wraps a foreach loop around the code and executes the code on the file. What I'm looking for is something like StringReplace[filename,"\t"->","] and then I get a ...
9
votes
1answer
152 views

Importing Packages to .wls without shadow definitions and context specification

I am trying to import a package that works correctly when I use it in a notebook in a wolframscript .wls. I get a weird shadowing problem, however. Here is a minimal working example ...
5
votes
1answer
240 views

How to execute an existing notebook with Wolfram Engine?

[My related question: mwe-for-compiling-functions-into-standalone-dll-and-calling-them-in-python - here I am exploring an alternative] I have downloaded, installed and activated the wolfram engine (...
0
votes
0answers
59 views

Export data in a .wls script

I am currently facing the problem that the Export function does not behave as expected if I execute my code as a .wls script. I execute my test.wls file in my ...
0
votes
0answers
80 views

Solve ODE system efficiently with mathematica

I've been trying to solve a system of ODE's with mathematica, which is a master equation of a hierarchically organized tissue model, where I want to quantify the number of cells at level 'k' with 'm' ...
7
votes
1answer
1k views

Installing WolframScript (12) on OSX (Catalina)

I did a clean install of Catalina (OSX 10.15) and Mathematica 12.0 installation was flawless. However I can't install WolframScript which I greatly need. During the installation, after typing my ...
4
votes
1answer
121 views

wolframscript command line output from ParallelDo kernels contains lots of gibberish

I run this code: ParallelDo[ Print["Hi"];, {i,Range[2]} ] And I get this: ...
1
vote
1answer
84 views

Formatting numbers in wolframscript command-line output

I am trying to run the following code using wolframscript on windows: a = 123.4567891011213; Print["a = ",a]; Print["a = ",AccountingForm[a,3]]; The output is: <...
1
vote
0answers
568 views

script to remove multiple Connection Linkedin

Unfortunately i have so many Connections About 20,000 in Linkedin, so i need to delete them all in multiple way, but Linkedin allow one by one. i searched there's a way in Internet, but all of them ...
1
vote
0answers
51 views

Script aborts when I try to build a very large list

I am running the code below ...
0
votes
1answer
36 views

Conditions for solving in NDSolve

I'm trying to solve a system of ODEs but each variable is a probability so I should solve each variable for a range between 0 and 1 and with the sum of all variables equal to 1. This is the system ...
5
votes
1answer
114 views

How do I reliably read from stdin using wolframscript?

I am trying to direct a stream of data to a wls script in a command line environment. Wolframscript provides the ...
0
votes
0answers
131 views

Wolframscript - no output from command when exec'd from php

I am trying to run a simple command via php: echo shell_exec('wolframscript -code 2+2'); However, I am unable to get any output from this command when run like ...

1
2 3 4 5