Message Boards Message Boards

[WSG23] Daily Study Group: Solving ODEs and PDEs

Posted 10 months ago

A Wolfram U Daily Study Group on "Solving ODEs and PDEs" begins on Monday, August 8, 2023.

Join me and a cohort of fellow enthusiasts to learn about the techniques for solving ordinary differential equations (ODEs) and partial differential equations (PDEs) using Wolfram Language. Learn how to use the DSolve (for symbolic solutions) and the NDSolve (a general numerical differential equation solver) functions. Topics covered include the numerical method of lines, the finite element method (FEM), the use and construction of meshes, boundary value problems and eigenvalue problems.

Participate in live Q&A and review your understanding through interactive in-session polls. Complete quizzes at the end of the study group to get your certificate of program completion.

August 7-11, 2023, 11am-12pm CT (4-5pm GMT)

REGISTER HERE

Please feel free to use this thread to collaborate and share ideas, materials and links to other resources with fellow learners.

I look forward to seeing you online!

enter image description here

POSTED BY: Luke Titus
32 Replies

Much thanks to the wonderful participation we enjoyed with this group! Quiz results have been determined with sharable links sent to everyone who earned their completion certificate. Congratulations! If you weren't notified and have specific questions about your results, please send email to wolfram-u@wolfram.com.

POSTED BY: Jamie Peterson

Yes, I wonder too. I got the passing grade, but made three mistakes. I am interested to find the correct answers.

So it has been several days since the quiz deadline has passed. I wrote the quiz about a week ago and got a passing grade. I was wondering about how to check if the certificate has been issued (or if there is a certificate for this course).

Thanks in advance.

POSTED BY: Andrew Nagy

I completed the quiz. How i can see my mistakes and correct answers?

Luke, Cassidy and everyone else involved in developing this course ... many thanks ! I'm excited about trying out the new tools I've learned about.

POSTED BY: Frank Gonzalez

Thank you so much for joining!

POSTED BY: Luke Titus

I can happily say that the program so far has given me some additional knowledge on how to solve PDEs. Especially the line method which I have never used before.

Thank you for joining!

POSTED BY: Luke Titus
Posted 9 months ago

Great course so far - thanks! This question might be answered tomorrow, but as that will be the last day I'd like to ask it here. My main usage of FEM will involve complex (complicated) boundaries which I can create in Autocad and Import the dxf into MMA, for example as LineObject's or as a MeshRegion's. Can do this separately for each object, so for example creating two MeshRegion's. I'm having trouble converting a MeshRegion into a BoundaryMesh using ToBoundaryMesh. Can you recommend any resources for meshing dxf objects, generating a BoundaryMesh from a complex MeshRegion, or dealing with multiple complex (=complicated) objects?

POSTED BY: Russell Watt

If you are having trouble with the boundary mesh, you could try forming the full mesh with ToElementMesh. Just as an example with using an arbitrary .dxf file from the documentation:

First, load the mesh and view the wireframe:

<< NDSolve`FEM`
reg = Import["http://exampledata.wolfram.com/gear.6"];
mesh = ToElementMesh[reg];
mesh["Wireframe"]

Solve an arbitrary equation over that region:

sol = NDSolveValue[{Laplacian[f[x, y, z], {x, y, z}] == 0, DirichletCondition[f[x, y, z] == 0, True]}, f[x, y, z], {x, y, z} \[Element] mesh]

Visualize the result

ContourPlot3D[sol, {x, y, z} \[Element] mesh]

If you are still having problems, you may want to try using RepairMesh and FindMeshDefects while the region is still a MeshRegion and before you use ToElementMesh or ToBoundaryMesh

https://reference.wolfram.com/language/ref/RepairMesh.html https://reference.wolfram.com/language/ref/FindMeshDefects.html

When using ToElementMesh and ToBoundaryMesh the options that control the Mesh Quality and the Mesh Order might be useful. These are discussed in the options section of those documentation pages:

https://reference.wolfram.com/language/FEMDocumentation/ref/ToElementMesh.html

There is also the Element Mesh Generation and Element Mesh Visualiation tutorials which are a part of the NDSolve tutorial which may be helpful as well with troubleshooting mesh generation.

https://reference.wolfram.com/language/FEMDocumentation/tutorial/ElementMeshCreation.html https://reference.wolfram.com/language/FEMDocumentation/tutorial/ElementMeshVisualization.html

POSTED BY: Luke Titus

Is it possible to implement wavelets into NDSolve? For instance to solve PDE.

There is not anything built into NDSolve for doing wavelet analysis, but as Athanasios pointed out, Mathematica has a lot of functionality related to Wavelet Analysis.

https://reference.wolfram.com/language/guide/Wavelets.html

In addition to that guide page, the following tutorial may be helpful as well.

https://reference.wolfram.com/language/tutorial/DefiningYourOwnWavelet.html

POSTED BY: Luke Titus

