Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Calculus sorted by activeUsing implicit Euler and fixed step size for solving
https://community.wolfram.com/groups/-/m/t/3146964
I used implicit Euler and fixed step size to solve the differential equation, but the system prompted that "FixedStep" cannot be used. What is the reason for this and how should I modify the program?
system = {vi q[t] == l il'[t] + ir[t] r, il[t] == ir[t], il[0] == 0};
control = {q[0] == 1,
WhenEvent[Mod[t, \[Tau]] == (2/3) \[Tau], q[t] -> 0],
WhenEvent[Mod[t, \[Tau]] == 0, q[t] -> 1]};
pars = {vi -> 24, r -> 22, l -> 2 10^-2,
c -> 1 10^-4, \[Tau] -> 25/10 10^-4};
sol = NDSolve[{system, control} /. pars, {il, q}, {t, 0, .2},
StartingStepSize -> step,
Method -> {"FixedStep", Method -> "LinearlyImplicitEuler"},
DiscreteVariables -> q];
a = Evaluate[il[t] /. sol];
Plot[a, {t, 0, 0.06}, AxesLabel -> {"s", "il[t]/A"},
PlotLegends -> {"LinearlyImplicitEuler"}, PlotStyle -> {Red},
PlotRange -> All]James James2024-03-25T05:43:21ZThe AskConstants application for constant recognition
https://community.wolfram.com/groups/-/m/t/3148139
[![enter image description here][1] ][2]
*Figure 1: An exact result for an integral that Mathematica through 12.1 cannot do. (Click the image for higher resolution version)*
&[Wolfram Notebook][3]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Maininterface2_callout.png&userId=20103
[2]: https://www.wolframcloud.com/obj/640da236-c104-458a-9a83-a1cf47a0b4c2
[3]: https://www.wolframcloud.com/obj/24702568-f3f8-4570-85af-b541b62272e9David Stoutemyer2024-03-26T19:53:11ZNDSolve error inside Plot: $RecursionLimit :Recursion depth of 1024 exceeded
https://community.wolfram.com/groups/-/m/t/3148528
hello, i have been trying to plot the maximum range for theta for a projectile motion experiencing linear drag, but i keep getting errors regarding the written code. when trying to transform y[t] to a function yy[t_] rather than the replacement rule there seems to be no wolfram language translation found and when rooting i get a message:$RecursionLimit
:Recursiondepthof1024exceeded.
tfinal[theta_]:=[s=NdSolve[{x' ' [t] == b x' [t] , y' ' [t] == -b y' [t] - g, x[0] == 0, y[0] == 0, x'[0] == v Cos [theta], y'[0] == v Sin[theta]}, {x,y}, {t, 0, 10}];
yy[t_] := y[t] /. s[[1]];
xx[t_] := x[t] /. s[[1]];
xfinal[theta_]:=x[tfinal[theta]]
plot[xfinal[theta], {theta,0.01,2.5}jony will2024-03-27T10:34:33ZAhmed Integral doesn't evaluate
https://community.wolfram.com/groups/-/m/t/3145656
Why doesn't Mathematica evaluate the well-known Ahmed integral?
$$ \int_0^1 \frac{\tan ^{-1}\left(\sqrt{x^2+2}\right)}{\left(x^2+1\right)
\sqrt{x^2+2}} \, dx $$
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/8f674141-14a4-4063-a5e5-b7e8ea9c9eb5José Luis Garrido2024-03-22T07:44:29ZSimple position, velocity and acceleration notebook with dimensional checking fails?
https://community.wolfram.com/groups/-/m/t/3146381
Since physics usually involves vectors (frequently 3D) with physical dimensions. A quite frequent source of error in physics math is dimensional conflict. It is important to write out notebooks with vector elements defined with Quantity. I've been working on a very simple notebook involving position, velocity and acceleration and decided to write a convenience function to help with generating the vectors with associated magnitude variables that can be set, including setting them to functions of time so that I can define the velocity as the time derivative of position and acceleration as time derivative of velocity.
The attached notebook demonstrates the difficulty with this simple notebook.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/7aeb8dbd-e9f3-4476-9dcd-940a29048270James Bowery2024-03-23T23:00:30ZExploring and visualizing solutions of ordinary differential equations
https://community.wolfram.com/groups/-/m/t/3146435
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/34676387-07b7-4db5-ab60-e03210801861Athanasios Paraskevopoulos2024-03-23T21:29:04ZSolving limits without using Lhospital
https://community.wolfram.com/groups/-/m/t/3146141
hello, I use Mathematica for Calculus 1, and Mathematica uses the l hospital rule in step-by-step solutions of limit results, how can I make it solve without using l hospital and see step-by-step solutions of thisMesut Mehmet Genç2024-03-22T19:50:14ZHow to evaluate solutions of a first order ODE system while using NDSolve?
https://community.wolfram.com/groups/-/m/t/3145953
Hello,
If one solves a single ODE by NDSolve, the following function un[t_] correctly evaluates the numerical solution obtained:
sol0=NDSolve[{u'[t]+u[t]==0,u[0]==1},u[t],{t,0,1}];
un[t_]:=Evaluate[First[u[t]/.sol0]];
un[1/2]
0.606531
My question is: how to define a corresponding function in the case of an ODE system?
My following attempt to devise an analogous function failed:
sol=NDSolve[{Subscript[u, 1]'[t]+Subscript[u, 1][t]-Subscript[u, 2][t]==0,Subscript[u, 2]'[t]-Subscript[u, 1][t]+Subscript[u, 2][t]==0,Subscript[u, 1][0]==1,Subscript[u, 2][0]==2},{Subscript[u, 1][t],Subscript[u, 2][t]},{t,0,1}];
Subscript[uns, i][t_]:=Evaluate[sol[[1]][[i]][[2]]];
Part::pkspec1: The expression i cannot be used as a part specification.
Subscript[uns, 1][1/2]
It seems that "i" must be a predefined constant, so how one can access a relevant FunctionInterpolation object corresponding to a variable "i"? Or is there a better alternative?
LesławLeslaw Bieniasz2024-03-22T19:03:26ZNDSolveValue in FEM not finish
https://community.wolfram.com/groups/-/m/t/3145804
I'm having trouble finishing the calculations in Mathematica 13.2.1.0.
I'm trying to solve a 3D heat conduction equation (a type of partial differential equation) using the FEM package, but NDSolveValue didn't finish.
The fem mesh is created as intended.
Changing MaxStepSize, WorkingPrecision, and MeshRefinementFunction did not improve the situation.
I am not sure if the code of initial conditions and boundary conditions are appropriate.
I would appreciate any advice you could give me.
Code:
Needs["NDSolve`FEM`"];
simX = 0.05;
simY = 0.03;
gapX = 0.03;
gapY = 0.01;
gapZ = 0.01;
TotalArea = Rectangle[{-simX, -simY}, {simX, simY}];
Board1 = Rectangle[{-gapX, -gapY}, {gapX, -(gapY + gapZ)}];
Board2 = Rectangle[{-gapX, gapY}, {gapX, gapY + gapZ}];
Boards = RegionUnion[Board1, Board2];
Gap = Rectangle[{-gapX, -gapY}, {gapX, gapY}];
Env = RegionDifference[TotalArea, Gap];
(* Mesh Generation *)
bmesh = ToBoundaryMesh[
"Coordinates" ->
{{-simX, -simY}, {-simX, simY}, {simX, simY}, {simX, -simY},
{-gapX, -gapY}, {-gapX, -(gapY + gapZ)}, {gapX, -(gapY +
gapZ)}, {gapX, -gapY},
{-gapX, gapY}, {-gapX, gapY + gapZ}, {gapX, gapY + gapZ}, {gapX,
gapY} },
"BoundaryElements" ->
{LineElement[{
{1, 2}, {2, 3}, {3, 4}, {4, 1},
{5, 6}, {6, 7}, {7, 8}, {8, 5},
{9, 10}, {10, 11}, {11, 12}, {12, 9},
{6, 7}, {7, 11}, {11, 10}, {10, 6}
}]},
"RegionHoles" ->
{{0, -(gapY + gapZ/2)}, {0, gapY + gapZ/2}}
]
bmesh["Wireframe"]
mesh = ToElementMesh[bmesh,
MeshRefinementFunction ->
Function[{vertices, area},
Block[{x, y}, {x, y} = Mean[vertices];
If[Abs[x] < gapX*1.5 && Abs[y] < gapY*1.5, area > 0.5,
area > 0.9 ]
]]];
mesh["Wireframe"]
c = 1006;(*(specific heat[J/kg ℃])*)
rho = 1.166;(*(density[kg/m3])*)
k = 0.0257; (*Thermal conductivity of air[W/(m K)]*)
eq = c*rho*D[T[x, y, t], t] ==
k (D[T[x, y, t], {x, 2}] + D[T[x, y, t], {y, 2}]);
T0 = 30 + 273.15;
T1 = 40 + 273.15;
ic = T[x, y, 0] ==
Piecewise[{{T1, {x, y} \[Element] Env}, {T0, {x, y} \[Element]
Gap}}];
bc = NeumannValue[0,
x == -simX || x == simX || y == -simY || y == simY];
U = NDSolveValue[{eq, ic2}, T, {x, y} \[Element] mesh, {t, 0, 1},
MaxStepSize -> 1, WorkingPrecision -> MachinePrecision];Akira O2024-03-22T04:07:12Z⭐ [R&DL] Wolfram R&D Developers on LIVE Stream
https://community.wolfram.com/groups/-/m/t/2593151
**Introducing our brand new YouTube channel, [Wolfram R&D][1]! Our channel features livestreams, behind-the-scenes creator presentations, insider videos, and more.**
----------
Join us for the unique Wolfram R&D livestreams on [Twitch][2] and [YouTube][3] led by our developers!
You will see **LIVE** stream indicators on these channels on the dates listed below. The live streams provide tutorials and behind the scenes look at Mathematica and the Wolfram Language directly from developers.
Join our livestreams every Wednesday at 11 AM CST and interact with developers who work on data science, machine learning, image processing, visualization, geometry, and other areas.
----------
⭕ **UPCOMING** EVENTS
- Mar 22 -- [20 Years of xAct Tensor Computer Algebra][58]
- April 3 -- [Explore the Total Solar Eclipse of April 2024][59]
- April 24 -- FeynCalc with [Vladyslav Shtabovenko][60]
----------
✅ **PAST** EVENTS
- Feb 28 -- [Zero Knowledge Authentication][57]
- Jan 17 -- [Nutrients by the Numbers][56]
- Dec 13 -- [Understanding Graphics][55]
- Oct 18 -- [Overview of Number Theory][54]
- Sep 27 -- [QMRITools: Processing Quantitative MRI Data][52]
- Sep 13 -- [Make High Quality Graph Visualization][51]
- Sep 6 -- [Insider's View of Graphs & Networks][53]
- Aug 30 -- [Labeling Everywhere][49]
- Aug 22 -- [Equation Generator for Equation-of-Motion Coupled Cluster Assisted by CAS][48]
- Aug 16 -- [Foreign Function Interface][4]
- July 26 -- [Modeling Fluid Circuits][6]
- July 19 -- [Geocomputation][5]
- July 5 -- [Protein Visualization][7]
- Jun 14 -- [Chat Notebooks bring the power of Notebooks to LLMs][8]
- May 31-- [Probability and Statistics: Random Sampling][9]
- May 24 -- [Problem Solving][10]
- May 17 -- [The state of Optimization][11]
- May 10 -- [Building a video game with Wolfram notebooks][12]
- April 26 -- [Control Systems: An Overview][13]
- April 19 -- [MaXrd: A crystallography package developed for research support][14]
- April 5th -- [Relational database in the Wolfram Language][15]
- Mar 29th -- [Build your first game in the Wolfram Language with Unity game engine] [16]
- Mar 22nd -- [Everything to know about Mellin-Barnes Integrals - Part II][17]
- Mar 15th -- [Building your own Shakespearean GPT - a ChatGPT like GPT model][18]
- Mar 8th -- [Understand Time, Date and Calendars][19]
- Mar 1st -- [Introducing Astro Computation][20]
- Feb 22nd -- [Latest features in System Modeler][21]
- Feb 15th -- [Everything to know about Mellin-Barnes Integrals][22]
- Feb 8th -- [Dive into Video Processing][23]
- Feb 1st -- [PDE Modeling][24]
- Jan. 25th -- [Ask Integration Questions to Oleg Marichev][25]
- Jan. 18th -- [My Developer Tools][26]
- Jan. 11th -- [Principles of Dynamic Interfaces][27]
- Dec. 14th -- [Wolfram Resource System: Repositories & Archives][28]
- Dec. 7th -- [Inner Workings of ImageStitch: Image Registration, Projection and Blending][29]
- Nov. 30th -- [Q&A for Calculus and Algebra][30]
- Nov. 23rd -- [xAct: Efficient Tensor Computer Algebra][31]
- Nov. 16th -- [Latest in Machine Learning][32]
- Nov. 9th -- [Computational Geology][33]
- Nov. 2nd -- [Behind the Scenes at the Wolfram Technology Conference 2022][34]
- Oct 26th -- [Group Theory Package (GTPack) and Symmetry Principles in Condensed Matter][35]
- Oct 12th -- [Tree Representation for XML, JSON and Symbolic Expressions][36]
- Oct. 5th -- [A Computational Exploration of Alcoholic Beverages][37]
- Sept. 28th -- [Q&A with Visualization & Graphics Developers][38]
- Sept. 14th -- [Paclet Development][39]
- Sept. 7th -- [Overview of Chemistry][40]
- Aug. 24th -- [Dive into Visualization][41]
- Aug. 17th -- [Latest in Graphics & Shaders][42]
- Aug. 10th -- [What's new in Calculus & Algebra][43]
> **What are your interests? Leave a comment here on this post to share your favorite topic suggestions for our livestreams.**
**Follow us on our live broadcasting channels [Twitch][44] and [YouTube][45] and for the up-to-date announcements on our social media: [Facebook][46] and [Twitter][47].**
[1]: https://wolfr.am/1eatWLcDA
[2]: https://www.twitch.tv/wolfram
[3]: https://wolfr.am/1eatWLcDA
[4]: https://www.youtube.com/watch?v=C82NHpy7D6k
[5]: https://community.wolfram.com/groups/-/m/t/2985580
[6]: https://community.wolfram.com/groups/-/m/t/2982197
[7]: https://community.wolfram.com/groups/-/m/t/2982114
[8]: https://youtu.be/ZqawtrWwE0c
[9]: https://community.wolfram.com/groups/-/m/t/2946101
[10]: https://community.wolfram.com/groups/-/m/t/2925156
[11]: https://community.wolfram.com/groups/-/m/t/2921756
[12]: https://community.wolfram.com/groups/-/m/t/2918746
[13]: https://community.wolfram.com/groups/-/m/t/2917597
[14]: https://community.wolfram.com/groups/-/m/t/2911327
[15]: https://community.wolfram.com/groups/-/m/t/2907390
[16]: https://community.wolfram.com/groups/-/m/t/2921593
[17]: https://community.wolfram.com/groups/-/m/t/2861119
[18]: https://community.wolfram.com/groups/-/m/t/2847286
[19]: https://community.wolfram.com/groups/-/m/t/2851575
[20]: https://community.wolfram.com/groups/-/m/t/2852934
[21]: https://community.wolfram.com/groups/-/m/t/2842136
[22]: https://community.wolfram.com/groups/-/m/t/2838335
[23]: https://community.wolfram.com/groups/-/m/t/2827166
[24]: https://community.wolfram.com/groups/-/m/t/2823264
[25]: https://community.wolfram.com/groups/-/m/t/2821053
[26]: https://youtu.be/istKGqpDUsw
[27]: https://community.wolfram.com/groups/-/m/t/2777853
[28]: https://youtu.be/roCkXVkDuLA
[29]: https://youtu.be/pYHAz-NatXI
[30]: https://youtu.be/r7Hjdr_D7c4
[31]: https://community.wolfram.com/groups/-/m/t/2713818
[32]: https://community.wolfram.com/groups/-/m/t/2705779
[33]: https://community.wolfram.com/groups/-/m/t/2701172
[34]: https://youtu.be/UrM-OBu3H9o
[35]: https://community.wolfram.com/groups/-/m/t/2678940
[36]: https://community.wolfram.com/groups/-/m/t/2649407
[37]: https://community.wolfram.com/groups/-/m/t/2635049
[38]: https://community.wolfram.com/groups/-/m/t/2618033
[39]: https://community.wolfram.com/groups/-/m/t/2616863
[40]: https://community.wolfram.com/groups/-/m/t/2613617
[41]: https://community.wolfram.com/groups/-/m/t/2605432
[42]: https://community.wolfram.com/groups/-/m/t/2600997
[43]: https://community.wolfram.com/groups/-/m/t/2596451
[44]: https://www.twitch.tv/wolfram
[45]: https://wolfr.am/1eatWLcDA
[46]: https://www.facebook.com/wolframresearch
[47]: https://twitter.com/WolframResearch
[48]: https://www.youtube.com/live/ElP55ZILxPw?si=nsAPOQ3u-RbvuGKX
[49]: https://community.wolfram.com/groups/-/m/t/3007543
[50]: https://community.wolfram.com/web/charlesp
[51]: https://community.wolfram.com/groups/-/m/t/3019288
[52]: https://www.youtube.com/live/KM1yWHRrF2k?si=g2R7rHB2IinVRpo6
[53]: https://community.wolfram.com/groups/-/m/t/3009184
[54]: https://community.wolfram.com/groups/-/m/t/3064700
[55]: https://community.wolfram.com/groups/-/m/t/3084291
[56]: https://community.wolfram.com/groups/-/m/t/3104670
[57]: https://community.wolfram.com/groups/-/m/t/2575404
[58]: https://www.bigmarker.com/wolfram-u/xact-tensor-computer-algebra-mar-2024
[59]: https://www.bigmarker.com/wolfram-u/eclipse-event-2024
[60]: https://community.wolfram.com/web/vshtabovenkoCharles Pooh2022-08-05T21:37:19ZExploration of one-dimensional Schrödinger equation solutions 2: Wavefunction & Polynomial Potential
https://community.wolfram.com/groups/-/m/t/3145353
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=main_image2.gif&userId=20103
[2]: https://www.wolframcloud.com/obj/7451c360-5b6c-4e20-8938-ac01d85d212fKlaus von Bloh2024-03-21T15:45:04ZMatrix Inversion problem with a determinant equals to zero
https://community.wolfram.com/groups/-/m/t/3145325
Hi, I hope you are all doing well. I would like to plot the results of multiplying the inverse matrix of "g" by the matrix "G", However the determinant of the matrix "g" equals to zero and the matrix have a very big dimensions and I can't do the calculus by hand, If any of you know how to solve this problem It will help me a lot, Thank you all in advance
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/952ec2ba-1b4f-4316-9959-a555730e4808Leo Murphy2024-03-21T11:44:27ZHow to avoid NDSolve::ndcf: Repeated convergence test failure?
https://community.wolfram.com/groups/-/m/t/3145190
Hello,
My neverending efforts to force NDSolve to very accurately solve a certain PDE have led me to try to solve a corresponding system of nonlinear ODEs resulting from orthogonal collocation discretization. I finally managed to obtain a reasonably looking solution of this system by using NDSolve with default settings, but I would prefer to use fixed grid implicit Runge Kutta methods, because I want to study convergence by varying step sizes. I also see (by considering some other, simpler examples) that fixed grid RK methods tend to produce more accurate results, whereas the default automatic solver yields solutions that sometimes have errors much bigger than assumed tolerances. Unfortunately, in the fixed grid case I get an error message:
NDSolve::ndcf: Repeated convergence test failure. Unable to continue.
and the calculations are interrupted. What this message means and is there any way to avoid it? For me this message is incomprehensible, because in the case of fixed grids I don't see a reason for any convergence tests. I would rather expect them in the case of default NDSolve settings, as in such a case some automatism is involved.
LesławLeslaw Bieniasz2024-03-21T09:01:56Z