wolfram-mathematica

Mathematica: FindRoot for common tangent

杀马特。学长 韩版系。学妹 提交于 2019-12-14 02:12:40
问题 I asked this question a little while back that did help in reaching a solution. I've arrived at a somewhat acceptable approach but still not fully where I want it. Suppose there are two functions f1[x] and g1[y] that I want to determine the value of x and y for the common tangent(s). I can at least determine x and y for one of the tangents for example with the following: f1[x_]:=(5513.12-39931.8x+23307.5x^2+(-32426.6+75662.x-43235.4x^2)Log[(1.-1.33333x)/(1.-1.x)]+x(-10808.9+10808.9x)Log[x/(1.

Puzzled by Function body evaluation

半世苍凉 提交于 2019-12-14 01:58:42
问题 I am puzzled by the following behavior of Function : In[1]:= InlineCellInMessage=Function[expr,DisplayForm[Cell[BoxData[MakeBoxes[expr,StandardForm]],"Input"]],{HoldAllComplete}] Out[1]= Function[expr,MakeBoxes[expr,StandardForm]] I expected to see unevaluated code inside Function in the output as in the following case: In[2]:= InlineCellInMessage=Function[x,x+1+1] Out[2]= Function[x,x+1+1] But I get the inline cell inside output. Why does this happen? 回答1: This is the result of FrontEnd

Mathematica: Tangent of Two Curves

落爺英雄遲暮 提交于 2019-12-14 00:26:07
问题 I asked this question yesterday but not sure if I made clear what I was looking for. Say I have two curves defined as f[x_]:=... and g[x_]:=... as shown below. I want to use Mathematica to determine the abscissa intersection of the tangent to both curves and store value for each curve separately. Perhaps this is really a trivial task, but I do appreciate the help. I am an intermediate with Mathematica but this is one I haven't been able to find a solution to elsewhere. 回答1: f[x_] := x^2 g[x_]

How to make code for sum of 2 integrals in Mathematica

≯℡__Kan透↙ 提交于 2019-12-13 23:27:11
问题 I am trying to quickly solve the following problem: f[r_] := Sum[(((-1)^n (2 r - 2 n - 7)!!)/(2^n n! (r - 2 n - 1)!)) * x^(r - 2*n - 1), {n, 0, r/2}]; Nw := Transpose[Table[f[j], {i, 1}, {j, 5, 200, 1}]]; X1 = Integrate[Nw . Transpose[Nw], {x, -1, 1}] I can get the answer quickly with this code: $starttime = AbsoluteTime[]; Quiet[LaunchKernels[]]; DIM = 50; Print["$Version = ", $Version, " ||| ", "Number of Kernels : ", Length[Kernels[]]]; Nw = Transpose[Table[f[j], {i, 1}, {j, 5, DIM, 1}]];

How to export to Excel numbers as text fields from Mathematica?

旧街凉风 提交于 2019-12-13 18:28:39
问题 I have a list containing telephone numbers in the form "+74951234567" and I wish to export it to Excel without quotes preserving original appearance with the plus sign. In Excel I can set the cell format to "Text" and then entering +74951234567 without quotes will not result in converting it to number. Is it possible to force Export in Mathematica to create Text cells? UPDATE I have found an approach which allows to get what I wish: I need to export the table as XML data with formatting

Why doesn't the Inset item show in Prolog in a plot?

让人想犯罪 __ 提交于 2019-12-13 18:12:34
问题 I apologise for the length of this question. My current Mathematica programming project involves replicating the very specific business rules my employing institution has for publication-quality plots of time series. One of these rules is that multipanel graphs have panel titles and subtitles centered near the top of the plot area. This worked fine using Prolog and Inset until I redid that bit of the function to allow explicit Prolog elements to be included as well. Then only the item passed

How to add element 'Show Animation Control' directly (not using Manipulate control setting)?

寵の児 提交于 2019-12-13 17:00:17
问题 I am not able to find how to do the following. When using Manipulate, it automatically shows a little '+' at the end of the control, as the following Manipulate[x, {{x, 0, "x"}, 0, 1, .1, Appearance -> "Labeled"} ] Now, I want to set up the control directly myself using Dynamic, and make it look just like the above, like this: (Btw, thanks to Simon for showing the correct syntax to do this here Manipulate[x, {{xChanged, False}, None}, Grid[{ {"x ", Slider[Dynamic[x, (x = #; xChanged = True; #

How to control Trigger state (Pause, Play) using code (not just buttons)

巧了我就是萌 提交于 2019-12-13 16:03:59
问题 A trigger is useful to use for animation, but I am not able to find a way to change the state of the trigger in the code (i.e. without having to hit the Pause or Play button myself). For example, suppose I want to do a simulation where when some event happen, I want to make the currently active trigger go to a PAUSE state, and when another event happen, I want the trigger to go to PLAY state. The buttons to do that will still be there, but I want to also be able to change these from the code

Can one extend the functionality of PDF, CDF, FindDistributionParameters etc in Mathematica?

╄→гoц情女王★ 提交于 2019-12-13 13:52:42
问题 I've started doing more and more work with the new Mathematica statistics and data analysis features. I attended the "Statistics & Data Analysis with Mathematica" online seminar on Tuesday (great presentation, I highly recommend it) but I've run into some problems that I hope someone on this forum might have a few moments to consider. I've created a rather extensive notebook to streamline my data analysis, call it "AnalysisNotebook". It outputs an extensive series of charts and data including

Patterns with Orderless subexpressions

心已入冬 提交于 2019-12-13 13:24:45
问题 I need to deal with patterns like f[{a,b}]=... where a and b are supposed to be orderless So far I've implemented this by using default Sort[] on subexpressions every time f is defined or evaluated. My questions are Is this as robust as Orderless ? Is there a better way? PS: An example application is tree decomposition where you recursively build up quantities like subtree[bag1->bag2] where bag1 and bag2 are orderless sets of vertices answer update Michael Pilat's answer shows how to define a