Question: Wolfram, in general, has, on various levels (math, software syntaxis, etc.) outstanding documentation. A Wolfram user goes through smooth calculations and attendant great results. By most measures, a superior experience.

However, I would like to grow an appreciation for the "overload" brought about by increasing precision, for example. Also, what are some of the complexities involved in attempting to get a plot right? Where are these issues discussed?

I hope I was able to answer your question verbally during the class. The documentation link below talks about the maximum number that can be represented when doing arbitrary precision.

https://reference.wolfram.com/language/ref/$MaxNumber.html

The documentation page for the various plotting functions, and the related tutorials found at the very bottom of the documentation page, are a good place to start when trying to get a plot to look the way you want it to.

POSTED BY: Luke Titus

Thank you, Luke. Your presentation is very clear so far. Good job.

Thank you for sharing. It looks like that pet store is going to have a lot of rainbow fish!

POSTED BY: Luke Titus

I continued exploring the model for a while but at the end, I have a question as you will see. Could you explain to me why this is happening?

Hi Athanasios. Thanks for sharing the notebook. There is a lot there so I may have missed something, but it appears to me that the growth rate is quite large. The results from DSolve have the term Exp[0.7*t] in them, which is going to make the population grow extremely fast. Considering just the birth rate, if you want there to be 0.7 births per year, I think what you want is the following

In[1]:= DSolve[{P'[t] == 0.7, P[0] == 30}, P[t], t] // Simplify
Out[1]= {{P[t] -> 30. + 0.7 t}} 
POSTED BY: Luke Titus

In the second case, I have changed the Growth rate : $0.7(1-\frac{P(t)}{750})$. Now I have used the NDSolve to solve the problem

eqn = {P'[t] == 0.7*(1 - P[t]/750)*P[t] - 20}
cond = {P[0] == 30}
sol = NDSolve[{eqn, cond}, P[t], {t, 0, 30}]

Then I calculated the equilibrium points

eqn = 0.7*(1 - P[t]/750)*P[t] - 20;
equilibriumPoints = Solve[eqn == 0, P[t]];  

And I have the following plot

p1 = Plot[P[t] /. sol, {t, 0, 20}, PlotStyle -> {Thick, Green}]

Now I am trying to solve with Euler's Method:

sol1 = NDSolve[{P'[t] == 0.7*(1 - P[t]/750)*P[t] - 20, cond}, P[t], {t, 0, 20}, Method -> "ExplicitEuler", MaxSteps -> Infinity]
p2 = Plot[P[t] /. sol1, {t, 0, 30}, PlotStyle -> {Dashed, Red}]

And then I am trying to compare the two solutions

Show[p1, p2, PlotLabel -> "Comparison of Solutions"]

Here it is what I ask for an explanation.

I think it is because your second NDSolve call is only going out to 20, so the solution isn't calculated past there. I'm getting the same result for both calculation:

eqn = {P'[t] == 0.7*(1 - P[t]/750)*P[t] - 20};
cond = {P[0] == 30};
sol = NDSolveValue[{eqn, cond}, P[t], {t, 0, 30}];
sol1 = NDSolveValue[{eqn, cond}, P[t], {t, 0, 30}, Method -> "ExplicitEuler", MaxSteps -> Infinity];
Plot[{sol, sol1}, {t, 0, 30}, PlotStyle -> {{Red}, {Dashed, Green}}]
POSTED BY: Luke Titus

Two classes so far, and I'm really finding the information useful. My thanks to Luke, Cassidy and Juan.

POSTED BY: Frank Gonzalez

Thank you very much for your comments and for joining the study group.

POSTED BY: Luke Titus
Posted 10 months ago

I am Sehluko. I am looking forward to this study group.

POSTED BY: Sehluko Dlamini

Thanks for joining the study group.

POSTED BY: Luke Titus
Posted 10 months ago

Hi.. I'm a complette outsider to this topic, but always interested in learning more about Wolfram Technologies and fields of application. Thanks to the authors for putting this training together. J!

POSTED BY: J.Edi Gran

Thank you for joining the study group. The content for this course is somewhat advance, but I hope that you are finding the topic of differential equations to be interesting.

POSTED BY: Luke Titus

I am looking forward to attending the daily study group. I am currently a graduate student in Mathematics with a major in Applied Mathematics at the Hellenic Open University. Research interest in partial differential equations. You can see some of my projects in my profile here in the community.

Thank you for joining the study group. I hope your are finding this useful for your research.

POSTED BY: Luke Titus

This Daily Study Group offers a unique opportunity to learn about all aspects (symbolic, numerical, ODEs and PDEs) of differential equations in the Wolfram Language.

@Luke Titus is an outstanding instructor and has a deep understanding of this important area.

I strongly recommend the Study Group to everyone!

POSTED BY: Devendra Kapadia

Thanks, @Luke Titus, for sharing your expertise at these upcoming Daily Study Group sessions!

POSTED BY: Jamie Peterson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract