wolfram-mathematica,curve-fitting,nonlinear-functions

This can be done easily with the Quantile regression with B-splines package by Anton Antonov (direct link to the M-file): Needs["QuantileRegression`"] qfunc = QuantileRegression[data, data[[;; , 1]], {0.5}, InterpolationOrder -> 2][[1]]; // Quiet Plot[qfunc[x], {x, Min[data[[All, 1]]], Max[data[[All, 1]]]}, Frame -> True, PlotStyle -> Red, Prolog -> Point[data], PlotLabel ->...

java,jboss,kernel,wolfram-mathematica

The error indicates a problem with loading a native library. Java has a protocol for loading native libraries, which are .DLL files in Windows. Most likely it is starting the application using the explicit path in the string and then failing to load some DLL to communicate with it. Make...

python,wolfram-mathematica,sage

According to Trac 16703, this problem should be fixed in the latest Sage. I don't personally have a copy of Mathematica to test this on.

matlab,wolfram-mathematica,solver

Building on what jlandercy said, you can certainly use MATLAB's linprog function, which is MATLAB's linear programming solver. A linear program in the MATLAB universe can be formulated like so: You seek to find a solution x in R^n which minimizes the objective function f^{T}*x subject to a set of...

dynamic,graphics,slider,wolfram-mathematica,list-manipulation

If one slider is moved the other four change proportionally with all summing to 1. v = {0.2, 0.2, 0.2, 0.2, 0.2}; f = Function[{z, k}, {a, b, c, d, e} = v; m = n = o = p = q = 1; Switch[k, 1, a = z; m...

To get all the symbols (not necessarily variables) you could start with something like this: DownValues[f] which yields: {HoldPattern[f[x_]] :> 2 a x + b} The problem is then processing this in a way that you don't let Mathematica do the substitution. This is done with Hold: held=(Hold //@ DownValues[f][[1]])[[1,...

statistics,wolfram-mathematica,normal-distribution,cdf

1) MultinormalDistribution is now built in, so don't load MultivariateStatistics it unless you are running version 7 or older. If you do you'll see MultinormalDistribution colored red indicating a conflict. 2) this works: sig = .5; u = .5; dist = MultinormalDistribution[{0, 0}, sig IdentityMatrix[2]]; delta = CDF[dist, {xx, yy}]...

They kind of works but now you need to create rules for Derivative not to f really. And since Derivative is not even protected you can do something like: Derivative[n_][f][-x_] := -Derivative[n][f][x] f''[x] + f'''''''[-x] + f''[-x] + f[x] + f'''''''[x] f[x] is this ok?...

