I figured out my problem. Sorry for the last msg.
|
|
|
Hi Peter—there's no issue, it's just a warning that the notebooks were made in a newer version so there might be some functionality that doesn't work because it doesn't exist in your installation.
|
|
|
When I open the "Linear Algebra ..." notebook (and others that generate the same error message), the only page that appears in the notebook is the title page. There is no other content in the notebook (well, at least that I can see). BTW .... What version was used to create the "Linear Algebra ..." notebook?
|
|
|
That would have been created on 13.3, probably. We should have set this in the notebooks we uploaded, but looks like we missed this—that notebook is in slideshow view. Just go to Format -> Screen Environment and change that to Working, and it'll become a scrollable notebook rather than a presentation notebook.
|
|
|
I have a (mathematically) simple homework question today, but one that I think is a good exercise for people to try out—especially if they're newer to Wolfram Language.
The function tanViz from today's lecture currently only accepts a function and has predefined ranges for its two parameters. Modify tanViz so that it accepts ranges (as lists) for the two parameters u and v as inputs. That is, an input should look like: tanViz[surface,{ui,uf},{vi,vf}]. The resultant Manipulate object will then have sliders that range over the values that you specify.
Modify the Manipulate object such that it has a Slider2D input for the two parameters, as you saw in the Hamiltonian example from Tuesday. This will let you change u and v simultaneously.
|
|
|
Tuesday's example of the Hamitonian classical mechanics was in 1 dimensional phase space. How should the code be modified to model n-dimensions?
|
|
|
Help me with the 2d Hamiltonian: H[q1,q1,p1,p1,t]. q1'=dH/dp1, q2'=dH/dp2, p1'=-dH/dq1, p2'=-dH/dq2 all partial derivatives. Hspace i R^2d+1.
|
|
|
Thank you for your help.
A Hamiltonian for a particle moving in a plane experiencing a magnetic field orthogonal to the planes is:
H[q1,q2,p1,p2]= 1/2m (p1-Bq2)^2 +p2^2. Seek solution to Hamilton's equations and the general solutions for the trajectory of the particle.
|
|
|
Does H not depend on q1, or is that dependence encoded into the magnetic field?
|
|
|
I am trying to describe the dynamics of a particle confined to the plane. There is no q1 dependence. The trajectories should be circles in the plane with the Larmour frequency. Hope I am making sense.
Thanks again.
|
|
|

