New answers tagged

7

This will not work. Python does not know what mylist is: mylist = {1, 2, 3, 4}; ExternalEvaluate["Python", "sum(mylist)"] You must get the value of mylist into Python somehow. This could be done with string replacement: ExternalEvaluate["Python", "sum(" <> StringReplace[ToString[mylist], {"{" -> &...


2

The problem was that I activated the automatic save after each evaluation, but was working on a notebook that had not been saved yet - hence the beep. As mentioned in the comments, going to Help and clicking on Why the Beep? showed clearly why this was happening:


6

You can open Option Inspector and change the prompt of calculation completion to other options.


2

Maybe you can use the following codes: x = {1, 2, 3, 4};Solve[y == z^2] /. z -> x The final result is: {{y -> {1, 4, 9, 16}}}


1

Why not bypass Solve, and apply the square directly: x={1, 2, 3, 4}; y = x^2 {1, 4, 9, 16} More complicated operations: y= somethingComplicated[#]&/@x


2

You need to turn $Context into a string. You also do not need to add the quotation marks, as you are joining strings, so the end result will automatically be a string again. This should do what you want. Clear@Evaluate[ToString[$Context] <> "*"]


1

We can test the first pies of code and get a message end = 20.0; un = NDSolveValue[{D[u[s, x], s] == u[s, x] D[u[s, x], x, x] + 20.0, DirichletCondition[u[s, x] == 0.0, x == 0.1 || x == 1], u[0, x] == 0.0}, u, {s, 0, end}, {x, 0.1, 1.0}] NDSolveValue::femcscd: The PDE is convection dominated and the result may not be stable. Adding artificial ...


0

You can use TextGrid with the ItemSize option: TextGrid[ functionList, Alignment -> {Left, Top}, Spacings -> {2, 2}, Frame -> All, ItemSize -> {{5, 30, 10}, Automatic} ] You could also use the ItemSize option with Grid, but TextGrid looks a bit better, and also it takes care of the copy-and-paste problem that you encountered.


4

Clear["Global`*"] f[h_, s_, a_, b_] := 0.00015034013139827721* h^4*(-12.512450890438938 + Log[0.10272025*RealAbs[h^2]]) - 0.00463012409828799* h^4*(-12.512450890438938 + Log[0.49368002148788936* RealAbs[h^2]]) + (3*(14922.284640000005 + 0.4*h^2 - 272.22*s + 0.3818*s^2)^2*(-12.512450890438938 + Log[...


Top 50 recent answers are included