Skip to main content

Questions tagged [initialization]

Questions about the usages of the various initialization files used by Mathematica. The most common ones are the init.m files that can be found in some Mathematica system folders and in a few specific user folders.

Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

Solving system of coupled pdes with Neuman and Drichlet Bc

I am trying to solve a system of coupled PDEs. However, I have issues assigning initial and boundary values to the unknown field. I have checked and initial values satisfy the boundary conditions, and ...
questionerno8's user avatar
5 votes
2 answers
173 views

Regarding phase space diagram/trajectory

I have a 3D chaotic system and its one 3D phase-space portrait and three 2D phase-space portrait (x-y plane, y-z plane, z-x plane) are given below. ...
Arssat's user avatar
  • 187
1 vote
1 answer
137 views

Nonlinear experimental data fit without initial parameters

I am trying to fit correlation data into a non-linear model but it is not working. My data plot looks like this: The equation I am using for fit is The Mathematica script i am using looks like: <...
SKR's user avatar
  • 11
0 votes
0 answers
29 views

InitializationCellEvaluation does not work

I have a notebook with a single cell that I want to start running when I launch open the notebook. I have, formatted the cell as an initialization cell In the Options Inspector, Selected "...
Peter Fisher's user avatar
1 vote
1 answer
95 views

In a Notebook, How can I set every cell to be an Initialization cell?

At present, I do this by manually setting every cell in a notebook to be Initialization cell. There must be a better way! When I finish work one day and re-open the notebook the next day, I want all ...
Peter R's user avatar
  • 71
-3 votes
1 answer
103 views

differential wave equations [closed]

By seeking a solution of ∂u ∂t = c 2 ∂ 2u ∂x 2 in the form u(x,t) = X(x)T(t), obtain and solve ordinary differential equations satisfied by X(x) and T(t). Hence write down possible solutions for u(x,t)...
kay's user avatar
  • 1
1 vote
0 answers
86 views

How to restore LightGray Background to initialization cells?

I am running Mathematica 13.2.1 on a new MacBook Pro M2 with Ventura 13.2.1. I have done something that causes any initialization cells that I create or view to no longer have a LightGray background. ...
Spencer Rugaber's user avatar
1 vote
1 answer
77 views

In Manipulate animation I can't have ResetButton and Play buttons

I want to add a separate reset button to this code besides using the bookmark button (Ver:11.2). I've tried everything in "Reset" Button for Manipulate and elsewhere but ResetButton ...
L. Gorham's user avatar
1 vote
0 answers
36 views

Hold around SetDelayed with Graphics [duplicate]

Minimum Working Example I've defined my own plot function, which does a lot of stuff to the inputs before passing it into the Graphics function. Because of that, I'...
Travis Bemrose's user avatar
4 votes
1 answer
371 views

First initialization taking way too long

Pretty much everyday when I first bring up Mathematica, it takes a very long time. Subsequently, if I close it down and reopen, it is very quick. This is on my home computer (version 13.2), but the ...
Aharon Naiman's user avatar
0 votes
0 answers
27 views

Can I generated an initialization cell using CellPrint?

I want to do exactly what is done in this post, except I would like the generated cell to be an initialization cell. That is, I'd like to have my code automatically generate an input cell with new ...
WillG's user avatar
  • 980
1 vote
0 answers
44 views

What is the syntax for adding code, e.g. LinkWrite[...] to init.m? Version 12.0

I'm trying to use the suggestions for adding menu items discussed here: https://mathematica.stackexchange.com/a/909/44139 When I add ... ...
Steven Thomas Hatton's user avatar
31 votes
6 answers
1k views

What secrets are hidden away in your init.m and where do you place it? Please help me build the ideal init.m

My init.m Feels Like it's Missing Something Although I am familiar with about a dozen or so programming languages I am only sort of, kind of, halfway competent in about three. MMA with it's boxes, ...
2 votes
2 answers
176 views

How can the format of Initialization Cells be set to the format of normal input cells?

I don't like how initialization (or "Code") cells are formatted in notebooks, namely the grey background color and the spacing/wrapping settings. I want ...
abcd's user avatar
  • 483
2 votes
1 answer
183 views

Initialization cells not evaluating?

I think I'm experiencing a bug, but perhaps there is a simple explanation and fix. I have many initialization cells in my notebook (a few hundred). As of quite recently, they stopped all evaluating ...
WillG's user avatar
  • 980
0 votes
0 answers
28 views

SetOptions error message upon launching Mathematica v.12

