Wolfram mathematica Wolfram Workbench and Mathematica Help System

I find the Wolfram Workbench a nice environment for Mathematica development. However, as I program in Mathematica, I need to navigate the Help System very often. The Workbench provides a tooltip tool that shows a very basic help for the Mma functions (just the usage messages), and is not enough for my usual needs. So: Is there a way to bring up and navigate the whole Mma Help System from inside the Workbench? Alternative solutions are also welcome. Re-entering the function name in a notebo

Wolfram mathematica Custom Intervals of Markers in Mathematica PlotMarkers

I am trying to plot multiple lists in the same plot in Mathematica (ListLinePlot) and use PlotMarkers and the PlotLegend Package to get the final figure. The issue is that Mathematica puts a marker for every point and this makes it hard to tell which marker is where in the plot. Is it possible to have a plot marker appear every n sample (e.g. every 10 points for a 100 point plot). The Directive at the moment is PlotMarkers->{Automatic, Small}.

Wolfram mathematica Mathematica, leftover zeros

I'm struggling how to get rid of expressions that are trivially zero in Mathematica from the output. Example: pVec = Table[{i, Exp[-i*0.03]}, {i, 0, 2.5, 1/2}]; pVec[[2, 2]] = p1; pVec[[3, 2]] = p2; pVec[[4, 2]] = p3; pVec[[5, 2]] = p4; pVec[[6, 2]] = p5; qq = Interpolation[pVec, InterpolationOrder -> 1]; >> qq[0.5] >> 0. (1 - p1) + p1 the 0*(1-p1) is obviously zero, but I couldnt find a way to get rid of it ? (I'm relatively new to Math

Wolfram mathematica Creating points while using Mathematica's Table Function