had a chance to check .. Assuming[ {z1 > 0, z2 > 0, s1 > 0, s2 > 0} , Simplify[Reduce[A > B]]] -> True note by removing the Simplify and looking at the conditional expression produced by Reduce you can see how to relax the assumptions a bit: Assuming[...

The output formatting needs to be mapped over the results. Export["mathematica1.dat", Transpose[{ Map[OutputForm[NumberForm[#, {3, 1}]] &, nwwa], Map[OutputForm[NumberForm[#, 6]] &, nkka]}], "Table"]; ...

java,matlab,wolfram-mathematica

Proposed Steps: Load images Extract features (color, edges locations, corner points, gabor jets) Define similarity measure Compute similarity score between features This is just a quick tip to get start with some literature... Regarding the platform I would suggest to download the library opencv in c++ http://opencv.org/ good luck...

This finds every builtin that has Plot in its name and a Frame option: Select[Symbol /@ Names["System`*Plot*"] , MemberQ[Options[#] , Frame -> _] & ] {ArrayPlot, BodePlot, CommunityGraphPlot, ContourPlot, \ DateListLogPlot, DateListPlot, DensityPlot, DiscretePlot, GraphPlot, \ LayeredGraphPlot, LineIntegralConvolutionPlot, ListContourPlot, \ ListCurvePathPlot, ListDensityPlot, ListLineIntegralConvolutionPlot, \ ListLinePlot, ListLogLinearPlot, ListLogLogPlot, ListLogPlot, \ ListPlot,...

math,wolfram-mathematica,series,calculus

This should be close: inner[i_, gamma_, k_] := Sum[(-1)^(el[1])/el[1]! Product[(-1)^(el[z] - el[z - 1])/(el[z] - el[z - 1])! ,{z, 2, i}], Evaluate[Sequence @@ ({{el[1], k, gamma}}~Join~Table[ { el[ii], el[ii - 1], gamma }, {ii, 2, i}])]] With[{gamma = 3, k = 1}, Sum[ inner[i, gamma, k], {i, gamma - 1}]]...

matlab,syntax,wolfram-mathematica

The provided code origins clearly from Mathematica. To do the same in Matlab, we can define a function handle: CC = @(theta) [cos(theta), 1i*sin(theta); 1i*sin(theta), cos(theta)] 1i is the imaginary unit in Matlab (I in Mathematica). Matlab uses [a,b;c,d] to define a 2x2-matrix ({{a,b},{c,d}} in Mathematica). The definition := is...

perl,loops,wolfram-mathematica

There's a certain amount of overhead in executing the inner loop (initialising the variable; making the checks to see if it should end) and in the first case, you are losing this overhead 10,000,000 times; in the second, you are only doing it 10 times. EDIT: Let s be the...

list,select,max,wolfram-mathematica

Thank you for the sample data, that always helps. I'm not certain I understand all your question, but perhaps this will let you explain what I am missing. This rawl = Import["psi.txt", "TSV"]; rawl = Drop[rawl, 3];(*drop unwanted header rows?*) {date, pressure, forwardflow, backwashflow, forwardpressure, backwashpressure, cycles, backwash} = Transpose[rawl]...

plot,wolfram-mathematica,intersection

You can use the Epilog option to add graphics primitives to a plot: intersections = {x, y} /. NSolve[y == -(x - 2)^2 + 4 && y == x/(x + 1), {x, y}]; Plot[{-(x - 2)^2 + 4, x/(x + 1)}, {x, 0, 4}, Filling -> {1 -> {{2}, {White,...

matrix,wolfram-mathematica,differential-equations

eq = { 975/2048 - 512 y[1] + 256 y[2], 175/128 + 256 y[1] - 512 y[2] + 256 y[3], 4095/2048 + 256 y[2] - 512 y[3] + 256 y[4]} b = -eq /. y[_] -> 0; a = Transpose[Table[ D[ eq, y[i]] , {i, 4}]]; a.Table[ y[i], {i, 4}]...

list,wolfram-mathematica,minimum

An old trick used to find the minimum is to find the max of -1 times the data. data = {1, 3, 1, 3};FindPeaks[data] which gives {{2, 3}, {4, 3}} To get the minimum use negate the data FindPeaks[-data] which gives {{1, -1}, {3, -1}} The x position is correct,...

python,arrays,select,indexing,wolfram-mathematica

numpy.ix_ creates an open mesh that can be used to index into the array. Your data will have to be a numpy ndarray. import numpy as np a = np.arange(9*9).reshape((9,9)) >>> >>> a array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8], [ 9, 10, 11, 12, 13, 14,...

(Ay-By)/(Ax-By)=0 (Cy-Dy)/(Cx-Dy)=0 These equations will give you the slopes of the two lines. When you set them equal to 0 it will also give you the y intercept of them giving you y=mx+b for both lines. Once you get this all you have to do is set them equal to...

java,arrays,eclipse,wolfram-mathematica

This is because you create a file that has one number in each line. If you would make just a space between the numbers, you would get a normal list. Anyway, without changing your Java code you can simply use randWalkDist = Flatten[Import["randomWalkDistribution.txt", "Data"]]; to flatten out the inner lists....

arrays,image-processing,multidimensional-array,3d,wolfram-mathematica

Your Mathematica syntax is seriously wonky. And you probably shouldn't be using Do, or any other looping construct, in the first place. Let's take some baby steps before we try to walk ... According to the documentation, and my experience, Image3D[{img1,img2}] loads the list of 2D images (the list is...

order,wolfram-mathematica,equation

here is a way to extract the value automatically: ode = y'' + y' + y == 0 ; Max[Cases[ ode , Derivative[n_][y] :> n , Infinity]] 2 note this just finds the largest derivative in the expression, it doesn't verify if the expression is actually an ode.....

debugging,haskell,functional-programming,wolfram-mathematica

This already exists in the Debug.Trace package. It's called traceShowId. (And it does use unsafePerformIO under the covers - you can see the implementation of trace here.)

Using your data list Dat2Countries as given, the map can be drawn like so:- colourfunction[country_String] := Module[{cases, value}, Catch[ cases = Cases[Dat2Countries, {country, _}]; If[cases == {}, Throw[LightGray]]; value = cases[[1, 2]]; Which[ value < 20, RGBColor[0.0352941, 0.254902, 0.352941], value < 40, RGBColor[0.305882, 0.498039, 0.592157], value < 60, RGBColor[0.0705882, 0.568627,...

As hinted by @agentp here is an answer which is OK: findb[exp_Plus, ptest_String, value_?NumberQ] := Module[{}, x /.Flatten[{FindInstance[(ToExpression[ StringJoin[ToString[exp, InputForm], ptest, ToString[value]]]) && x != 0 , x, Reals]}]] However I find that very verbose. Can it be improved?...

I got your simple example to work with a little mod .. f0 = [email protected]@DSolve[{f'[y] == 2 y, f[0] == 0}, f, y] g0 = g /. [email protected]@DSolve[{g'[x] == 2 (f[g[x]] /. f0), g[0] == 1}, g, x] fn = f /. [email protected]@NDSolve[{f'[y] == 2 y, f[0] == 0}, f,...

wolfram-mathematica,wolframalpha,wolfram-language

After the usual lots of trial and error that WolframAlpha didn't understand, finally WolframAlpha PrimeOmegaPlot link...

wolfram-mathematica,differentiation

Because the cosine function is even, the two forms are equivalent (cos(x^2 - 1) = cos(1 - x^2)). Apparently the simplification algorithms Mathematica uses were a tad over-enthusiastic in this case....

The only terms that are different in your "code" are (1-(t/x)^N)^(-2) and (-1+(t/x)^N)^(-2) and these are identical too. It's because the parentheses that are raised to the power of -2 are negatives of each other. A power of something to -2 is equal to 1 over the power the same...

math,wolfram-mathematica,symbolic-math

Your existing code appears to produce a solution (albeit large) on Mathematica 8 sol = DSolve[{p'[r] == 1/((r^2)*(((R - S)/(R^3)) - (1/(r^2)*(1 - S/r)))^(1/2))}, p[r], r] You can add the additional constraints on the solution, as part of the simplification. It doesn't appear to make a significant difference. Were you...

wolfram-mathematica,interpolation

Sounds like you want something like this in order to "plus" your lines. it1 = Interpolation[myPoints1]; it2 = Interpolation[myPoints2]; t1 = Table[it1[i], {i, 1.467, 1.497, 0.001}]; t2 = Table[it2[i], {i, 1.467, 1.497, 0.001}]; t3 = Transpose[{Range[1.467, 1.497, 0.001], t1 + t2}]; ListPlot[{myPoints1, myPoints2, t3}, Joined -> True, PlotRange -> {{1.467,...

Try restarting the kernel or just evaluate ClearAll[x, a, b, c] Your code works without errors in fresh kernel session....

graph,plot,wolfram-mathematica,equation

Running some examples for x = 3 for x=3: 40500*(3^(-0.1)+2^(-0.1)+1^(-0.1)) 114574. This can be found using Sum: Sum[40500*i^(-0.1), {i, 3}] or using Fold Fold[#1 + 40500*#2^(-0.1) &, 0, {1, 2, 3}] 114574. FoldList outputs the intermediate steps. FoldList[#1 + 40500*#2^(-0.1) &, 0, {1, 2, 3}] {0, 40500., 78287.8, 114574.} Accumulating...

c++,wolfram-mathematica,gaussian,convolution,fftw

Using FFT to do convolutions is only efficient when you have very large convolution kernels. In most blurring applications the kernel is much much smaller than the image, e.g. 3x3, so FFT would be significantly slower. There are many implementations for doing small-kernel convolutions. Most modern hardware supports such intrinsic...

I think "string hacking" might be what you are asking for. This myn = {9, 50, 0, 50, 1, 50, 2, 50, 3, 50, 4, 50, 5, 50, 6, 50, 7, 50, 8, 50, 9}; ToExpression[StringReplace[ToString[myn], ", " -> ""]][[1]] gives you this integer 9500501502503504505506507508509 That turns your list into...

As you could read on the Documentation page for the "General::ovfl" message you got, the problem here possible in bad starting values chosen by NonlinearModelFit. Let us try to specify better starting values: nlm = NonlinearModelFit[data, a*(1 - Exp[-b*x]), {{a, -1}, {b, 0}}, x]; nlm["BestFitParameters"] (*=> {a -> -134.847, b...

Export does not seem to work with SetOptions so I'm afraid its not possible. You can make your own like this: export[args__] := Export[args, ImageResolution -> 300]; then do export["image.png", image]; ...

python,regex,wolfram-mathematica,symbolic-math

First, you should clearly define the situations when to insert a * and when not to, to avoid changing, e.g., exp( to e*x*p*(. Now, create a few regular expressions matching those situations. patterns = [r"([0-9])\s*([a-z(])", # matches '2x', '2 x', or '2 (' r"([a-z])\s+([a-z])", # matches 'x y', but not...

k[x_] := Module[{p, z}, p = RecurrenceTable[ {a[n + 1] == 11 a[n], a[1] == 7}, a, {n, 1, x}]; z = Flatten[First /@ Cases[{#, MemberQ[IntegerDigits[#], 3]} & /@ p, {_, False}]]] m = 11; While[Length[s = k[m]] < 11, m++] s {7, 77, 847, 102487, 12400927, 1500512167, 181561972207, 1997181694277,...

The problem is the 'inexact' floating point value of W=1.2. If you use W=12/10 you get a result. Note in this case you actually get a faster/cleaner result if you leave all the numeric values out except for X until after integration: Clear[d,W,Rm,X]; f = 1/(1 - R^2/Rm^2); A =...

Needs["ErrorBarPlots`"]; data = {{{0, 0.00126517235028}, ErrorBar[0.0097546177348]}, {{1, 0.0132870239578}, ErrorBar[0.00717311242327]}, {{2, 0.00968907928987}, ErrorBar[0.0125454440978]}, {{3, 0.00835906062474}, ErrorBar[0.0196027916911]}, {{4, 0.0141038637039}, ErrorBar[0.0288324766544]}, {{5, 0.0467626302256}, ErrorBar[0.0423090450838]}, {{6, 0.0832535249208}, ErrorBar[0.0609066442506]}}; elp = ErrorListPlot[data, Frame -> True, PlotRange -> {{0, 6}, {-0.05, 0.18}}, Axes -> False, PlotStyle -> {AbsolutePointSize[7],...

regex,perl,wolfram-mathematica

Square brackets are special characters in a regex. Try: $line =~ /^Out\[1\]=/ I'd recommend reading a regex tutorial like this one to learn this kind of thing....

You have to use FullSimplify instead: FullSimplify[Gamma[z] == (z - 1)!, Element[z, Integers] && z > 0] FullSimplify[(Gamma[1 - z] Gamma[z]) == Pi/Sin[ Pi z] , Element[z, Complexes] && (0 < Re[z] < 1)] FullSimplify does more transformations as explained in the documentation....

list,arguments,wolfram-mathematica

size = 15; list = Table[0, {size}];(*Declare a list*) count = 1; While[count <= size, list[[count]] = InverseCDF[NormalDistribution[0, 1], RandomReal[]]; count++] Mean[list] (*Try to get the mean value*) Alternatively, size = 15; list = InverseCDF[NormalDistribution[0, 1], RandomReal[{0, 1}, size]] Mean[list] since InverseCDF computes over a list, which can be observed...

wolfram-mathematica,wolfram-language

Switch may be useful, for example: Switch[ # , _String , StringLength[#] , _List , Length[#] , __ , Null ] & /@ { "abc", {1, 2, 3, 4}, Pi} {3, 4, Null} ...

c,animation,math,wolfram-mathematica,data-visualization

Since OP has asked me to elaborate, here's my take as an answer. Most generally, you're plotting the function s(x) = a sin(bx + c), where a, b and c come from the original problem. Later we will shift the sine curve by some offset Z but I'll leave it...

java,logging,textbox,wolfram-mathematica

As Simon has pointed out I would suggest using JavaFX for this task. If you "just" need to display large amounts of log data without advanced highlighting (sub-string range highlighting), ListView is the component for you. It uses a virtualized layout container, so only the cells that are in the...

matrix,wolfram-mathematica,product,scalar

The . operator is specifically for tensor (including vector and matrix) multiplication. Just multiply without the .: w P + (w^3) P I can't explain your statement that the product as you have it yields a scalar. For example: P = {{1, 2}, {2, 3}}; w = 5; w.P Gives...

The b-spline is itself a graphics primitive so you cant pull out the "line" like that. You need to use the related BSplineFunction to generate your points: pts=BSplineFunction[{{-.4, -.3}, {0, -.6}, {.4, -.3}, {0, -1.2}}, SplineClosed -> True] /@ Range[0, 1, .01]; [email protected]@pts If you need to extract from a...

Let's examine the FullForm of Res to see what Res[[1,1,2]] means: In[1]:= Res = Solve[6 - 5 x + x^2 == 0] Out[1]= {{x -> 2}, {x -> 3}} In[2]:= FullForm[Res] Out[2]= List[List[Rule[x, 2]], List[Rule[x, 3]]] Hence: Res[[1]] = List[Rule[x,2]] Res[[1,1]] = Rule[x,2] Res[[1,1,2]] = 2 ...

parsing,lua,wolfram-mathematica,translation

I don't know of something already done in that direction but I would recommend you consider building a Mathematica to Lua translator in Mathematica, something like a "LuaForm" saving its output to a text file. It would use existing bricks such as FortranForm / CForm to convert basic expressions (such...

osx,cocoa,wolfram-mathematica,linker-error,mathlink

When not using mprep, you have to define certain symbols your self. I used mprep on an empty template and got this. This is the relevant section of mathlink.h: #ifndef _MLTM_H #define _MLTM_H /*************** Template interface ***************/ /* The following are useful only when using template files as * their...

I think the Reduce function in Mathematica is the appropriate tool for this. Reduce[d*a > d*b + e*b + e*c && a > 0 && b > 0 && c > 0 && d > 0 && e > 0 && d*b + e*b > e*c && a < b...

f[a_] := Integrate[x^2, x] /. x -> a f[1] 1/3 ...

Often it is preferable to use Module[]: powersum[x_,p_]:=Module[{sum},sum=0;For[i=1,i<x,i++,sum=sum+i^p];sum] or powersum[x_,p_]:=Module[{sum=0},For[i=1,i<x,i++,sum=sum+i^p];sum] this is essentially the same as wrapping in () except sum is protected in a local context. of course for this example you could as well use : powersum[x_,p_]:=Sum[i^p,{i,1,x-1}] or powersum[x_, p_] := Range[x - 1]^p // Total ...

loops,if-statement,wolfram-mathematica

If you want to choose items that satisfy a condition then Select is often useful. If you want to know how many items satisfied the criteria then Length is often useful. x = {1, 2, 3, 4, 5, 6}; Length[Select[x, 4<=#<=6&]] gives you 3. That # and & notation is...

Here is one approach, make two lists, one list for upper range of the erros: dataPLUS = {{0, 0.10981309359605919 + 0.05240427422664753`}, {0.2145, 0.09146326059113304 + 0.034195343626358385`}, {0.4290, 0.08230438177339898 + 0.02533205817067696`}, {0.6435, 0.0768141842364532 + 0.020205473852635995`}, {0.8580, 0.07223473349753692 + 0.016156209168991867`}, {4, 0.056122650246305375 + 0.009288720442961331}}; another list for the lower range of the errors...

There is usually an associated function in instances like this. In this case PeriodogramArray outputs the data. data = Table[ 2 Sin[0.2 Pi n ] + Sin[0.5 Pi n] + RandomReal[{-1, 1}], {n, 0, 127}]; Periodogram[data] magdata = PeriodogramArray[data]; ListLinePlot[10 Log[10, magdata], PlotRange -> {{0, Length[magdata]/2}, All}] ...

matlab,math,wolfram-mathematica,maxima,wxmathplot

For Maxima, try implicit_plot(f1(x, y) = f2(x, y), [x, <x0>, <x1>], [y, <y0>, <y1>]) where <x0>, <x1>, <y0>, <y1> are some floating point numbers which are the range of the plot. Note that load(implicit_plot) is needed since implicit_plot is not loaded by default. As an aside, I see that your...

wolfram-mathematica,wolfram-language

Use Quiet to suppress the warning messages, then select number cases. Slist = FinancialData["NASDAQ:*", "Lookup"]; Dlist = Cases[Quiet[{#, FinancialData[#]} & /@ Slist], {_, _?NumberQ}] ...

wolfram-mathematica,julia-lang

Two things: The first time you run the function the time will include the compile time of the code. If you want a apples to apples comparison with a compiled function in Mathematica you should run the function twice and time the second run. With your code I get: elapsed...

plot,wolfram-mathematica,branch-and-bound

The function you are looking for is RegionPlot: RegionPlot[ 2 x + 4 y <= 12 && 6 x + 2 y <= 27 && x <= 4 && x >= 0 && y >= 0, {x, 0, 5}, {y, 0, 5}] To make a nice-looking plot over the integer...

wolfram-mathematica,mathematica-7

It is often easier to use Grid than GraphicsGrid (or GraphicsRow). Thy this: Manipulate[ Grid[{{Plot[{rTM[\[Theta], n1, n2], rTE[\[Theta], n1, n2], tTM[\[Theta], n1, n2], tTE[\[Theta], n1, n2]}, {\[Theta], 0, \[Pi]/2}, PlotStyle -> Thick, PlotLegend -> {"rTM[\[Theta]]", "rTE[\[Theta]]", "tTM[\[Theta]]", "tTE[\[Theta]]"}, LegendPosition -> {1, -0.4}, AxesLabel -> Automatic, PlotRange -> {0, 1}, ImageSize...

Mathematica knows a lot, but it surely doesn't know everything about math. When stuffs breakdown, you can try a few different approaches: First let's graph it: ContourPlot[{Sin[x] == y, x + y == 5}, {x, -10, 10}, {y, -10, 10}] It's a line intersecting a sinusoidal wave and it looks...

matlab,matplotlib,wolfram-mathematica

The Matlab surf and mesh commands take matrices in input (and not vector). Your xx and yy data already represent a grid but they are just not organised as such. Simply reshape your vectors in order to form a grid and you can use the Matlab functions: X = reshape(xx,16,[])...

math,wolfram-mathematica,octave,probability

Since i and even 10000+i are very small against 36^20=1.33674945388437e+31, even for i=10^6, (36^20-10000-i)/(36^20-i) = (1-36^(-20)*(10000+i))/(1-36^(-20)*i) is approximatively 1-36^(-20)*(10000+i-i)-36^(-40)*((10000+i)*i+i*i) so the product for 10000 trials is (1-36^(-20)*10000)^10000-(1-36^(-20)*10000)^9999*36^(-40)*10000^3 and the first term is about exp(-36^(-20)*10^8) approx 1-7.48083342838978e-24, the second is smaller 36^(-20)*10^8*(36^(-20)*10^4), and thus very small against the difference of 1...

This may get you started. Clear[f]; SetAttributes[f, HoldFirst]; f[s_Plus, b__] := f[#, b] & /@ List @@ Hold[s][[1]] // Total f[a + b + c, d, e] f[a, d, e] + f[b, d, e] + f[c, d, e] ...

r,latex,wolfram-mathematica,mathml

There is builtin support for exporting expressions to Fortran and C. I suggest you export the expression to C and then edit the C expression. Details here: https://reference.wolfram.com/language/tutorial/GeneratingCAndFortranExpressions.html...

I am astonished. I never expected it to finish. But if you subtract off all the time for it to do the integrals then Reduce finishes in the blink of an eye. f[x_, y_] := Exp[a0 - 1 + a1*x + a2*y + a3*x*x + a4*y*y + a5*x*y]; g0[x_, y_]...

This starts searching for root at x = 0 and y = 0 eq = {a*x + b*y^2 - c*x^2 == a - b, a*x^2 + b*y^2 + b*x - c*y == b + c} param = {a -> 10, b -> 10, c -> 6} result = FindRoot[eq /....

matlab,wolfram-mathematica,matlab-figure,contour

The thing to keep in mind is that Mathematica is formula-oriented and is programmed in terms of mathematical variables, while Matlab is numerically oriented and programmed in terms of matrices and arrays. To evaluate a function of two variables on a grid, it is necessary to first generate that grid...

wolfram-mathematica,limit,wolframalpha

Limits of a function f along path p depends on which path is taken. You hint at this in the question. If we insert y=x^3 into f, we get the constant 1/2. So the limit of f towards (0,0) along the path y=x^3 is 1/2. Mathematica only computes limits along...

list,recursion,wolfram-mathematica

You are correct, res is being overwritten. The solution is to localise res to each call of function f using a module like so: f[u_] := Module[{res}, Print["u : ", u]; If[Length[u] == 1, Subscript[T, u[[1]]] - Subscript[\[Lambda], 1]^u[[1]], v = SetPartitions[Length[u]]; aux[v_] := Sum[u[[v[[i]]]], {i, 1, Length[v]}]; res =...

You can easily fix this by surrounding the computation with SetPrecision, not the initial value: ClearAll[s] s[i_] := s[i] = SetAccuracy[2*s[i - 1] - 3*(s[i - 1])^2, 20] s[0] = 3/10; s[40] (* Out[14]= 0.33333333333333333333 *) Let me say something about the page you referred to. To quote the text...

wolfram-mathematica,complex-numbers

You first need to convert the polar form of a to real and imaginary parts: (r, θ) = r*(cos(θ) + i*sin(θ)) Head over to Wikipedia if you need a quick refresher. As for the Wolfram Alpha input, you can just write it verbatim: 440*(cos(10) + i*sin(10)) / (39 - 18i)...

Labeled[ Plot[Sin[2 x], {x, 0, 2 Pi}, AxesStyle -> Directive[Thick, FontSize -> 15]], {Style["time (hr)", 20, FontFamily -> "Arial", [email protected]], Rotate[ Style["Concentration (nM)", 20, FontFamily -> "Arial", [email protected]], 90 Degree]}, {Bottom, Left}] Labeled[ Plot[Sin[2 x], {x, 0, 2 Pi}, AxesLabel -> {Style["\nhr", 20]}, AxesStyle -> Directive[Thick, FontSize -> 20]], {Style["nM",...