Hi, I am trying to work with the notebook from the "Differential Equations" lecture yesterday. For some reason, when I run the DSolve code, it's giving me this error message: I'm not sure if it's because I ran the code out of order but I tried deleting the notebook and redownloading it and it's still showing this. Any idea of how I can fix this? I'm new to mathematica so I'm sure I'm missing something basic. I also don't understand why the numbering on the In[#] and Out[#] is continuous throughout all the different notebooks I have. Is there a way to make them separate? Thanks so much!
|
|
|
Dear Allison, it seems t has ans assigned value/expression in this case a list. Try clearing the variable, write and evaluate:
Clear[t]
above the differential equation.
|
|
|
Hi Allison! This is something that happens quite frequently to newer (and even more veteran) users. José is correct: it looks like at some point you defined the variable t. You can actually tell that this is the case in your screenshot: the t is black, meaning that it has a definition assigned to it. Hopefully the error message now makes sense. You can get rid of this definition by running ClearAll[t], for examples. As for how/why this persisted even in your new copy of the notebook: Mathematica is basically broken into two pieces, the kernel adn the frontend. The kernel is what does all of the actual computations, which are then fed back to you in the notebook frontend. This kernel, by default, is persistent until the program—not a window—is closed, and the kernel is consistent between notebooks, which means that notebooks which are simultanously open will share definitions and also the In/Out counts, as you noticed. If you'd like a notebook to have its own kernel, you can go to the top-level menu and click Evaluation->Notebook's Kernel, then pick a new one. You may first have to go to Evaluation->Kernel Configuration Options to "set up" a new one, though. You can kill the kernel at any time (and thus clear all definitions and In/Out counts) from that same menu. Hopefully this helps!
|
|
|
Dave, the behavior I have observed repeatedly is that community.wolfram.com loses the cookie that identifies my Wolfram-ID. When I click on the reply window, I am immediately (and un-magically) forwarded to another window to log in. I click the back button in the browser; the problem persists. The fix I have found is to do a Reload of the web page, and the Wolfram BBS then knows who I am. This was horribly confusing the first 7-8 times it happened; it's now in my muscle memory to do the Reload. I pity the newbies who hit this glitch for themselves and hope they rapidly get it in their muscle memory. For background information, I"m using Safari 16.5 in MacOS 12.6.6. I reported this about 3 months ago; I haven't heard from anyone. I truly appreciate how much Wolfram Research dogfoods their own software. The WL is used for essentially everything customer-focused in the company. OTOH, I don't believe that the community.wolfram.com bboards are the right place to use a WL-based solution. There are some superb bboard systems out there: Discourse, Discord, etc. These solutions are used by millions of people daily, have standalone clients on a bunch of computer and portable platforms, etc. Most important, the primary purpose of those companies is to provide agile world-class community-discussion systems. BBoard functionality is not a priority for WR; it's probably not in the top 50 list (or top 100) of priorities for the company. It shouldn't be. All that WR needs is their BBS to have the proper HTML wrapping to interpret/relay the WL cloud expressions in messages. Wolfram shouldn't make a web browser or a streaming service. IMHO, they should not use a WL implementation of a bboard, either. @Arben Kalziqi , are there any compelling technical reasons to have a WL-based bboard implementation? Is there some functionality the management thinks can't be done in Discourse/Discord/etc.? I've made repeated public comments similar to this one, but haven't received any responses. What gives?
|
|
|
Hi Phil, thanks for the suggestion; I will Reload a Community page before I post next time. It's a good practice in general as I also missed the latest post by Arben Kalziqi.
|
|
|
Hi Phil, Thank you for your feedback. We have sent you a message on your email address.
|
|
|
There were two questions for previous presenters to which I've just received answers: A question for Lusine, who gave the talk on number theory:
I would be interested in what is the title of the book about number theory and when the new online course is expected to be launched on number theory mentioned during this session.
Lusine notes that the book is not yet complete and the title has not been finalized, but it will probably have a rather traditional name like Introduction to Number Theory. A question for Jaebum, who gave the talk on linear algebra and graphs:
I would appreciate if you could mention some references (e.g. books, articles, web pages) that contain already accomplished research topics in Wolfram language related to graphs.
Jaebum has provided three examples:
- Analyzing Narratives in Social Networks
- Operator Calculus on Graphs, Theory and Applications in Computer Science
- Functional Networks with Applications
|
|
|
Hi, this is an admin Q.:
Thanks for the great series! I have not been receiving any of the links to the session recordings (or even email reminders). Who should I contact to correct this? Thanks!
|
|
|
Send an e-mail to wolfram-u@wolfram.com with any administrative questions. [Not an admin, but I know the answer to this one!]
|
|
|
Phil is right! We did have an issue with another user's email address on BigMarker's end for some reason, so maybe the same thing is happening to you. We're looking into it! EDIT: Actually, this was fxed during the minute I typed this post. You should be good to go now.
|
|
|
Hi Claude, I have reached out to our event platform and you should now receive the notification emails. It seems you had unsubscribed from the BigMarker emails at some point. Please let me know if you have further issues or questions. Best Wishes,
Cassidy Hinkle
|
|
|
Regarding f[ ]: I like the consistent use of [ ] and not using ( ) for functions, or indiscriminately. I think one problem at least in elementary mathematics is our overuse of ( ) in different contexts, which confuses beginning students (and sometimes even seasoned mathematicians). So using [ ] for functions, { } for domains, and ( ) for only grouping actually makes the language of mathematics better.
|
|
|
I'm glad you think so! I agree that it's nice to reduce ambiguity in this way; it's been helpful to my students in the past as well (who would often get confused by notation when learning about vectors, for example).
|
|
|
My brain gets lost in bracket hell with deeply nested [[],[[],[[]]],[[]]] even when they are nicely indented. I find that using postfix operations makes these expressions much easier to understand. E.g.
Of the first 1000 primes which ones have a digit sum that is also
prime?
Select[Map[Total, AssociationMap[IntegerDigits, Prime[Range[1000]]]], PrimeQ]
Range[1000] // Prime // AssociationMap[IntegerDigits/*Total] // Select[PrimeQ]
To understand the first one you have to work from inside to out. The second one maps naturally to the question in left-to-right, easy to read, and understand order.
|
|
|
It is interesting to note that learning to work "inside out" with functions is a struggle many learners of traditional math notation have as well. The prefix (@), postfix (//), and functional ([]) styles of notation can be mixed and matched however makes the most sense for you in a given problem.
|
|
|
Reverse Polish notation :) Reminds me of old HP calculators, and FORTH! So, all in all, pretty familiar to me. I actually prefer the prefix f@ argument, and using vectors for multivariate arguments, like f@{z, y, z}
|
|
|
Reverse Polish notation :) Reminds me of old HP calculators [...]
If you still have a longing for those fabulous HP calculators of lore, you can now scratch that itch. There's a Swiss startup that is making modern implementations of RPN calculators inspired by the old 16C, 42S, and 41CX machines. I'm grateful that somebody had the capability and the nerve to resurrect these machines. I'm also grateful that the US printer toner company that created those calculators doesn't sue that startup into oblivion.
|
|
|
Thanks for the hint regarding the HP41C clone! There are of course downloadable Apps that do (all or mostly) the same for less on your i-phone, but there is something magical about holding an HP41C calculator in your hand and not using your cell phone... I did a lot of solid RF Systems Engineering on my HP 41C before PCs and spreadsheets. I may just have to order one...
|
|
|
Indeed, I wind up doing that myself pretty frequently. The only thing to keep in mind is that f[{x,y,z}]!=f[x,y,z], of course, but if you're defining your own functions it isn't a big problem. However! If you take advantage of Apply (@@) and MapApply(@@@) and understand how slots work, you can mix and match and get the best of both worlds.
|
|
|
I am on travel and will miss a few workshop meetings. I reviewed the lesson on Asymptotics, and I have a few questions about the Singular Perturbation portion of the notebook.
The help file for AsymptoticDSolveValue lists options that may be set in the function, but I cannot find examples on how to set a value for the option when executing the AsymptoticDSolveValue command. Specifically, I want to compare the results using the "Quality" option to that obtained using "Speed". Hope that you can provide an example for each.
The example in the workbook shows how to find an asymptotic solution for the boundary-value problem,
eqn = {[Epsilon] (y^[Prime][Prime])[x] + 2 Derivative[1][y][x] +
y[x] == 0, y[0] == 0, y[1] == 1/2};
The solution presented seems to be implicitly a uniformly valid expansion for all x in the domain. [See plot in this section.] . What method was used to generate the asymptotic expansion solution presented in the workbook? That is, I typically use the method of matched asymptotic series for the inner and outer solution of the boundary-layer problem. The method of matched asymptotic solutions will generate a uniformly valide solution composite solution for all x. The boundary conditions will be satisfied exactly at both x=0 and x=1. The solution in the workbook, however, does not exactly satisfy the boundary condition y[1]=1/2. There is a small difference between the asymptotic soln value and the set value of 1/2. The difference is appreciable when epsilon is of O( 0.1) or larger. It appears that the method of matched asymptotics is not used in the Mathematica algorithm to generate the result in the workbook. What method does the code use?
Thanks
|
|
|
Hello Peter, Thank you for these interesting questions.
The PerformanceGoal option for AsymptoticDSolveValue is set to "Quality" by default, and the "Speed" setting is only used to disallow the use of exact methods based on DSolve, for computing an asymptotic approximation. You will probably not need this option very often but the following rather artificial example illustrates its use in AsymptoticDSolveValue:
In[1]:= deqns = {y'[x] + Sqrt[x] y'[x]^2 == 1, y[1] == 1};
In[2]:= AsymptoticDSolveValue[deqns, y[x], {x, 0, 3}]
Out[2]= 1/6 (11 + 5 Sqrt[5]) - 2 Sqrt[x] - x + (2 x^(3/2))/3 - x^2 +
2 x^(5/2) - (14 x^3)/3
In[3]:= AsymptoticDSolveValue[deqns, y[x], {x, 0, 3},
PerformanceGoal -> "Quality"]
Out[3]= 1/6 (11 + 5 Sqrt[5]) - 2 Sqrt[x] - x + (2 x^(3/2))/3 - x^2 +
2 x^(5/2) - (14 x^3)/3
In[4]:= AsymptoticDSolveValue[deqns, y[x], {x, 0, 3},
PerformanceGoal -> "Speed"] // Head
Out[4]= AsymptoticDSolveValue
The leading order approximation for the singular perturbation problem is computed using a simple "closed form" for it based on a discussion in Chapter 9 of Bender and Orszag which works well for second-order linear ODEs for which the coefficient of y'[x] is positive on the given interval. However, as you have noted, the boundary condition at x = 1 is only satisfied asymptotically with this formula. One of the "later" perturbation methods in AsymptoticDSolveValue uses the WKBJ method which yields an approximation that is more complicated but does satisfy the boundary conditions (and also works for higher-order approximations). This method can be accessed as follows:
In[1]:= eqns = {ep y''[x] + c Derivative[1][y][x] +
y[x] == 0, y[0] == 0, y[1] == 1/2};
In[2]:= psol =
AsymptoticDSolveValue[eqns, y[x], x, {ep, 0, 1}] /. c -> 2
Out[2]= E^(1/2 + 2/ep - x/2)/(2 (-E + E^(2/ep))) - E^(
1/2 + 2/ep + (-2 x + (ep x)/2)/ep)/(2 (-E + E^(2/ep)))
In[3]:= psol /. x -> 0
Out[3]= 0
In[4]:= psol /. x -> 1 // Simplify
Out[4]= 1/2
In[5]:= dsol = DSolveValue[eqns /. c -> 2, y[x], x]
Out[5]= -((
E^(1/ep + Sqrt[1 - ep]/
ep) (E^((-(1/ep) - Sqrt[1 - ep]/ep) x) -
E^((-(1/ep) + Sqrt[1 - ep]/ep) x)))/(
2 (-1 + E^((2 Sqrt[1 - ep])/ep))))
In[6]:= Limit[dsol/psol, ep -> 0, Assumptions -> 0 < x < 1]
Out[6]= 1
Hope this helps.
|
|
|
Hi everybody—today's "homework" question: Part 1: Use PrimePi and SparseArray's ability to specify elements via patterns to generate the following (10x10) matrix:
{{1, 2, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 2, 3, 0, 0, 0, 0, 0, 0, 0}, {0,
3, 3, 4, 0, 0, 0, 0, 0, 0}, {0, 0, 4, 4, 4, 0, 0, 0, 0, 0}, {0, 0,
0, 4, 4, 5, 0, 0, 0, 0}, {0, 0, 0, 0, 5, 5, 6, 0, 0, 0}, {0, 0, 0,
0, 0, 6, 6, 6, 0, 0}, {0, 0, 0, 0, 0, 0, 6, 6, 7, 0}, {0, 0, 0, 0,
0, 0, 0, 7, 7, 8}, {0, 0, 0, 0, 0, 0, 0, 0, 8, 8}}

Part 2: Modify the code above such that it produces a 30x30 matrix rather than a 10x10 one, then create a graph which has the result as its adjacency matrix. (Try using a circular embedding for the graph layout.)
|
|
|
A proposed solution to the exercise. ebook][1]
Attachments:
|
|
|
Thanks Jose, this looks great! (and of course, I appreciate the Manipulate.) There's a more compact way to write the pattern-matching for the initial SparseArray, if you're interested—recall that the Conditional statement can be any computation at all, not limited to checking equality, for example. I'm not sure if that's enough of a hint, but I'll post my version as a reply to this if you like, as I wouldn't want to spoil it before you've had a chance to think of it.
|
|
|
Here's a way to get the SpaceArray without the dreaded index scaffolding:
Two comments: In past classes, I had been opening the Wolfram Language & System Documentation Center in a browser window. I accidentally opened the docs center in a Wolfram Language window. Opening the help docs in the Wolfram Language app is vastly superior! You can run a line or 2 of code immediately right in the documentation window. Also, you're not thrown by the distraction of browser windows in your Wolfram explorations. I am not a mathematician; I had difficulty brushing off the cobwebs in the recent Wolfram Calculus Study Group. OTOH, I remembered enough about matrix math to remember that the diagonals next to the main diagonal of a matrix were highly useful -- and there must be a way to access them. There had to be a built-in library function to get to them! It took me a couple of days to find Band. If I had looked in the "See Also" section of the docs for SparseArray, I would have found Band much much faster. There is a brilliance in the design of the WL; great minds have laid out a wonderful... array... of functions.
|
|
|
Terrible pun, Phil, I'm afraid you've gotta get out of here ;). I agree about local documentation; I really prefer it even though we don't bundle it by default anymore since it's gotten so large (though it's easy to download and install anyway). Our publishing guidelines are to link to webdocs, but I was thinking during today's lecture that I might ask to see if we can use local in some contexts, primarily for the reason you mention—click to copy is nice, but "edit and run" is a lot nicer! Re: the homework problem, Band is a clever thought to have had. I must confirm that the fears you mentioned in chat have come to pass, though, as I generated the SparseArray as follows (and hopefully José sees this too, since it's a reply to the original comment):
sparse =
SparseArray[{i_, j_} /; Abs[i - j] <= 1 -> PrimePi[i + j], {10, 10}]
(Fortunately, I think you'll find this elegant enough to forgive me.)
|
|
|
I think it's OK to use Abs to see the "distance" from the diagonal. OTOH, your code ends of applying that test to every cell (or, at least, the calculated value of the coordinates of every cell) in the matrix. You're doing a bunch of superfluous computation; it should be slower:
I'm gonna give that a No Pass.
|
|
|
Ha! But the question explicitly specifies the dimensions, so unless you're an incredibly fast typist, mine is still faster in the real world (and that's still true even in the case of your 11 million times larger array). I'll wag my finger and note that knowing when it's prudent to optimize is just as important as knowing how to optimize. (Contrarily: in a high-level language such as this, being able to think about sources of potential slowdown like you have is an invaluable skill!)
|
|
|
Dear Arben, Just missed your reply with the solution of Part 1 (no browser refresh). I joined the Study Group in the second week. Apparently, I posted my solution as someone else (Vitaliy Kaurov, WOLFRAM Research) which is very weird (I used a VPN). The impersonated post is below. I reported the issue to Wolfram Support. [Update] WR has restored my post attribution.
|
|
|
Thanks for letting us know, Dave—there's a strange issue with Community which sometimes occurs where the original username gets removed, and our "default" username in cases like those is Vitaliy's (ostensibly because he's the Director of Community Engagement).
|
|
|
Arben, what did you mean by " I agree about local documentation; I really prefer it even though we don't bundle it by default anymore since it's gotten so large (though it's easy to download and install anyway)." I am running 13.0.0. and it seems to me my documentation is local, but I don't remember doing anything special to download it. I am going to upgrade one of these days and that gave me pause. I wouldn't dream of not having the full documentation local and be subject to Internet access. What has changed?
|
|
|
Hi Carl—starting with a recent version of the language, fresh installs no longer come with the documentation by default. If I remember correctly, the user is asked during the installation process whether they would like to download and install local documentation. If not (or if they choose "no"), it's as simple as going to the menu and choosing something like "Download and Install Documentation". You don't—and as far as I know, never will—need a persistent internet connection to access documentation. It's just that the documentation is now on the order of a few gigabytes, so it was decided to leave it out by default and make it an optional installation.
|
|
|
Is it this Arben for the Part 1 code?
Normal@SparseArray[{{i_, j_} /; (Abs[i - j] <= 1) ->
PrimePi[i + j]}, {10, 10}] // MatrixForm
|
|
|
Dear Arben, I found a shorter code for the sparse array. If you have a different approach please share. I also have a question in the attached document as I get some error messages and I can solve ir for the manipulate option. Best regards
Attachments:
|
|
|
Yes José, that's basically the idea—the only difference is that I used Abs instead of checking whether it was between ±1. I'll check out your notebook when I have the chance, hopefully today.
|
|
|
I am curious about the automated proof system you mentioned on Tuesday. Can it detect statements that are unprovable in the current set of axioms (re: Goedel)? Or is that function not computable (Turing/Kleene) hence not doable by computer?
|
|
|
Hi Alexander, in the details section of the documentation of FindEquationalProof, it clarifies this somewhat. In cases where the function is able determine it is not possible to prove the given theorem from the axioms, it will return a Failure object. However, as you mention, in full generality it is not possible to decide this and the only option is to let the program run to see if it terminates. For this reason there is also a TimeConstraint option to impose an artificial limit on how long the function will keep running. You can also manually stop any ongoing evaluation by clicking Abort Evaluation under the Evaluation menu in the user interface.
|
|
|
In Tuesday's presentation on Special Functions and Visualization, John McNally noted the use of Simplify or FullSimplify but cautioned that FullSimplify can take more time. Is that really still the case? On modern processors, doesn't FullSimplify simply run fast enough? Do you have a real example where FullSimplify would make a noticeable difference?
|
|
|
Hi Phil—hopefully John and Charles were able to answer your question in the webinar chat today. To wit, they mentioned that certain trigonometric simplifications were available via FullSimplify which wouldn't be tried with Simplify, and that this could result in simpler results at the cost of slower speeds. John also mentioned that there are trig-specific simplification functions like TrigExpand which can work several orders of magnitude faster than either of the more general simplification functions.
|
|
|
The study group schedule notes that the Thursday June 1 session is about probability and differential geometry. I have a question about torsional forces. As noted in the wikipedia:
In the differential geometry of curves in three dimensions, the
torsion of a curve measures how sharply it is twisting out of the
osculating plane. Taken together, the curvature and the torsion of a
space curve are analogous to the curvature of a plane curve.
I'd love to see a computation and visualization of the torsion of a 3D curve in the Wolfram Language. If this doesn't fit into the scheduled presentation, could you show an example (with WL Notebook) in the community discussion here? Thank you.
|
|
|
Hi Phil! That's a lovely suggestion; I'll see if I can work it in.
|
|
|
Reply to this discussion
in reply to
|