When launching Mathematica v.12, before opining any notebook, I get the following message: It does not afffect the execution of my notebooks, but it is annoying and I would like to understand how to ...
chavavic's user avatar
3 votes
0 answers
58 views

How to programmatically save tagged cells from currently open notebook (nb ext) as a package file (m ext)?

Please do not tag this question as already answered because the method described at Is there a way to programmatically do a “save as ” on an init.nb file to save it as init.m? is only for saving ...
Jules Manson's user avatar
  • 2,467
0 votes
1 answer
182 views

Manipulate and Initialization with functions and some variables

I am trying to do a manipulate with a function that depends on several variables, some of which are also functions. I can't get it to work. I have tried including an "Initialization" but it ...
Manu's user avatar
  • 119
0 votes
1 answer
71 views

Why is loading a list of contexts with Map Get not working?

I wish to automate the loading of packages by using Map and Get but Mathematica doesn't seem to like it. How can I make this work? This is how packages are normally loaded... ...
Jules Manson's user avatar
  • 2,467
1 vote
0 answers
82 views

Autoloading MaTeX` and Rubi` via DeclarePackage[] in the user init.m does not work

Former question: Autoloading and adding code to a package in the user init.m I am using MaTeX, and I found the updateMaTeX[] function] at the GitHub repo. I tried ...
Gravifer's user avatar
  • 872
0 votes
0 answers
222 views

Why is my init.m not loading at startup?

The contents of init.m are placed inside an Initialization Cell so that some symbols are created in the Global` context and to prepend alternate paths to ...
Jules Manson's user avatar
  • 2,467
3 votes
1 answer
92 views

How do I initialise a compound expression in Animate? Or, how do I have an expression evaluate on startup?

I have written a notebook with a few functions I defined. These functions describe a way of generating graphs using 2 inputs. e.g. graph[n_,s_] := Graph[...] I have ...
Ross Keenan's user avatar
0 votes
0 answers
41 views

Problem with Initialization cell and Manipulate

The following minimum failing example illustrates a problem that I am having building an application to simulate projectile motion. In the notebook's initialization cell, I have the definition of a ...
Spencer Rugaber's user avatar
1 vote
0 answers
38 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 ...
lineage's user avatar
  • 1,164
1 vote
0 answers
58 views

.m files saving with comments [duplicate]

So I have posted a few questions on loading packages, because it is so simple, yet always failing for me. I made a new file Streams.m in the directory ~/Library/Mathematica/Applications/, which is in <...
Brandon's user avatar
  • 101
0 votes
0 answers
81 views

How can I ensure initialization cells are evaluated in order of definition?

I have a cell: Unprotect[Plus]; followed by a cell: Plus[label[t1_, l1_], label[t2_, l1_]] := label[t1 + t2, l1] If I ...
user3257842's user avatar
4 votes
2 answers
323 views

Non linear fit without initial parameters

I have a certain unsightly list of point which I want to fit with the following function a^2 + b^2 + 2 abCos[q*d], where a and b are the fit parameters. When I use NonLinearModelFit to fit my list, ...
DarkBulle's user avatar
  • 1,014
1 vote
0 answers
48 views

Determine init.m location from within said init.m file? [duplicate]

I have following question: can I easily determine location of init.m from within said init.m? We need to use premade Mathematica script/program/addon (don't know proper term) which unfortunately ...
M i ech's user avatar
  • 223
0 votes
0 answers
144 views

Mathematica Command for evaluating all initialisation cells

I've looked around the website and the documentation but I've had no success. The task is simple: I'm looking for a Mathematica command that evaluates all the initialisation cells in a given notebook, ...
OldTomMorris's user avatar
7 votes
1 answer
394 views

Is there a (simple!) way to convert all initialization cells of a document to normal cells?

I like to work with initialization cells. During the different stages of development of my notebooks, I however often need to change those. If they are scattered throughout the notebook, it is ...
Britzel's user avatar
  • 673
12 votes
2 answers
275 views

Why does args symbol exist in a fresh kernel?

In fresh kernel Mathematica 11.3 (Linux) asking for args (similarly for dims) I obtain ??args Global`args As far as I ...
Acus's user avatar
  • 3,680
2 votes
0 answers
130 views

Problem with PopupMenu: Its values don't update dynamically

I have a problem with PopupMenu inside DynamicModule, its values don't update dynamically as they supposed to. The example below ...
Kamila's user avatar
  • 77
0 votes
1 answer
52 views

Cannot set DownValues to ValueList while loading package