I'm trying to plot points that I've created in a table in mathematica but for some reason one component of my points seems to have double braces around it while the other only has one as below: {{x},y},{{x1},y1}....{{xn},yn} and list plot will not recognize these as points and will not plot them. Here is my mathematica code: Remove["Global`*"] b = .1; w = 1; Period = 1; tstep = 2 Pi/Period; s = NDSolve[{x''[t] + b x'[t] - x[t] + x[t]^3 - .5 Cos[w t] == 0, x'[0] == 0, x[0] == 0}, x[t], {t,

Wolfram mathematica define a Linear Time-Delay system in Mathematica and plot it's Bode and Nyquist diagrams

I have a characteristic equation of a time-delay system and i can't define it with StateSpaceModel or TransferFunctionModel command in Mathematica; Because these commands only work for linear systems without delay. My purpose is to define a Time-Delay system in Mathematica 8.0.1 and plotting Bode Diagram and Nyquist Diagram for a system like this: g = ((s + 1) (1-E^(-2 s) + E^(-3 s)))/(s^2 + 2 s + 10)

Wolfram mathematica repeat a function n times in Mathematica

I want to repeat a function n times on a table, For n=2 I have the following code, How can I be sure that the function had run twice since my fc is differend every time? smat = Table[{9, 8, 10}, {3}] f[x_?Table] := ReplacePart[ x, {{2, 1} -> x[[2]][[1]] - #, {2, 2} -> x[[2]][[2]] + #}] &@ fc[x[[2]][[1]]]; fc[k_?NumericQ] := Count[RandomReal[{0, 1}, k], x_ /; x < .1] Nest[f, smat, 2]

Wolfram mathematica An efficient data structure or method to manage plotting data that grow with time

I'd like to ask if the following way I manage plotting result of simulation is efficient use of Mathematica and if there is a more 'functional' way to do it. (may be using Sow, Reap and such). The problem is basic one. Suppose you want to simulate a physical process, say a pendulum, and want to plot the time-series of the solution (i.e. time vs. angle) as it runs (or any other type of result). To be able to show the plot, one needs to keep the data points as it runs. The following is a simpl

Wolfram mathematica How to define part of a Manipulate control variable definition to reduce code duplication

This is a little related to this question Define control as variable in Mathematica But the above question did not answer my problem, as it talks about the full control definition. (I also tried some of the tricks shown there, but they do not work for my problem). I am now asking about definition for only part of the control. (It is also very hard to follow up on an old question using this forum format. Because using the tiny comment area, it hard to ask and show more like when asking a new q

Wolfram mathematica How can I test for bivariate normality using Shapiro-Wilk test in Mathematica?

I've computed the Pearson correlation coefficient between two lists and am now trying to verify whether these two data sets are normally distributed in order to ascertain the validity of the the correlation. From What I've read in the documentation, I should be able to use multivariate data with The ShapiroWilkTest function, but so far I have been unable to obtain an output. I do not receive an error, but the process hangs seemingly indefinitely. I am, however, able to obtain an output with uni

Wolfram mathematica Problems passing options in specialized plot functions for Mathematica

This should be quick to an expert, but I'm relatively new at defining functions with options. Here is a schematic of what I've tried, I'll explain after showing the code: MyPlotFunction[params_, optionalparameter_List:{1,2,3}, opts:OptionsPattern[]]:= Plot [ stuff, {x,0,1}, Evaluate@FilterRules[{opts},Options@Plot]]; Options[MyPlotFunction] = { PlotRange->{-5,5}, Frame->True, ... other plot options}; There are four slight subtleties: I have an optional parameter in my functio

Wolfram mathematica Nested Manipulate in Mathematica

Please consider: Function[subID, pointSO[subID] = RandomInteger[{1, 4}, {5, 2}]] /@ {"subA", "subB"}; Manipulate[ Manipulate[ Graphics[{ Black, Rectangle[{0, 0}, {5, 5}], White,Point@pointSO[subID][[i]] }, ImageSize -> {400, 300}], {i,Range[Length@pointSO[subID]]}], {subID, {"subA", "subB"}}] Provided that p

Wolfram mathematica Mathematica output formatting

How does Mathematica decide when to round numbers in its output? For example, giving the input 250000.5 gives the output 2500001 While 25000.5 is indeed printed as 25000.5 N[] isn't helpful here either, I need to use NumberForm[] to get it to actually print 250000.5 as 250000.5 I'm a Mathematica newbie, and I'm sure its ridiculously easy to control this threshold for when it starts ignoring decimals in its output, but could somebody please point me in the right direction?

Wolfram mathematica Function as parameter for Module

How is it possible to use a mathematical function as module- parameter Such as: PersonalPlot[fun0_, var0_, min0_, max0_] := Module[{fun = fun0, var = var0 , min = min0, max = max0}, (*this is incorrect*) fun = fun[var_]; Plot[fun, {var, min, max}] ] PersonalPlot[x^2,x,0,3];

Wolfram mathematica Mathematica: Defining a function as the derivative or integral of a piecewise defined function

I am trying to evaluate a function that I have defined piecewise. I need to integrate it with respect to one variable and then take the derivative with respect to another (variables are independent). However, something in the way I am defining the functions is causing mathematica to throw errors or infinitely evaluate. I believe that the derivative function does not like the format of the output of the integrate function, and vice versa when I tired reversing the order of the steps. The integran

Wolfram mathematica Mathematica custom notation / disable predefined function?

I cannot find how to use any variable name i want in mathematica. (I've searched where i could but i cannot think of the correct terms to search for) For example, I wanted to name one of my variables {pi}' (with {pi} I mean the greek pi, just cannot type it here). However, there are problems. First, {pi} is already predefined as a constant equal to 3.14.. Second, the prime (') symbol is predefined as derivative. So, {pi}' evaluates to 0& by default. Another example would be, if i want to n

Wolfram mathematica result expanded to maximum (more) on wolfram alpha query

I am using mathematica to query wolfram alpha for a query. for that purpose I use: WolframAlpha["prime minister of france", "PodPlaintext"] I took the options from here: http://reference.wolfram.com/language/ref/WolframAlpha.html My problem is that I need info that is hidden at first and is located under the more option on the page. I was unable to find a way to query the full data (after more was clicked) from the mathematica. Any ideas how to achieve it?

Wolfram mathematica Why are defined variables not turning black in Mathematica v10?

I just upgraded Mathematica from version 8 to 10, and I am having a problem with the syntax colouring. Before, when I assigned a value to a variable, it would turn from blue to black to indicate that it was defined. But now, even when I define variables, sometimes they stay blue! However, they still work as expected, meaning that there really is a value assigned to them, and I can call upon it. But why are they coloured incorrectly? It is very confusing to work with as I am not sure if a variabl

Wolfram mathematica Using the Manipulate funvtion in Mathematica:

How is it possible to extend the scope of the slider variable beyong the 'Manipulate' function? In this coding 'n' = 10 before and after the 'Manipulate' function but can vary between -10 and +10 in the plot routine. n = 10; Manipulate[ Plot[Sin[n*x], {x, -5, 5}], {n, -10, 10, 1, Appearance -> "Labeled"}] Print["n = ", n] Thank you in advance for all contributors. Norman

Wolfram mathematica Mathematica-Netlogo Link Install Issue

I have been trying to install the Netlogo-Mathematica Link to my Wolfram Desktop Version 12, using the NetLogo 6.1.0 package. It sometimes returns the directory not found error. If I try to load the package, it returns $Failed cannot open NetLogo. I'm on a macOS 10.14.5. Is it because I am on Wolfram Desktop rather than Mathematica, or is there some other problem?

Wolfram mathematica Print list or array elements as subscripts in Mathics

I can create a list variable in Mathics, in this way: In[1]:= a = {1} Out[1]= {1} In[2]:= a[[1]] Out[2]= 1 This is quite ordinary in any language, however Mathics Wolfram language has also the syntax: Subscript[a, 0] which is printed with a nice mathematical subscript style. My question is: is it possible to format a list (or an array) to be printed with a subscript style?

Wolfram mathematica Getting started with Mathematica packages

Can someone offer some advice on how to get started with mathematica packages? I can save the following in a file named "Foo.m". When I run the input cell in that file, I can see the effects reflected in $ContextPath variable. BeginPackage["Foo`"] bar::usage = "barfunction"; Begin["`private`"] bar[w_] := w; End[]; EndPackage[]; However, in my notebook I have the following: #include<foo> SetDirectory[ToFileName[{$HomeDirectory, "My Documents", "mathematica"}]]; Needs["Foo`"] $Conte

Wolfram mathematica Combinations with repetition

I'm using Mathematica 7 and with a combinatorica package function I can get all combinations of a certain number from a list of elements where the order doesn't matter and there is no repetition.e.g: in: KSubsets[{a, b, c, d}, 3] out: {{a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}} I cannot find a function that will give me all combinations of a certain number from a list of elements where the order doesn't matter and there is repetition. i.e. the above example would include elements like {a,a,b

Wolfram mathematica Is there a way to draw a set of lines in mathematica all with the same origin point?

I have a set of points given by this list: list1 = {{3, 1}, {1, 3}, {-1, 2}, {-1, -1}, {1, -2}}; I would like Mathematica to draw a line from the origin to all the points above. In other words draw vectors from the origin (0,0) to all the individual points in the above set. Is there a way to do this? So far I've tried the Filling option, PlotPoints and VectorPlot but they don't seem to be able to do what I want.

Wolfram mathematica How to overlay two ReliefPlots, or other graphics

Is it possible to overlay two or more graphics in Mathematica, if the graphics are generated by functions such as ReliefPlot or DensityPlot, using Opacity to control the appearance? For example: a = ReliefPlot[ Table[i + Sin[i^2 + j^2], {i, -4, 4, .03}, {j, -4, 4, .03}], ImageSize -> 100] b = ReliefPlot[ Table[i + Sin[i^3 + j^3], {i, -4, 4, .03}, {j, -4, 4, .03}], ImageSize -> 100] Show[a,b] combines the two, but I can't work out how to insert an Opacity command anyw

Wolfram mathematica Writing vectors to a file without using Export

I am interested in writing multiple vectors to a file such that each vector forms one row in the file, and is written to the file as soon as it is generated. The elements of the vector need to be separated by a single space, and I do not want to include the { } parentheses for the vector. Basically, I want to mimic the fprintf("file", "%f %f %f\n") functionality of C. Here is what I have. Is there a better way of doing this? st1 = OpenWrite["C:\\junk\\mu.out", FormatType -> OutputForm]; v

Wolfram mathematica Mathematica 8.0, obvious simplification missed, why?

I apologize beforehand if there’s an obvious answer, I’m not a user of Mathematica but I’m working on a borrowed laptop and that’s what I have available for the moment. For some reason Simplify and FullSimplify are missing obvious simplifications, for instance: Simplify[1/2 (2/5 (x - y)^2 + 2/3 z)] Yields: 1/2 (2/5 (x - y)^2 + (2 z)/3) For some reason, it doesn't get rid of the 1/2 factor, try it yourself! Of course I can do it manually but I have much bigger expressions with the same pro

Wolfram mathematica Cleanup data on one long line in Mathematica

I have a file of 12Mb approximately that has the following typology [["1",-154],["2",-100],["3",-28],["4",-66],["5",-222],["6",-309],["7",-196],["8",-50],["9",-53],["10",-209],["11",-355],["12",-350],["13",-269],["14",-264],["15",-392],["16",-513],["17",-515],["18",-434],["19",-418],["20",-505],["21",-592],["22",-559],["23",-422],["24",-384],["25",-539],["26",-716],["27",-713],["28",-593],["29",-534],["30",-647],["31",-813],["32",-857],["33",-711],["34",-582],["35",-594],["36",-700],["37",-721]

Wolfram mathematica List of plotting options

I often use the same plotting arguments for Plot3D so I tried to make a list so I do not have to write them over and over. I tried: optlist = {Boxed->False, Axes->True, AxesOrigin->{0,0,0}}; Plot3D[eq, {x,-5,5},{y,-5,5}, optlist]; I am not a programmer and use Mathematica only for math-study.

Wolfram mathematica Mathematica: Implementation of Partial Least Squares (PLS)?

I'm looking for a PLS implementation for Wolfram Mathematica. I just cant seem to find any implementation for it - do you know one? In general, I'm a bit confused that there exist only so few third-party packages/libraries for mathematica in general :( For now I probably will just use RLink in mathematica to be able to refer to the R package pls (http://cran.r-project.org/web/packages/pls/index.html) but a direct implementation in mathematica would be nicer for debugging and testing purposes...

Wolfram mathematica Recommended hotpatch for Mathematica Link to NetLogo 6 didn't work

I have the same problem as the user who posted in "Unable to use Mathematica Link in NetLogo 6.0" (Unable to use Mathematica Link in NetLogo 6.0). For me, the Mathematica Link seems to work fine with Netlogo version 5.3.1. Even after I attempted the recommended hotpatch (which was the answer to the original posted question on this topic), still no luck (I get the same error message posted in the original comment cited above). I tried extracting the hotpatch in the NetLogo 6.0 directory and in th

Wolfram mathematica How to make animations out of a Table of images in Mathematica 7

If I have a set of pictures, how can I make it so I can get an animation out of them? In old versions of Mathematica, it was possible to compact them and then double click them so it would show them as sequence(i.e., animation), but I'm now using version 7 of Mathematica and that doesn't seem possible. How can I do so? alt text http://img63.imageshack.us/img63/7972/d2ilrx0vvczls0ntmqsalgp.png

Wolfram mathematica How to show plots inside a loop in mathematica

I am wondering if you have good ways to show plots inside a loop in mma. Usually, the output of Plot function is not shown, for example in the following code: For[i = 1, i <= 10, i++, Plot[Sin[i*x], {x, -Pi, Pi}]] Thanks for your help. Edit In connection to my previous question, I already have the For loop, for example, like this For[i = 1, i <= 10, i++, Plot[Sin[i*x], {x, -Pi, Pi}]]. Given this fact, I want to have something like "press any key to continue..." inside the For loop, the

Wolfram mathematica Mathematica - DSolve spits out #1 in output

I'm not quite certain how to go about interpreting this. I'm solving a fairly large system of differential equations, DSolve sometimes spits out a list of replacement rules that include terms that have a #1 . I know that #1 is a placeholder for an argument, but I just have no clue where it comes from. If I have a system of equations similar to eqs = { x1'[t] = a1*x1[t] + b1*y1[t] x2'[t] = a2*x2[t] + b2*y2[t] ... y1'[t] = c1*y1[t] + d1*x1[t] y2'[t] = c2*y2[t] + d2*x2[t]} DSolve[eqs,vars,t]

Wolfram mathematica Is Put - Get cycle in Mathematica always deterministic?

In Mathematica as in other systems of computer math the numbers are internally stored in binary form. However when exporting them with such functions as Put and PutAppend they are converted into approximate decimals. When you import them back with such functions as Get they are restored from this approximate decimal representation to binary form. The question is whether the recovered number is always identical to the original binary number and, if not always, in which cases it is not and how

Wolfram mathematica Efficient And Conditional Tuples or Subsets

Stepping back from the following question : Selecting with Cases I need to generate a random Set (1 000 000 items would be enough) Subsets[Flatten[ParallelTable[{i, j}, {i, 1, 96}, {j, 1, 4}], 1], {4}] Further, I need to reject any quadruples with non-unique first elements, such as {{1,1},{1,2},{2,3},{6,1}}. But the above is impossible on a laptop. How could I just draw uniformly one millions sets avoiding killing my machine ?

Wolfram mathematica smallest integer not obtainable from {2,3,4,5,6,7,8} (Mathematica)

I'm trying to solve the following problem using Mathematica: What is the smallest positive integer not obtainable from the set {2,3,4,5,6,7,8} via arithmetic operations {+,-,*,/}, exponentiation, and parentheses. Each number in the set must be used exactly once. Unary operations are NOT allowed (1 cannot be converted to -1 with without using a 0, for example). For example, the number 1073741824000000000000000 is obtainable via (((3+2)*(5+4))/6)^(8+7). I am a beginner with Mathematica. I ha

Wolfram mathematica Correctly use Association in Mathematica to Apply Labels to Vectors

I have a matrix that holds multiple vectors with associated labels. The matrix looks something like this: inputseq2s={{0,2,4,6}->"A",{9,7,6,5}->"B",{5,6,4,3}->C}} I then map a function across the matrix like this: outtable2=Map[{#[[2]],iterfunc[#[[1]]]}&,inputseq2s]; But the output looks like this: {{A,{0,1,0,1}},{B,{0,0,1,1}},{C,{0,0,0,1}}} And I need it to look like this: {{0,1,0,1}->"A",{0,0,1,1}->"B",{0,0,0,1}->"C"} But I have thus far been unsuccessful at figuring o

  1    2   3   4   5   6  ... 下一页 最后一页 共 11 页