/matlabcentral/discussions/generalGeneral Discussions2024-09-07T15:02:36Ztag:www.mathworks.com,2005:Topic/8441012024-02-02T17:41:51Z2024-07-15T15:17:31ZRead this before posting<p>Hello and a warm welcome to all! We're thrilled to have you visit our community. MATLAB Central is a place for learning, sharing, and connecting with others who share your passion for MATLAB and Simulink. To ensure you have the best experience, here are some tips to get you started:
Read the Community Guidelines: Understanding our community standards is crucial. Please take a moment to familiarize yourself with them. Keep in mind that posts not adhering to these guidelines may be flagged by moderators or other community members.
Ask Technical Questions at MATLAB Answers: If you have questions related to MathWorks products, head over to MATLAB Answers (new question form - Ask the community). It's the go-to spot for technical inquiries, with responses often provided within an hour, depending on the complexity of the question and volunteer availability. To increase your chances of a speedy reply, check out our tips on how to craft a good question (link to post on asking good questions).
Choosing the Right Channel: We offer a variety of discussion channels tailored to different contexts. Select the one that best fits your post. If you're unsure, the General channel is always a safe bet. If you feel there's a need for a new channel, we encourage you to suggest it in the Ideas channel.
Reporting Issues: If you encounter posts that violate our guidelines, please use the 🚩Flag/Report feature (found in the 3-dot menu) to bring them to our attention.
Quality Control: We strive to maintain a high standard of discussion. Accounts that post spam or too much nonsense may be subject to moderation, which can include temporary suspensions or permanent bans.
Share Your Ideas: Your feedback is invaluable. If you have suggestions on how we can improve the community or MathWorks products, the Ideas channel is the perfect place to voice your thoughts.
Enjoy yourself and have fun! We're committed to fostering a supportive and educational environment. Dive into discussions, share your expertise, and grow your knowledge. We're excited to see what you'll contribute to the community!</p>Davidhttps://www.mathworks.com/matlabcentral/profile/authors/4480925tag:www.mathworks.com,2005:Topic/8752462024-09-02T01:28:52Z2024-09-07T15:02:36ZPersonal Best Downloads Level 2 Badge<p>Has this been eliminated? I've been at 31 or 32 for 30 days for awhile, but no badge. 10 badge was automatic.</p>Steve Lenkhttps://www.mathworks.com/matlabcentral/profile/authors/17562612tag:www.mathworks.com,2005:Topic/8752232024-08-31T05:55:45Z2024-08-31T05:55:45ZI'm looking for collaboration partners for solving all The Millennium Prize Conjectures, I've found potential solutions for resolving all the Conjectures.<p>Formal Proof of Smooth Solutions for Modified Navier-Stokes Equations</p><p>1. Introduction</p><p>We address the existence and smoothness of solutions to the modified Navier-Stokes equations that incorporate frequency resonances and geometric constraints. Our goal is to prove that these modifications prevent singularities, leading to smooth solutions.</p><p>2. Mathematical Formulation</p><p>2.1 Modified Navier-Stokes Equations</p><p>Consider the Navier-Stokes equations with a frequency resonance term R(u,f)\mathbf{R}(\mathbf{u}, \mathbf{f})R(u,f) and geometric constraints:</p><p>∂u∂t+(u⋅∇)u=−∇pρ+ν∇2u+R(u,f)\frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u} \cdot \nabla) \mathbf{u} = -\frac{\nabla p}{\rho} + \nu \nabla^2 \mathbf{u} + \mathbf{R}(\mathbf{u}, \mathbf{f})∂t∂u+(u⋅∇)u=−ρ∇p+ν∇2u+R(u,f)</p><p>where:</p><p>• u=u(t,x)\mathbf{u} = \mathbf{u}(t, \mathbf{x})u=u(t,x) is the velocity field.</p><p>• p=p(t,x)p = p(t, \mathbf{x})p=p(t,x) is the pressure field.</p><p>• ν\nuν is the kinematic viscosity.</p><p>• R(u,f)\mathbf{R}(\mathbf{u}, \mathbf{f})R(u,f) represents the frequency resonance effects.</p><p>• f\mathbf{f}f denotes external forces.</p><p>2.2 Boundary Conditions</p><p>The boundary conditions are:</p><p>u⋅n=0 on Γ\mathbf{u} \cdot \mathbf{n} = 0 \text{ on } \Gammau⋅n=0 on Γ</p><p>where Γ\GammaΓ represents the boundary of the domain Ω\OmegaΩ, and n\mathbf{n}n is the unit normal vector on Γ\GammaΓ.</p><p>3. Existence and Smoothness of Solutions</p><p>3.1 Initial Conditions</p><p>Assume initial conditions are smooth:</p><p>u(0)∈C∞(Ω)\mathbf{u}(0) \in C^{\infty}(\Omega)u(0)∈C∞(Ω) f∈L2(Ω)\mathbf{f} \in L^2(\Omega)f∈L2(Ω)</p><p>3.2 Energy Estimates</p><p>Define the total kinetic energy:</p><p>E(t)=12∫Ω∣u(t)∣2 dΩE(t) = \frac{1}{2} \int_{\Omega} <tt>\mathbf{u}(t)</tt>^2 \, d\OmegaE(t)=21∫Ω∣u(t)∣2dΩ</p><p>Differentiate E(t)E(t)E(t) with respect to time:</p><p>dE(t)dt=∫Ωu⋅∂u∂t dΩ\frac{dE(t)}{dt} = \int_{\Omega} \mathbf{u} \cdot \frac{\partial \mathbf{u}}{\partial t} \, d\OmegadtdE(t)=∫Ωu⋅∂t∂udΩ</p><p>Substitute the modified Navier-Stokes equation:</p><p>dE(t)dt=∫Ωu⋅[−∇pρ+ν∇2u+R] dΩ\frac{dE(t)}{dt} = \int_{\Omega} \mathbf{u} \cdot \left[ -\frac{\nabla p}{\rho} + \nu \nabla^2 \mathbf{u} + \mathbf{R} \right] \, d\OmegadtdE(t)=∫Ωu⋅[−ρ∇p+ν∇2u+R]dΩ</p><p>Using the divergence-free condition (∇⋅u=0\nabla \cdot \mathbf{u} = 0∇⋅u=0):</p><p>∫Ωu⋅∇pρ dΩ=0\int_{\Omega} \mathbf{u} \cdot \frac{\nabla p}{\rho} \, d\Omega = 0∫Ωu⋅ρ∇pdΩ=0</p><p>Thus:</p><p>dE(t)dt=−ν∫Ω∣∇u∣2 dΩ+∫Ωu⋅R dΩ\frac{dE(t)}{dt} = -\nu \int_{\Omega} <tt>\nabla \mathbf{u}</tt>^2 \, d\Omega + \int_{\Omega} \mathbf{u} \cdot \mathbf{R} \, d\OmegadtdE(t)=−ν∫Ω∣∇u∣2dΩ+∫Ωu⋅RdΩ</p><p>Assuming R\mathbf{R}R is bounded by a constant CCC:</p><p>∫Ωu⋅R dΩ≤C∫Ω∣u∣ dΩ\int_{\Omega} \mathbf{u} \cdot \mathbf{R} \, d\Omega \leq C \int_{\Omega} <tt>\mathbf{u}</tt> \, d\Omega∫Ωu⋅RdΩ≤C∫Ω∣u∣dΩ</p><p>Applying the Poincaré inequality:</p><p>∫Ω∣u∣2 dΩ≤Const⋅∫Ω∣∇u∣2 dΩ\int_{\Omega} <tt>\mathbf{u}</tt>^2 \, d\Omega \leq \text{Const} \cdot \int_{\Omega} <tt>\nabla \mathbf{u}</tt>^2 \, d\Omega∫Ω∣u∣2dΩ≤Const⋅∫Ω∣∇u∣2dΩ</p><p>Therefore:</p><p>dE(t)dt≤−ν∫Ω∣∇u∣2 dΩ+C∫Ω∣u∣ dΩ\frac{dE(t)}{dt} \leq -\nu \int_{\Omega} <tt>\nabla \mathbf{u}</tt>^2 \, d\Omega + C \int_{\Omega} <tt>\mathbf{u}</tt> \, d\OmegadtdE(t)≤−ν∫Ω∣∇u∣2dΩ+C∫Ω∣u∣dΩ</p><p>Integrate this inequality:</p><p>E(t)≤E(0)−ν∫0t∫Ω∣∇u∣2 dΩ ds+CtE(t) \leq E(0) - \nu \int_{0}^{t} \int_{\Omega} <tt>\nabla \mathbf{u}</tt>^2 \, d\Omega \, ds + C tE(t)≤E(0)−ν∫0t∫Ω∣∇u∣2dΩds+Ct</p><p>Since the first term on the right-hand side is non-positive and the second term is bounded, E(t)E(t)E(t) remains bounded.</p><p>3.3 Stability Analysis</p><p>Define the Lyapunov function:</p><p>V(u)=12∫Ω∣u∣2 dΩV(\mathbf{u}) = \frac{1}{2} \int_{\Omega} <tt>\mathbf{u}</tt>^2 \, d\OmegaV(u)=21∫Ω∣u∣2dΩ</p><p>Compute its time derivative:</p><p>dVdt=∫Ωu⋅∂u∂t dΩ=−ν∫Ω∣∇u∣2 dΩ+∫Ωu⋅R dΩ\frac{dV}{dt} = \int_{\Omega} \mathbf{u} \cdot \frac{\partial \mathbf{u}}{\partial t} \, d\Omega = -\nu \int_{\Omega} <tt>\nabla \mathbf{u}</tt>^2 \, d\Omega + \int_{\Omega} \mathbf{u} \cdot \mathbf{R} \, d\OmegadtdV=∫Ωu⋅∂t∂udΩ=−ν∫Ω∣∇u∣2dΩ+∫Ωu⋅RdΩ</p><p>Since:</p><p>dVdt≤−ν∫Ω∣∇u∣2 dΩ+C\frac{dV}{dt} \leq -\nu \int_{\Omega} <tt>\nabla \mathbf{u}</tt>^2 \, d\Omega + CdtdV≤−ν∫Ω∣∇u∣2dΩ+C</p><p>and R\mathbf{R}R is bounded, u\mathbf{u}u remains bounded and smooth.</p><p>3.4 Boundary Conditions and Regularity</p><p>Verify that the boundary conditions do not induce singularities:</p><p>u⋅n=0 on Γ\mathbf{u} \cdot \mathbf{n} = 0 \text{ on } \Gammau⋅n=0 on Γ</p><p>Apply boundary value theory ensuring that the constraints preserve regularity and smoothness.</p><p>4. Extended Simulations and Experimental Validation</p><p>4.1 Simulations</p><p>• Implement numerical simulations for diverse geometrical constraints.</p><p>• Validate solutions under various frequency resonances and geometric configurations.</p><p>4.2 Experimental Validation</p><p>• Develop physical models with capillary geometries and frequency tuning.</p><p>• Test against theoretical predictions for flow characteristics and singularity avoidance.</p><p>4.3 Validation Metrics</p><p>Ensure:</p><p>• Solution smoothness and stability.</p><p>• Accurate representation of frequency and geometric effects.</p><p>• No emergence of singularities or discontinuities.</p><p>5. Conclusion</p><p>This formal proof confirms that integrating frequency resonances and geometric constraints into the Navier-Stokes equations ensures smooth solutions. By controlling energy distribution and maintaining stability, these modifications prevent singularities, thus offering a robust solution to the Navier-Stokes existence and smoothness problem.</p>Dennishttps://www.mathworks.com/matlabcentral/profile/authors/34843465tag:www.mathworks.com,2005:Topic/8742642024-08-18T14:44:21Z2024-08-19T16:02:13ZFigures vs. uiFigures<p>So generally I want to be using uifigures over figures. For example I really like the tab group component, which can really help with organizing large numbers of plots in a manageable way. I also really prefer the look of the progress dialog, uialert, confirm, etc. That said, I run into way more bugs using uifigures. I always get a “flicker” in the axes toolbar for example. I also have matlab getting “hung” a lot more often when using uifigures.</p><p>So in general, what is recommended? Are uifigures ever going to fully replace traditional figures? Are they going to become more and more robust? Do I need a better GPU to handle graphics better? Just looking for general guidance.</p>Matthew Rademacherhttps://www.mathworks.com/matlabcentral/profile/authors/14711221tag:www.mathworks.com,2005:Topic/8740492024-08-16T11:25:15Z2024-08-16T11:25:15ZDrone for Matlab<p>Hi everyone, I am from India ..Suggest some drone for deploying code from Matlab.</p>Salam Surjithttps://www.mathworks.com/matlabcentral/profile/authors/11868646tag:www.mathworks.com,2005:Topic/8735842024-08-12T14:30:23Z2024-08-14T20:32:48ZLooking for a reading partner <p>Hello :-) I am interested in reading the book "The finite element method for solid and structural mechanics" online with somebody who is also interested in studying the finite element method particularly its mathematical aspect. I enjoy discussing the book instead of reading it alone. Please if you were interested email me at: <a href = "https://www.mathworks.com">student.z.k@hotmail.com</a> Thank you!</p>Zahraahttps://www.mathworks.com/matlabcentral/profile/authors/32804603tag:www.mathworks.com,2005:Topic/8479712020-06-28T10:27:32Z2024-08-02T02:40:22ZWhat frustrates you about MATLAB? #2<p></p>Rikhttps://www.mathworks.com/matlabcentral/profile/authors/3073010tag:www.mathworks.com,2005:Topic/8716462024-07-27T11:31:08Z2024-07-27T23:45:22Z"Satellite Communication simulation(main title)" Undergraduate projects, Do you have any good Ideas?<p></p>lewishttps://www.mathworks.com/matlabcentral/profile/authors/33636926tag:www.mathworks.com,2005:Topic/8688312024-07-05T17:56:04Z2024-07-27T07:12:27ZNeed help to get started with matlab<p>Hello everyone, i hope you all are in good health. i need to ask you about the help about where i should start to get indulge in matlab. I am an electrical engineer but having experience of construction field. I am new here. Please do help me. I shall be waiting forward to hear from you. I shall be grateful to you. Need recommendations and suggestions from experienced members. Thank you.</p>Muhammadhttps://www.mathworks.com/matlabcentral/profile/authors/34384838tag:www.mathworks.com,2005:Topic/8711662024-07-23T15:34:35Z2024-07-23T22:30:03ZGabriel's Horn<p>Gabriel's horn is a shape with the paradoxical property that it has infinite surface area, but a finite volume.</p><p>Gabriel’s horn is formed by taking the graph of with the domain and rotating it in three dimensions about the axis.
There is a standard formula for calculating the volume of this shape, for a general function .Wwe will just state that the volume of the solid between and is:</p><p>The surface area of the solid is given by:</p><p>One other thing we need to consider is that we are trying to find the value of these integrals between and . An integral with a limit of infinity is called an improper integral and we can't evaluate it simply by plugging the value infinity into the normal equation for a definite integral. Instead, we must first calculate the definite integral up to some finite limit and then calculate the limit of the result as tends to :</p><p>Volume
We can calculate the horn's volume using the volume integral above, so</p><p>The total volume of this infinitely long trumpet is.
Surface Area
To determine the surface area, we first need the function’s derivative:</p><p>Now plug it into the surface area formula and we have:</p><p>This is an improper integral and it's hard to evaluate, but since in our interval
So, we have :</p><p>Now,we evaluate this last integral</p><p>So the surface are is infinite.
% Define the function for Gabriel's Horn
gabriels_horn = @(x) 1 ./ x;
% Create a range of x values
x = linspace(1, 40, 4000); % Increase the number of points for better accuracy
y = gabriels_horn(x);
% Create the meshgrid
theta = linspace(0, 2 * pi, 6000); % Increase theta points for a smoother surface
[X, T] = meshgrid(x, theta);
Y = gabriels_horn(X) .* cos(T);
Z = gabriels_horn(X) .* sin(T);
% Plot the surface of Gabriel's Horn
figure('Position', [200, 100, 1200, 900]);
surf(X, Y, Z, 'EdgeColor', 'none', 'FaceAlpha', 0.9);
hold on;
% Plot the central axis
plot3(x, zeros(size(x)), zeros(size(x)), 'r', 'LineWidth', 2);
% Set labels
xlabel('x');
ylabel('y');
zlabel('z');
% Adjust colormap and axis properties
colormap('gray');
shading interp; % Smooth shading
% Adjust the view
view(3);
axis tight;
grid on;
% Add formulas as text annotations
dim1 = [0.4 0.7 0.3 0.2];
annotation('textbox',dim1,'String',{'$$V = \pi \int_{1}^{a} \left( \frac{1}{x} \right)^2 dx = \pi \left( 1 - \frac{1}{a} \right)$$', ...
'', ... % Add an empty line for larger gap
'$$\lim_{a \to \infty} V = \lim_{a \to \infty} \pi \left( 1 - \frac{1}{a} \right) = \pi$$'}, ...
'Interpreter','latex','FontSize',12, 'EdgeColor','none', 'FitBoxToText', 'on');
dim2 = [0.4 0.5 0.3 0.2];
annotation('textbox',dim2,'String',{'$$A = 2\pi \int_{1}^{a} \frac{1}{x} \sqrt{1 + \left( -\frac{1}{x^2} \right)^2} dx > 2\pi \int_{1}^{a} \frac{dx}{x} = 2\pi \ln(a)$$', ...
'', ... % Add an empty line for larger gap
'$$\lim_{a \to \infty} A \geq \lim_{a \to \infty} 2\pi \ln(a) = \infty$$'}, ...
'Interpreter','latex','FontSize',12, 'EdgeColor','none', 'FitBoxToText', 'on');
% Add Gabriel's Horn label
dim3 = [0.3 0.9 0.3 0.1];
annotation('textbox',dim3,'String','Gabriel''s Horn', ...
'Interpreter','latex','FontSize',14, 'EdgeColor','none', 'HorizontalAlignment', 'center');
hold off
daspect([3.5 1 1]) % daspect([x y z])
view(-27, 15)
lightangle(-50,0)
lighting('gouraud')
The properties of this figure were first studied by Italian physicist and mathematician Evangelista Torricelli in the 17th century.
Acknowledgment
I would like to express my sincere gratitude to all those who have supported and inspired me throughout this project.
First and foremost, I would like to thank the mathematician and my esteemed colleague, Stavros Tsalapatis, for inspiring me with the fascinating subject of Gabriel's Horn.
I am also deeply thankful to Mr. @Star Strider for his invaluable assistance in completing the final code.
References:
How to Find the Volume and Surface Area of Gabriel's Horn
Gabriel's Horn
An Understanding of a Solid with Finite Volume and Infinite Surface Area.
IMPROPER INTEGRALS: GABRIEL’S HORN
Gabriel’s Horn and the Painter's Paradox in Perspective</p>Athanasios Paraskevopouloshttps://www.mathworks.com/matlabcentral/profile/authors/30623616tag:www.mathworks.com,2005:Topic/8711012024-07-23T07:39:32Z2024-07-23T07:39:32ZThe moment the PMOS switch is turned on, the inrush current is too large and the PMOS burns out…<p>https://www.youtube.com/watch?v=z_-jSmfqlHY&t=14s
When it comes to MOS tube burnout, it is usually because it is not working in the SOA workspace, and there is also a case where the MOS tube is overcurrent.</p><p>For example, the maximum allowable current of the PMOS transistor in this circuit is 50A, and the maximum current reaches 80+ at the moment when the MOS transistor is turned on, then the current is very large.
At this time, the PMOS is over-specified, and we can see on the SOA curve that it is not working in the SOA range, which will cause the PMOS to be damaged.
So what if you choose a higher current PMOS? Of course you can, but the cost will be higher.
We can choose to adjust the peripheral resistance or capacitor to make the PMOS turn on more slowly, so that the current can be lowered.
For example, when adjusting R1, R2, and the jumper capacitance between gs, when Cgs is adjusted to 1uF, The Ids are only 40A max, which is fine in terms of current, and meets the 80% derating.
(50 amps * 0.8 = 40 amps).</p><p>Next, let’s look at the power, from the SOA curve, the opening time of the MOS tube is about 1ms, and the maximum power at this time is 280W.</p><p>The normal thermal resistance of the chip is 50°C/W, and the maximum junction temperature can be 302°F.
Assuming the ambient temperature is 77°F, then the instantaneous power that 1ms can withstand is about 357W.
The actual power of PMOS here is 280W, which does not exceed the limit, which means that it works normally in the SOA area.
Therefore, when the current impact of the MOS transistor is large at the moment of turning, the Cgs capacitance can be adjusted appropriately to make the PMOS Working in the SOA area, you can avoid the problem of MOS corruption.</p>binbinhttps://www.mathworks.com/matlabcentral/profile/authors/34490435tag:www.mathworks.com,2005:Topic/8481262011-02-23T00:18:46Z2024-07-05T06:16:16ZSome Foreign Matlab forums<p>Which Matlab related forums and newsgroups do you use beside MATLAB Answers? Which languages do they use? Which advantages and unique features do they have?</p><p>Do you think that these forums complement or compete against MathWorks and its communication platform?</p><p>Actually <b>all</b> answers are accepted.</p>Janhttps://www.mathworks.com/matlabcentral/profile/authors/869888tag:www.mathworks.com,2005:Topic/8683862024-07-02T13:01:53Z2024-07-02T13:01:53Zdocument on solving ODEs and PDEs<p>I recently wrote up a document which addresses the solution of ordinary and partial differential equations in Matlab (with some Python examples thrown in for those who are interested). For ODEs, both initial and boundary value problems are addressed. For PDEs, it addresses parabolic and elliptic equations. The emphasis is on finite difference approaches and built-in functions are discussed when available. Theory is kept to a minimum. I also provide a discussion of strategies for checking the results, because I think many students are too quick to trust their solutions. For anyone interested, the document can be found at https://blanchard.neep.wisc.edu/SolvingDifferentialEquationsWithMatlab.pdf</p>James Blanchardhttps://www.mathworks.com/matlabcentral/profile/authors/6002112tag:www.mathworks.com,2005:Topic/8678362024-06-26T09:32:27Z2024-06-27T13:01:01ZWhere to find coding and algorithms problems with solutions?<p>Hi, I'm looking for sites where I can find coding & algorithms problems and their solutions. I'm doing this workshop in college and I'll need some problems to go over with the students and explain how Matlab works by solving the problems with them and then reviewing and going over different solution options. Does anyone know a website like that? I've tried looking in the Matlab Cody By Mathworks, but didn't exactly find what I'm looking for. Thanks in advance.</p>Saleemhttps://www.mathworks.com/matlabcentral/profile/authors/32773865tag:www.mathworks.com,2005:Topic/8678962024-06-26T20:41:34Z2024-06-26T20:41:34ZGeometry-Based Stochastic Channel Modeling<p>Kindly link me to the Channel Modeling Group.
I read and compreheneded a paper on channel modeling "An Adaptive Geometry-Based Stochastic Model for Non-Isotropic MIMO Mobile-to-Mobile Channels" except the graphical results obtained from the MATLAB codes. I have tried to replicate the same graphs but to no avail from my codes. And I am really interested in the topic, i have even written to the authors of the paper but as usual, there is no reply from them. Kindly assist if possible.</p>Sylvesterhttps://www.mathworks.com/matlabcentral/profile/authors/34256763tag:www.mathworks.com,2005:Topic/8697482018-05-16T15:11:59Z2024-06-19T18:10:22ZHow can people who are bad at math and have no programming aptitude learn MATLAB? (Long question)<p>Dear MATLAB community,</p><p>How can I help my close friend who's bad at math and programming learn MATLAB?</p><p>He's a final year chemical engineering student who struggles even to plot two functions on the same graph in his computational fluid dynamics class (there was no prereq for matlab skills).</p><p>In his first year, I saw him get dragged through the introductory engineering classes which was his first encounter with MATLAB. Students were taught a few rudimentary programming skills and then were expected to make a code for a 'simple' tic-tac-toe game. It took him hours of blank looks and tutoring to even understand the simplest of boolean operators. He was never able to write a working function without the supervision of a friend or tutor. Needless to say, he was permanently scarred by the experience and swore to avoid using it forever.</p><p>After 3 years of avoiding MATLAB, he realised how not knowing it hurt him during his final year project. He had to solve a system of pdes to model the performance of a reactor and practically speaking, MATLAB was the most suitable software at hand. He ended up having to get a friend to help him code the equations in while also having to oversimplify his model.</p><p>The weird thing is that: most students from his chemical engineering faculty were not expected or encouraged to use MATLAB, almost all of their prior assignments required no use of MATLAB except that infamous first year course, and most of his peers also avoided using MATLAB and resorted to Excel. It is my understanding that Excel cannot match MATLAB's efficiency and clarity when solving calculus problems so it was not uncommon to see extremely long Excel spreadsheets.</p><p>Anyway, my friend is, with the help of a friend's past year MATLAB codes, trying to finish up his computational fluid dynamics assignment that's due soon. He finishes university in 2 weeks time.</p><p>Even though he knows that not every engineer has to use MATLAB in the workplace, he somehow wishes he was able to learn MATLAB at his glacial pace. I find it such a pity that he was never able to keep up with the pace of learning that was expected which begs the question: are students who are too slow at learning programming better of in a different field of study?</p><p>If you've managed to read to the end of this, thank you so much. I just don't know how to help my friend and I'm hoping some of you might be able to suggest how I can help him be better at it. I believe he has potential but needs special help when it comes to MATLAB.</p><p>All helpful and constructive suggestions considered,</p><p>Thank You All</p>Jonathanhttps://www.mathworks.com/matlabcentral/profile/authors/4247205tag:www.mathworks.com,2005:Topic/8654512024-06-09T16:21:08Z2024-06-09T16:21:08ZDiscovering an Excellent Resource on Ordinary Differential Equations<p>While searching the internet for some books on ordinary differential equations, I came across a link that I believe is very useful for all math students and not only. If you are interested in ODEs, it's worth taking the time to study it.
A First Look at Ordinary Differential Equations by Timothy S. Judson is an excellent resource for anyone looking to understand ODEs better. Here's a brief overview of the main topics covered:
Introduction to ODEs: Basic concepts, definitions, and initial differential equations.
Methods of Solution:
Separable equations
First-order linear equations
Exact equations
Transcendental functions
Applications of ODEs: Practical examples and applications in various scientific fields.
Systems of ODEs: Analysis and solutions of systems of differential equations.
Series and Numerical Methods: Use of series and numerical methods for solving ODEs.
This book provides a clear and comprehensive introduction to ODEs, making it suitable for students and new researchers in mathematics. If you're interested, you can explore the book in more detail here: A First Look at Ordinary Differential Equations.</p>Athanasios Paraskevopouloshttps://www.mathworks.com/matlabcentral/profile/authors/30623616tag:www.mathworks.com,2005:Topic/8652162024-06-06T17:52:29Z2024-06-06T17:52:29ZNumerical Simulation of the Discrete Klein-Gordon Equation: A Study on Damped, Driven Nonlinear Wave Systems with Spatially Extended Initial Conditions<p>The study of the dynamics of the discrete Klein - Gordon equation (DKG) with friction is given by the equation :</p><p>In the above equation, W describes the potential function:
to which every coupled unit adheres. In Eq. (1), the variable $$ is the unknown displacement of the oscillator occupying the n-th position of the lattice, and is the discretization parameter. We denote by h the distance between the oscillators of the lattice. The chain (DKG) contains linear damping with a damping coefficient , whileis the coefficient of the nonlinear cubic term.</p><p>For the DKG chain (1), we will consider the problem of initial-boundary values, with initial conditions</p><p>and Dirichlet boundary conditions at the boundary points and , that is,</p><p>Therefore, when necessary, we will use the short notation for the one-dimensional discrete Laplacian</p><p>Now we want to investigate numerically the dynamics of the system (1)-(2)-(3). Our first aim is to conduct a numerical study of the property of Dynamic Stability of the system, which directly depends on the existence and linear stability of the branches of equilibrium points.</p><p>For the discussion of numerical results, it is also important to emphasize the role of the parameter . By changing the time variable , we rewrite Eq. (1) in the form</p><p>. We consider spatially extended initial conditions of the form: where is the distance of the grid and is the amplitude of the initial condition</p><p>We also assume zero initial velocity:</p><pre> the following graphs for and
% Parameters
L = 200; % Length of the system
K = 99; % Number of spatial points
j = 2; % Mode number
omega_d = 1; % Characteristic frequency
beta = 1; % Nonlinearity parameter
delta = 0.05; % Damping coefficient</pre><p>% Spatial grid
h = L / (K + 1);
n = linspace(-L/2, L/2, K+2); % Spatial points
N = length(n);
omegaDScaled = h * omega_d;
deltaScaled = h * delta;</p><p>% Time parameters
dt = 1; % Time step
tmax = 3000; % Maximum time
tspan = 0:dt:tmax; % Time vector</p><p>% Values of amplitude 'a' to iterate over
a_values = [2, 1.95, 1.9, 1.85, 1.82]; % Modify this array as needed</p><p>% Differential equation solver function
function dYdt = odefun(~, Y, N, h, omegaDScaled, deltaScaled, beta)
U = Y(1:N);
Udot = Y(N+1:end);
Uddot = zeros(size(U));</p><pre> % Laplacian (discrete second derivative)
for k = 2:N-1
Uddot(k) = (U(k+1) - 2 * U(k) + U(k-1)) ;
end</pre><pre> % System of equations
dUdt = Udot;
dUdotdt = Uddot - deltaScaled * Udot + omegaDScaled^2 * (U - beta * U.^3);</pre><pre> % Pack derivatives
dYdt = [dUdt; dUdotdt];
end</pre><p>% Create a figure for subplots
figure;</p><p>% Initial plot
a_init = 2; % Example initial amplitude for the initial condition plot
U0_init = a_init * sin((j * pi * h * n) / L); % Initial displacement
U0_init(1) = 0; % Boundary condition at n = 0
U0_init(end) = 0; % Boundary condition at n = K+1
subplot(3, 2, 1);
plot(n, U0_init, 'r.-', 'LineWidth', 1.5, 'MarkerSize', 10); % Line and marker plot
xlabel('$x_n$', 'Interpreter', 'latex');
ylabel('$U_n$', 'Interpreter', 'latex');
title('$t=0$', 'Interpreter', 'latex');
set(gca, 'FontSize', 12, 'FontName', 'Times');
xlim([-L/2 L/2]);
ylim([-3 3]);
grid on;</p><p>% Loop through each value of 'a' and generate the plot
for i = 1:length(a_values)
a = a_values(i);</p><pre> % Initial conditions
U0 = a * sin((j * pi * h * n) / L); % Initial displacement
U0(1) = 0; % Boundary condition at n = 0
U0(end) = 0; % Boundary condition at n = K+1
Udot0 = zeros(size(U0)); % Initial velocity</pre><pre> % Pack initial conditions
Y0 = [U0, Udot0];</pre><pre> % Solve ODE
opts = odeset('RelTol', 1e-5, 'AbsTol', 1e-6);
[t, Y] = ode45(@(t, Y) odefun(t, Y, N, h, omegaDScaled, deltaScaled, beta), tspan, Y0, opts);</pre><pre> % Extract solutions
U = Y(:, 1:N);
Udot = Y(:, N+1:end);</pre><pre> % Plot final displacement profile
subplot(3, 2, i+1);
plot(n, U(end,:), 'b.-', 'LineWidth', 1.5, 'MarkerSize', 10); % Line and marker plot
xlabel('$x_n$', 'Interpreter', 'latex');
ylabel('$U_n$', 'Interpreter', 'latex');
title(['$t=3000$, $a=', num2str(a), '$'], 'Interpreter', 'latex');
set(gca, 'FontSize', 12, 'FontName', 'Times');
xlim([-L/2 L/2]);
ylim([-2 2]);
grid on;
end</pre><p>% Adjust layout
set(gcf, 'Position', [100, 100, 1200, 900]); % Adjust figure size as needed</p><p>Dynamics for the initial condition , , for , for different amplitude values. By reducing the amplitude values, we observe the convergence to equilibrium points of different branches from and the appearance of values for which the solution converges to a non-linear equilibrium point Parameters:</p><pre> Detection of a stability threshold : For , the initial condition , , converges to a non-linear equilibrium point.</pre><p>Characteristics for , with corresponding norm where the dynamics appear in the first image of the third row, we observe convergence to a non-linear equilibrium point of branch This has the same norm and the same energy as the previous case but the final state has a completely different profile. This result suggests secondary bifurcations have occurred in branch</p><p>By further reducing the amplitude, distinct values of are discerned: 1.9, 1.85, 1.81 for which the initial condition with norms respectively, converges to a non-linear equilibrium point of branch This equilibrium point has norm and energy . The behavior of this equilibrium is illustrated in the third row and in the first image of the third row of Figure 1, and also in the first image of the third row of Figure 2. For all the values between the aforementioned , the initial condition converges to geometrically different non-linear states of branch as shown in the second image of the first row and the first image of the second row of Figure 2, for amplitudes and respectively.</p><p>Refference:
Dynamics of nonlinear lattices: asymptotic behavior and study of the existence and stability of tracked oscillations-Vetas Konstantinos (2018)</p>Athanasios Paraskevopouloshttps://www.mathworks.com/matlabcentral/profile/authors/30623616tag:www.mathworks.com,2005:Topic/8641662024-05-30T17:32:32Z2024-05-30T17:32:32ZPodcast highlighting a popular MATLAB community Toolbox.<p>Check out this episode about PIVLab: https://www.buzzsprout.com/2107763/15106425</p><p>Join the conversation with William Thielicke, the developer of PIVlab, as he shares insights into the world of particle image velocimetery (PIV) and its applications. Discover how PIV accurately measures fluid velocities, non invasively revolutionising research across the industries. Delve into the development journey of PI lab, including collaborations, key features and future advancements for aerodynamic studies, explore the advanced hardware setups camera technologies, and educational prospects offered by PIVlab, for enhanced fluid velocity measurements. If you are interested in the hardware he speaks of check out the company: Optolution.</p>Garethhttps://www.mathworks.com/matlabcentral/profile/authors/14148363tag:www.mathworks.com,2005:Topic/8634712024-05-27T13:49:02Z2024-05-29T21:06:40ZReport Ambiguity: Lyapunov Exponent<p>In the MATLAB description of the algorithm for Lyapunov exponents, I believe there is ambiguity and misuse.
https://www.mathworks.com/help/predmaint/ref/lyapunovexponent.html
The lambda(i) in the reference literature signifies the Lyapunov exponent of the entire phase space data after expanding by i time steps, but in the calculation formula provided in the MATLAB help documentation, Y_(i+K) represents the data point at the i-th point in the reconstructed data Y after K steps, and this calculation formula also does not match the calculation code given by MATLAB. I believe there should be some misguidance and misunderstanding here.
According to the symbol regulations in the algorithm description and the MATLAB code, I think the correct formula might be y(i) = 1/dt * 1/N * sum_j( log( <tt>|Y_(j+i) - Y_(j*+i)|</tt> ) )</p>Jiahe Songhttps://www.mathworks.com/matlabcentral/profile/authors/20598722