I have installed a package named HEP from Wolfram Library Archive which contains several .m files by Files -> Install (...
Rohan's user avatar
  • 13
6 votes
1 answer
177 views

init.m in Autoload directory is not read by parallel kernels in M11.2

Parallel kernels are not reading the init.m files in $UserBaseDirectory/Autoload since version 11.2. The master kernel reads it ...
Chris Degnen's user avatar
1 vote
0 answers
56 views

How does -preinit work in 11.2?

On Initialization & Provisioning at http://reference.wolfram.com/language/guide/InitializationAndProvisioning.html the WolframScript Command-Line Options mention -preinit and -postinit. I am ...
Chris Degnen's user avatar
0 votes
0 answers
515 views

Evaluate Initialization cells at startup [duplicate]

How can I start an evaluation of the initialization cells when a notebook is opened? Should I use FrontEndExecute[] in some way?
Ale1794's user avatar
  • 525
0 votes
0 answers
230 views

Hide initialization cell [duplicate]

I would like to load a package at the beginning of a notebook. So i put these lines inside an initialization cell: ...
Ale1794's user avatar
  • 525
4 votes
2 answers
311 views

Batch Loading of Mathematica Packages and Issues with Autoloading

I have a package that initiates some periodic tasks via the ScheduledTasks functionality. The tasks in question also require the use of parallel tools and the launching of external commands. ...
tavr's user avatar
  • 61
1 vote
0 answers
266 views

How to *safely* enable automatic initialization cell evaluation for one notebook?

I want to configure this one notebook (let's call it X) so that its initialization cells get automatically evaluated when X is first opened1. To this end, I have applied the settings shown below to ...
kjo's user avatar
  • 11.7k
3 votes
1 answer
223 views

How can I jump to the next initialization cell?

I've got a long document and I suspect know that I mistakenly set some cell in the middle of the document to be an initialization cell, probably hidden inside multiple collapsed sections and ...
Emilio Pisanty's user avatar
16 votes
2 answers
731 views

Detecting kernel initialization

Certain operations do not work during kernel initialization. Code from Kernel/init.m, the Autoload directory, or packages set ...
Szabolcs's user avatar
  • 236k
8 votes
1 answer
427 views

Register "initialization code" to run on any newly started parallel kernel

Is it possible to register a some "initialization code" to be run on any newly started parallel kernel? This would be similar to how ParallelNeeds registers a ...
Szabolcs's user avatar
  • 236k
3 votes
1 answer
134 views

Initializate Manipulate

Hello I am a beginner in Mathematica and I have a question about initialization of manipulate. I have code like this and I want to ask you, how to modify that code if I want have default picture saved ...
Recktus's user avatar
  • 33
0 votes
0 answers
1k views

Mathematica won't evaluate on the first run & problem with code highlight

When I start Mathematica, the first evaluation always takes forever even it's as simple as x = 2, and when I halt the evaluation with ...
arax's user avatar
  • 1,831
4 votes
1 answer
268 views

Why InitializationCellWarning is False and still I get warnings?

I wrote a notebook containing initialization cells: (1) notebook's options related to initialization are set to: ...
mitochondrial's user avatar
10 votes
1 answer
159 views

How to ensure that a package is always loaded on startup, even in parallel kernels?

Is there a robust way to ensure that a package is always loaded on startup, even in parallel kernels? Parallel kernels do not read Kernel/init.m.
Szabolcs's user avatar
  • 236k
2 votes
0 answers
90 views

How can I bypass the limitations of init.m? [duplicate]

In a series of QA it has been pointed out that init.m suffers of heavy limitations (see as example, Automatically load packages at startup or Why can't I import ...
mitochondrial's user avatar
5 votes
2 answers
501 views

Strange Error with Initialization within Animate

Animate[x, {x, 0, h}, Initialization :> (h = 1)] The code above gives the error: Animate::vsform: Animate argument {x,0,h} does not have the correct form for ...
User18's user avatar
  • 892
3 votes
0 answers
120 views

What is the appropriate way to handle JVM memory issues in a Mathematica package?

I maintain a large Mathematica package (here) that, for certain operations, calls out to a Java library (here). The details of the libraries are not important, but I've come across a frustration with ...
nben's user avatar
  • 2,158
3 votes
1 answer
167 views

Starting notebook from text mode

I am trying to start new notebook from a command line mode with command UsingFrontEnd@CreateDocument[] The notebook is created but it stays in minimized mode at the ...
Jānis Erdmanis's user avatar