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
4 votes
1 answer
141 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
130 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
80 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
2 votes
1 answer
62 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.1k
1 vote
0 answers
62 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
48 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
148 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
194 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
26 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
73 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
0 votes
0 answers
43 views

How to insert/type the square brackets in Wolfram Engine/script window?

(Win10 with spanish QWERTY keyboard, using Fn key to obtain []. Wolfram Engine/script 13.3 or previous) I can type the square brackets (curly braces / parentheses, curly brackets) in the "System ...
Mika Ike's user avatar
  • 3,241
0 votes
0 answers
58 views

Plot the resolvent operator function of a second order differential operator

I would like to plot the resolvent operator function of the following second order differential operator in $ L^1(0,+\infty)$, given by: $$(A) f(t)= \varepsilon f''(t) + b(t)f'(t)+c(t)f(t), \quad t\in ...
Kamal Khalil's user avatar
5 votes
0 answers
66 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
409 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
76 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
183 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
104 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
65 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
76 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
189 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,637
0 votes
0 answers
36 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
211 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
152 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
218 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,637
2 votes
1 answer
123 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
449 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
2 votes
3 answers
111 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
240 views

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

...
Robin Hansen's user avatar
1 vote
0 answers
115 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
95 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,239
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 ...
Vangsnes's user avatar
  • 571
1 vote
2 answers
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]); ...
user avatar
2 votes
3 answers
118 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
211 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
0 votes
1 answer
171 views

Error : Array {-6, 2} has the wrong dimensions for a graphics coordinate list [closed]

I'm trying to plot two lines and the point of intersection between them, and I got this error : ...
Tt Tt's user avatar
  • 339
3 votes
2 answers
97 views

How to change the manipulation of the point Q to a Locator?

I want to control the point Q by a Locator not with Slider, how to make this work? ...
Tt Tt's user avatar
  • 339
0 votes
0 answers
122 views

Multiple 2D and 3D plots in a table with mathematica/wolfram

I'm a mathematica newbie! I want to display 15 plots (5 rows labeled by "A" "B" "C" "D" "E" and 3 columns labeled by "P1" "P2" &...
WaterFox's user avatar
  • 185
1 vote
0 answers
207 views

What are the limitations of using Wolfram cloud?

I have a program which requires more than 2 hours of running on my computer. I tried to use Wolfram cloud to run the script, but after few lines on evaluation and reaching the time consuming part, the ...
Mohamed Mostafa's user avatar
1 vote
1 answer
81 views

Wolframscript: Removing prepended message from Print in slave kernel

I am running a parallelized algorithm using WolframScript and inside the function being passed to the various kernels, I have print statements that track the computation and output the print ...
shanedrum's user avatar
  • 567
0 votes
0 answers
74 views

Pass parameters to notebook being opened?

Is there a way to pass a parameter to a notebook which is being programmatically opened? For example, I would like to be able to pass a parameter to myNotebook.nb ...
Chris Degnen's user avatar
  • 30.9k
1 vote
1 answer
99 views

Execute script in text mode and keep interpreter open

I'm on linux using Mathematica 12.1.1 in text mode, i.e. command line. How do I execute a script (which for me just means a text file with valid Mathematica expressions in it), display the results and ...
Fetchinson0234's user avatar
2 votes
0 answers
87 views

How can we call Mathematica functions from another server using the `wolframscript` Python library?

How can we use the wolframclient Python library to call Mathematica functions when Mathematica is running in an another server? For example, if we have Mathematica ...
GarouDan's user avatar
  • 1,536
4 votes
1 answer
121 views

TaskWait, SocketObject, and WolframScript

I want to launch an asynchronous task with Wolfram Script to listen to a socket and print back information in the CLI. This was handled in previous versions by ...
kale's user avatar
  • 10.9k

1
2 3 4 5
8