Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Calculus sorted by activeWhat is the recommended way in Mathematica to perform calculus integration range transformation?
https://community.wolfram.com/groups/-/m/t/3197184
Hi;
It is my understanding that Mathematica can perform calculus integration range coordinate transformation from, for example, from Cartesion to Polar or Cartesion to Cylindrical or Cartesion to Spherical or any other variation. However, I am having difficulty understanding exactly how to perform this transformation. Please review my attached notebook and help me understand what I am doing incorrectly.
Thanks,
Mitch Sandlin
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/66d4354d-5a4c-4d58-8f3d-cf8c20cd26afMitchell Sandlin2024-06-20T18:22:30ZNDSolveValue::litarg To avoid possible ambiguity, ... dependent variable in DirichletCondition
https://community.wolfram.com/groups/-/m/t/3197156
I've recently returned to using Mathematica after a 20 year break and so much has changed!
I am modeling an electric field and I'm struggling with NDSolveValue[] and I'm hoping someone can clarify where I'm lost. &[Wolfram Notebook][1]
Any help on how to understand and resolve the NDSolveValue[] error would be greatly appreciated.
[1]: https://www.wolframcloud.com/obj/489e69d0-0de5-4c7f-885f-4da7e091416aDavid Johnson2024-06-20T15:35:34ZDouble sum with j=i+1 eventual compiling problem
https://community.wolfram.com/groups/-/m/t/3195893
Hi all,
can't make this compile:
Sum[i^(-a)*j^(-a-1),{i,1,n},{j,i+1,n}]
where the real number "a" is supposed to be like: 0 < a < 1.
Wolfram can give answers with unknown numbers, without giving bounds to it.
And this works:
Sum[i^(-2)*j^(-3),{i,1,n},{j,i+1,n}]
There may not be any closed-form of this expression, but in this case, does wolfram give its usual text "Try the following..."?
What could I do?
Thanks in advance.Magox .2024-06-18T08:54:21ZHelp explaining an output of polar plot from Wolfram Alpha
https://community.wolfram.com/groups/-/m/t/3196154
In studying complex numbers and calculus in general I have been following a line of logical inquiry to try to normalize the complex plane, while I have now figured out a normalization method I am still stumped as to why wolfram alpha has such a strange response to some other equation I used as an intermediate step. This is the equation in question:
A polar plot of the following:
ζ(-s)^e + Γ^s/(π tan^(-1)(1/sqrt(2)))
The output cycles from one graph, generally to another before stopping and each time there's some random probability which graph I receive. I'm not sure if it's random or not, truly, to be clear. Just that I can't identify any pattern to which result will be displayed.
Included is a sample of one of the graphs it will display and a screenshot of the equation as well as a plain language version:
![enter image description here][1]
polar plot | ζ(-s)^e + Γ^s/(π tan^(-1)(1/sqrt(2)))
![enter image description here][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=OutputOne.png&userId=3194678
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=EquationStrange.png&userId=3194678Poppy Jane Lives2024-06-18T16:06:45ZHow do I tune my NDSolve code to start fast, so it can be run hundreds of times?
https://community.wolfram.com/groups/-/m/t/3196505
Hi!
I'm simulating a monolayer epithelia biological system, in which the cells behave fluid-like and frequently exchange neighbors. This neighbor exchange causes a problem, because it changes the differential equations which govern the tissue. So, I have a WhenEvent set up for each edge within the tissue, to track if it becomes short enough for the cells to exchange neighbors. Then, when such an event occurs, the code stops the NDSolve block, runs the neighbor exchange, then restarts.
But, this introduces huge overhead that I can't figure out the source of; I have a tracker keeping track of the time step that the solver is on, which stalls for significant amounts of time on each startup of NDSolve. I'm not sure what the program is doing at this time. Here's the code (only necessary modifications are changing the directories for the attatchments which I've included on this post)
SetDirectory[NotebookDirectory[]];
a = 225;
b = 225;
x0 = 0;
y0 = 0;
d = Sqrt[a^2 - b^2];
center = {x0, y0};
focus1 = {x0 - d, y0};
focus2 = {x0 + d, y0};
nCells = 50;
scale = Sqrt[
41.3083/(Pi*a*b/nCells)]; (*one length unit equals scale*micron*)
originalNCells = nCells;
ellipsePointList =
Table[{a*Cos[\[Theta]], b*Sin[\[Theta]]}, {\[Theta], 0, 2 \[Pi],
2 \[Pi]/200}];
cellularVoronoiDiagram =
Import["C:\\Users\\kaden\\Downloads\\savedvoronoidiagram.m"];
tAnneal = 750;
tHealing = 750;
\[Mu] = 30;
timeConstant =
0.8969476207347036;(*experimentally determined!!!!!!!!!! time \
should now be measured in seconds*)
timeDifference =
timeConstant/
8; (*this is a meaningless variable but I'm affraid if I delete it \
something will break*)
intercolationProportion = 0.00001;
nonDimensionalizedContractileConstant = 0.01771;
outerTension = 0.14;
lineTensionVariability = 0.01;
decayRate = 150;
Import["C:\\Users\\kaden\\Downloads\\voronoiDiagramFunctions.m"]
contractileTension =
Table[nonDimensionalizedContractileConstant, {i,
Length[cellularVoronoiDiagram[[2]]]}];
meanTensionCell =
Table[(contractileTension[[i]]/
originalScale)*(originalPerimeterScale - P0s[[i]]), {i,
Length[P0s]}];
meanTensionEdge =
Table[Total[
meanTensionCell[[getCellsAdjacentToEdge[edgeData[[All, 2]][[i]],
cellularVoronoiDiagram]]]], {i, Length[edgeData[[All, 2]]]}];
tMax = Max[{tHealing, tAnneal}] + 200;
lineTensions =
Table[proc =
ItoProcess[\[DifferentialD]lineTension[
t] == -1/
decayRate*(lineTension[t] -
meanTensionEdge[[i]]) \[DifferentialD]t + \[DifferentialD]w[
t], lineTension[t], {lineTension, meanTensionEdge[[i]]}, t,
w \[Distributed] WienerProcess[0, lineTensionVariability]];
Interpolation[
MovingAverage[RandomFunction[proc, {0, tMax, 0.5}], 5]][
t + 10], {i, Length[edgeData]}];
healths = Table[1, {i, Length[cellularVoronoiDiagram[[2]]]}];
Print["linetensionscreated"];
nVertices = Length[vertexList];
tCurrent = 0;
Subscript[vertexLists, 0] = vertexList;
Subscript[timeStop, 0] = 0;
Subscript[cellularVoronoiDiagrams, 0] = cellularVoronoiDiagram;
Subscript[edgeDatas, 0] = edgeData;
stepSize = 0.0000001;
SetSystemOptions[
"NDSolveOptions" -> "DefaultSolveTimeConstraint" -> 10.`];
solutions = {};
dummies = Table[Subscript[L, i], {i, Length[lineTensions]}];
substitutionsLineTensions =
Table[Subscript[L, i] -> lineTensions[[i]], {i,
Length[lineTensions]}];
Timing[Do[
(*odeList=D[Flatten[vertexList],t] == Flatten[
ParallelTable[(1/\[Mu])*forceOnVertex[i,cellularVoronoiDiagram,
vertexList,A0s,contractileTension,Table[0,{i,Length[edgeData]}],
edgeData,healths],{i,Length[vertexList]}]];*)
diffEQs =
D[Flatten[vertexList], t] ==
Flatten[Table[(1/\[Mu])*
forceOnVertexSolved[i, cellularVoronoiDiagram, vertexList,
A0s, contractileTension,(*lineTensions*)(*meanTensionEdge*)
dummies, edgeData, healths] /. substitutionsLineTensions, {i,
Length[vertexList]}]];
bcList =
Flatten[vertexList /. t -> tCurrent] ==
Flatten[cellularVoronoiDiagram[[1]]];
(*Check working precision*)
Timing[times = {};
Monitor[
s = NDSolve[{diffEQs, bcList,
With[{edgeData = edgeData, vertexList = vertexList},
WhenEvent[# - intercolationLength < 0,
(cellularVoronoiDiagram[[1]] =
Table[{vertexList[[i, 1]], vertexList[[i, 2]]}, {i,
Length[vertexList]}];
intercolatedEdge =
Position[edgeData[[All, 1]], #, Heads -> False][[1]][[1]];
Print["intercolating ", intercolatedEdge];
tCurrent = t;
"StopIntegration"
)] & /@ edgeData[[All, 1]]]},
Flatten[vertexList], {t, tCurrent, tAnneal},
StartingStepSize -> stepSize,
EvaluationMonitor :> AppendTo[times, t], AccuracyGoal -> 2,
PrecisionGoal -> 2], times[[-1]] ];
];
stepSize = (Subscript[x, 1][t] /. s[[1]] /. {t -> "Coordinates"} //
First // Differences)[[-1]];
AppendTo[solutions, s];
numIntercolations = j - 1;
Subscript[timeStop, j] = times[[-1]];
If[tAnneal - 0.01 < times[[-1]] < tAnneal + 0.01, Break[]];
tempCenter =
Mean[{cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]\
][[1]]]],
cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]][[\
2]]]]}];
newEdge =
r[((cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]][\
[1]]]] -
cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]\
][[2]]]])/
Norm[cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][\
[2]][[1]]]] -
cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]\
][[2]]]]])*(intercolationLength + 1)];
intercolate[edgeData[[intercolatedEdge]]];
cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]][[1]]]\
] = (tempCenter + 0.5*newEdge );
cellularVoronoiDiagram[[1]][[edgeData[[intercolatedEdge]][[2]][[2]]]\
] = (tempCenter - 0.5*newEdge);
Subscript[cellularVoronoiDiagrams, j] = cellularVoronoiDiagram;
Subscript[edgeDatas, j] = edgeData;
Subscript[vertexLists, j] = vertexList,
{j, 40000}]]
nCells = Length[cellularVoronoiDiagram[[2]]];
solutionTable =
Table[vertexList /. solutions[[i]][[1]], {i, Length[solutions]}];
cellularVoronoiDiagram[[1]] =
solutionTable[[numIntercolations + 1]] /. t -> tAnneal;
Thanks for any and all help!!
Best,
KadenKaden Tro2024-06-18T20:16:05ZDuffing oscillator: multiple Poincaré sections in single run of ODE solver, chaos, strange attractor
https://community.wolfram.com/groups/-/m/t/3195703
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=red-15-TTL-2L-ezgif.com-optimize.gif&userId=11733
[2]: https://www.wolframcloud.com/obj/e2537b62-169f-4cdd-9e43-b3165f926416Vitaliy Kaurov2024-06-18T04:13:09ZCalculation of Coxeter's integrals. Reduction to Ahmed integrals.
https://community.wolfram.com/groups/-/m/t/3195849
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/b2cbf8ed-b44a-4121-b0d4-b69a4a7c9e5cJosé Luis Garrido2024-06-18T08:00:23ZHow can i make this code faster?
https://community.wolfram.com/groups/-/m/t/3193984
How can i make this code faster
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/dde4985d-a668-498c-ad1a-eedd06612e73Raghad Al-amri2024-06-14T23:28:25ZNo output from an integral of Bessel function
https://community.wolfram.com/groups/-/m/t/3193353
I am trying to solve a integral of Bessel function. The Mathematica is just returning the same integral in output instead of solving it.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/0721159f-74cd-4bb5-8c49-d54710fe630dChandan Thakur2024-06-14T07:46:37Z