Submit Search
Upload
matlab codes.pdf
•
1 like
•
75 views
E
EdysaulCondorhuancar
Follow
Codigos de Matlab sobre simulacion
Read less
Read more
Education
Report
Share
Report
Share
1 of 8
Download now
Download to read offline
Recommended
This lecture presented as part of Model Uncertainty: Statistical and Mathematical fall course.
2018 MUMS Fall Course - Statistical and Mathematical Techniques for Sensitivi...
2018 MUMS Fall Course - Statistical and Mathematical Techniques for Sensitivi...
The Statistical and Applied Mathematical Sciences Institute
control system
control system
control system
naqeeb93
02 asymp
02 asymp
aparnabk7
Fourier series example
Fourier series example
Abi finni
This lecture presented as part of Model Uncertainty: Statistical and Mathematical fall course.
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
The Statistical and Applied Mathematical Sciences Institute
This 20-minute talk was presented during the Operator Splitting Workshop
QMC: Operator Splitting Workshop, Thresholdings, Robustness, and Generalized ...
QMC: Operator Splitting Workshop, Thresholdings, Robustness, and Generalized ...
The Statistical and Applied Mathematical Sciences Institute
hku comp2119
Copy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquer
Joepang2015
Graphs of Trig functions
6. graphs of trig functions x
6. graphs of trig functions x
harbormath240
Recommended
This lecture presented as part of Model Uncertainty: Statistical and Mathematical fall course.
2018 MUMS Fall Course - Statistical and Mathematical Techniques for Sensitivi...
2018 MUMS Fall Course - Statistical and Mathematical Techniques for Sensitivi...
The Statistical and Applied Mathematical Sciences Institute
control system
control system
control system
naqeeb93
02 asymp
02 asymp
aparnabk7
Fourier series example
Fourier series example
Abi finni
This lecture presented as part of Model Uncertainty: Statistical and Mathematical fall course.
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
The Statistical and Applied Mathematical Sciences Institute
This 20-minute talk was presented during the Operator Splitting Workshop
QMC: Operator Splitting Workshop, Thresholdings, Robustness, and Generalized ...
QMC: Operator Splitting Workshop, Thresholdings, Robustness, and Generalized ...
The Statistical and Applied Mathematical Sciences Institute
hku comp2119
Copy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquer
Joepang2015
Graphs of Trig functions
6. graphs of trig functions x
6. graphs of trig functions x
harbormath240
Descripción de las Notaciones asintoticas
Clase3 Notacion
Clase3 Notacion
luzenith_g
Introduction to Analysis of Algorithms
Asymptotic Growth of Functions
Asymptotic Growth of Functions
DEVTYPE
This lecture presented as part of Model Uncertainty: Statistical and Mathematical fall course.
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
The Statistical and Applied Mathematical Sciences Institute
Classification of signals Deterministic and Random signals Continuous time and discrete time signal Even (symmetric) and Odd (Anti-symmetric) signal Periodic and Aperiodic signal Energy and Power signal Causal and Non-causal signal
Unit-1 Classification of Signals
Unit-1 Classification of Signals
Dr.SHANTHI K.G
Unit 1 -Introduction to signals and standard signals
Unit 1 -Introduction to signals and standard signals
Unit 1 -Introduction to signals and standard signals
Dr.SHANTHI K.G
The Cramér-Rao Lower Bound on the Variance of the Estimator of continuous SISO, MIMO and Digital Systems. Probability and Estimation are prerequisite. For comments please connect me at solo.hermelin@gmail.com. For more presentations on different subjects visit my website at http://solohermelin.com.
5 cramer-rao lower bound
5 cramer-rao lower bound
Solo Hermelin
power point presentation on Fourier series.
AEM Fourier series
AEM Fourier series
Siddhi Viradiya
Fourier Series, Heat Equation,Mathematics
Fourier series
Fourier series
kishor pokar
In many statistical problems, estimators are derived from maximizing a data-dependent function of the parameter, usually in the form of an empirical average., e.g. the maximum likelihood and the least squares. For asymptotic studies, ordinary calculus fails if the parameter is non-Euclidean or has an infinite-dimensional component. In such cases, it becomes useful to capitalize on general M-estimation theorems formulated in terms of Banach-space-valued parameters. Although these theorems are constructed using sophisticated empirical processes results and arguments, the idea is usually simple enough to grasp. For example, if the objective function converges in probability to a limit function, then the estimator should also tend in probability to the maximizer of that limit function (consistency). Now, if a centered and re-scaled objective function that takes a centered and re-scaled parameter as argument converges weakly to a tight limit process, then the centered and re-scaled estimator should also tend weakly to the (hopefully tight) maximizer of that tight limit process. Along this line, it is clear that the proper re-scaling rate on the parameter (argument) should render the standardized objective function (in the form of an empirical process) asymptotically tight. Therefore, it is not surprising that the re-scaling rate is intimately related to the "modulus of continuity" of the empirical process. This is essentially the spirit of rate theorems such as Theorem 3.2.5 of van der Vaart and Wellner (1996) and Theorem 7.4 of van de Geer (2000), where technical tools such as the “peeling device” are employed to make the mathematics go through. This presentation tries to deliver the intuitive ideas behind the general M-estimation theory. For a complete and rigorous treatment, please refer to the relevant parts of Vaart and Wellner (1996) and van de Geer (2000), among others. An application with one-sample estimation in current status data is briefly described. For details, please refer to Groeneboom and Wellner, J. A. (1992). The slides were originally presented in the class STOR 831 Advanced Probability in Fall 2013 at UNC Chapel Hill as a final project.
Rates of convergence in M-Estimation with an example from current status data
Rates of convergence in M-Estimation with an example from current status data
Lu Mao
residue
residue
Rob Arnold
Base of nyquist theorem is defined here in concise manner.
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]
Asafak Husain
I am Frank P. I am a Physical Chemistry Assignment Expert at eduassignmenthelp.com. I hold a Ph.D. in Physical Chemistry, from Malacca, Malaysia. I have been helping students with their homework for the past 6 years. I solve assignments related to Physical Chemistry. Visit eduassignmenthelp.com or email info@eduassignmenthelp.com. You can also call on +1 678 648 4277 for any assistance with Physical Chemistry Assignments.
Physical Chemistry Assignment Help
Physical Chemistry Assignment Help
Edu Assignment Help
Modeling dynamic systems
002 ray modeling dynamic systems
002 ray modeling dynamic systems
Institute of Technology Telkom
fourier transforms
fourier transforms
Umang Gupta
International Conference on Monte Carlo techniques Closing conference of thematic cycle Paris July 5-8th 2016 Campus les cordeliers Chris Sherlock's slides
Chris Sherlock's slides
Chris Sherlock's slides
Christian Robert
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
Chung Hua Universit
Slides for the PhD Course "Mathematical Techniques in Engineering Sciences", Module Statistics, Ghent University
Estimation Theory, PhD Course, Ghent University, Belgium
Estimation Theory, PhD Course, Ghent University, Belgium
Stijn De Vuyst
Its states Periodic function, Fourier series for disontinous function, Fourier series, Intervals, Odd and even functions, Half range fourier series etc. Mostly used as active learning assignment in Degree 3rd sem students.
Fourier series Introduction
Fourier series Introduction
Rizwan Kazi
Fourier series 1
Fourier series 1
Dr. Nirav Vyas
An analysis of the behaviour of the Moore-Spiegel oscillator with computer simulations.
The Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
Abhranil Das
profe el codigo ya con los resultados
Sary
Sary
sarylozano
Incorporate the SOR method in the multigridTest.m and apply the multigridTest.m, to determine the effects of changes in Pre-smoothing iterations Post-smoothing iterations Multigrid cycle type Iterative method Number of grids (or grid hierarchy) % SOR (Successive Over-Relaxation) n = input('Enter number of equations, n: '); A = zeros(n,n+1); x1 = zeros(1,n); A=[5 -2 3 -1;-3 9 1 2;2 -1 -7 3]; x1 = [0 0 0]; tol = input('Enter tolerance, tol: '); m = input('Enter maximum number of iterations, m: '); w = input('Enter the parameter w (omega): '); k = 1; while k <= m err = 0; for i = 1 : n s = 0; for j = 1 : n s = s-A(i,j)*x1(j); end s = w*(s+A(i,n+1))/A(i,i); if abs(s) > err err = abs(s); end x1(i) = x1(i)+s; end if err <= tol break; else k = k+1; end end fprintf('The solution vector after %d iterations is :\n', k); for i = 1 : n fprintf(' %11.8f \n', x1(i)); end %% Multigrid test case with visulization % Author: Ben Beaudry clc; clear; close all load A_b.mat; A = full(A); % Unsparce matrix to show full power of Multigrid pre = 2; % Number of presmoothing iterations post = 2; % Number of postsmoothing iterations % cycle = 1; % Type of multigrid cycle (1=V-cycle, 2=W-cycle, 3=F-cycle) smooth = 1; % Smoother type (1=Jacobi, 2=Gauss-Seidel) grids = 5; % Max grids in cycle maxit = 10; % Max iterations of solver tol = 1e-02; % Tolerance of solver %% Solvers % solve directly t=cputime; x_D = A\b; fprintf('Direct Solve Time: %g Seconds\n',cputime-t) % V-Cycle t=cputime; [x_V,res_V,it_V] = multigrid(A,b,pre,post,1,smooth,grids,maxit,tol); fprintf('V-Cycle Solve Time: %g Seconds\n',cputime-t) % W-Cycle t=cputime; [x_W,res_W,it_W] = multigrid(A,b,pre,post,2,smooth,grids,maxit,tol); fprintf('W-Cycle Solve Time: %g Seconds\n',cputime-t) % F-Cycle t=cputime; [x_F,res_F,it_F] = multigrid(A,b,pre,post,3,smooth,grids,maxit,tol); fprintf('F-Cycle Solve Time: %g Seconds\n',cputime-t) % max it for iterative methods it = 100; % Gauss-Siedel t=cputime; L = tril(A); U = triu(A,1); x_G = zeros(length(b),1); res_G= zeros(it,1); for g = 1:it x_G = L\(b-U*x_G); r = b - A * x_G; res_G(g) = norm(r); if res_G(g) < tol break; end end fprintf('Gauss-Seidel Solve Time: %g Seconds\n',cputime-t) % Jacobi t=cputime; d = diag(A); dinv = 1./d; LU = tril(A,-1)+triu(A,1); U = triu(A,1); x_J = zeros(length(b),1); res_J= zeros(it,1); for j = 1:it x_J = dinv.*(b-(LU*x_J)); r = b - A * x_J; res_J(j) = norm(r); if res_J(j) < tol break; end end fprintf('Jacobi Solve Time: %g Seconds\n',cputime-t) %% Plotting figure; hold on plot(1:g,res_G(1:g),'o-','DisplayName','Guass-Seidel') plot(1:j,res_J(1:j),'o-','DisplayName','Jacobi') plot(1:it_V,res_V(1:it_V),'o-','DisplayName','V-Cycle Multigrid') plot(1:it_F,res_F(1:it_F),'o-','DisplayName','F-Cycle Multigrid') plot(1:it_W,res_W(1:it_W),'o-','DisplayName','W-Cycle Multigrid') set(gca,'XLim',[0 100]); grid on legend('location','best') ylabel('Relative Convergance') xlabel('Iterations') title('Convergance of Numerical System') hold off MULTIGRID FUNC.
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
aartechindia
More Related Content
What's hot
Descripción de las Notaciones asintoticas
Clase3 Notacion
Clase3 Notacion
luzenith_g
Introduction to Analysis of Algorithms
Asymptotic Growth of Functions
Asymptotic Growth of Functions
DEVTYPE
This lecture presented as part of Model Uncertainty: Statistical and Mathematical fall course.
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
The Statistical and Applied Mathematical Sciences Institute
Classification of signals Deterministic and Random signals Continuous time and discrete time signal Even (symmetric) and Odd (Anti-symmetric) signal Periodic and Aperiodic signal Energy and Power signal Causal and Non-causal signal
Unit-1 Classification of Signals
Unit-1 Classification of Signals
Dr.SHANTHI K.G
Unit 1 -Introduction to signals and standard signals
Unit 1 -Introduction to signals and standard signals
Unit 1 -Introduction to signals and standard signals
Dr.SHANTHI K.G
The Cramér-Rao Lower Bound on the Variance of the Estimator of continuous SISO, MIMO and Digital Systems. Probability and Estimation are prerequisite. For comments please connect me at solo.hermelin@gmail.com. For more presentations on different subjects visit my website at http://solohermelin.com.
5 cramer-rao lower bound
5 cramer-rao lower bound
Solo Hermelin
power point presentation on Fourier series.
AEM Fourier series
AEM Fourier series
Siddhi Viradiya
Fourier Series, Heat Equation,Mathematics
Fourier series
Fourier series
kishor pokar
In many statistical problems, estimators are derived from maximizing a data-dependent function of the parameter, usually in the form of an empirical average., e.g. the maximum likelihood and the least squares. For asymptotic studies, ordinary calculus fails if the parameter is non-Euclidean or has an infinite-dimensional component. In such cases, it becomes useful to capitalize on general M-estimation theorems formulated in terms of Banach-space-valued parameters. Although these theorems are constructed using sophisticated empirical processes results and arguments, the idea is usually simple enough to grasp. For example, if the objective function converges in probability to a limit function, then the estimator should also tend in probability to the maximizer of that limit function (consistency). Now, if a centered and re-scaled objective function that takes a centered and re-scaled parameter as argument converges weakly to a tight limit process, then the centered and re-scaled estimator should also tend weakly to the (hopefully tight) maximizer of that tight limit process. Along this line, it is clear that the proper re-scaling rate on the parameter (argument) should render the standardized objective function (in the form of an empirical process) asymptotically tight. Therefore, it is not surprising that the re-scaling rate is intimately related to the "modulus of continuity" of the empirical process. This is essentially the spirit of rate theorems such as Theorem 3.2.5 of van der Vaart and Wellner (1996) and Theorem 7.4 of van de Geer (2000), where technical tools such as the “peeling device” are employed to make the mathematics go through. This presentation tries to deliver the intuitive ideas behind the general M-estimation theory. For a complete and rigorous treatment, please refer to the relevant parts of Vaart and Wellner (1996) and van de Geer (2000), among others. An application with one-sample estimation in current status data is briefly described. For details, please refer to Groeneboom and Wellner, J. A. (1992). The slides were originally presented in the class STOR 831 Advanced Probability in Fall 2013 at UNC Chapel Hill as a final project.
Rates of convergence in M-Estimation with an example from current status data
Rates of convergence in M-Estimation with an example from current status data
Lu Mao
residue
residue
Rob Arnold
Base of nyquist theorem is defined here in concise manner.
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]
Asafak Husain
I am Frank P. I am a Physical Chemistry Assignment Expert at eduassignmenthelp.com. I hold a Ph.D. in Physical Chemistry, from Malacca, Malaysia. I have been helping students with their homework for the past 6 years. I solve assignments related to Physical Chemistry. Visit eduassignmenthelp.com or email info@eduassignmenthelp.com. You can also call on +1 678 648 4277 for any assistance with Physical Chemistry Assignments.
Physical Chemistry Assignment Help
Physical Chemistry Assignment Help
Edu Assignment Help
Modeling dynamic systems
002 ray modeling dynamic systems
002 ray modeling dynamic systems
Institute of Technology Telkom
fourier transforms
fourier transforms
Umang Gupta
International Conference on Monte Carlo techniques Closing conference of thematic cycle Paris July 5-8th 2016 Campus les cordeliers Chris Sherlock's slides
Chris Sherlock's slides
Chris Sherlock's slides
Christian Robert
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
Chung Hua Universit
Slides for the PhD Course "Mathematical Techniques in Engineering Sciences", Module Statistics, Ghent University
Estimation Theory, PhD Course, Ghent University, Belgium
Estimation Theory, PhD Course, Ghent University, Belgium
Stijn De Vuyst
Its states Periodic function, Fourier series for disontinous function, Fourier series, Intervals, Odd and even functions, Half range fourier series etc. Mostly used as active learning assignment in Degree 3rd sem students.
Fourier series Introduction
Fourier series Introduction
Rizwan Kazi
Fourier series 1
Fourier series 1
Dr. Nirav Vyas
What's hot
(19)
Clase3 Notacion
Clase3 Notacion
Asymptotic Growth of Functions
Asymptotic Growth of Functions
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
Unit-1 Classification of Signals
Unit-1 Classification of Signals
Unit 1 -Introduction to signals and standard signals
Unit 1 -Introduction to signals and standard signals
5 cramer-rao lower bound
5 cramer-rao lower bound
AEM Fourier series
AEM Fourier series
Fourier series
Fourier series
Rates of convergence in M-Estimation with an example from current status data
Rates of convergence in M-Estimation with an example from current status data
residue
residue
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]
Physical Chemistry Assignment Help
Physical Chemistry Assignment Help
002 ray modeling dynamic systems
002 ray modeling dynamic systems
fourier transforms
fourier transforms
Chris Sherlock's slides
Chris Sherlock's slides
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
Estimation Theory, PhD Course, Ghent University, Belgium
Estimation Theory, PhD Course, Ghent University, Belgium
Fourier series Introduction
Fourier series Introduction
Fourier series 1
Fourier series 1
Similar to matlab codes.pdf
An analysis of the behaviour of the Moore-Spiegel oscillator with computer simulations.
The Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
Abhranil Das
profe el codigo ya con los resultados
Sary
Sary
sarylozano
Incorporate the SOR method in the multigridTest.m and apply the multigridTest.m, to determine the effects of changes in Pre-smoothing iterations Post-smoothing iterations Multigrid cycle type Iterative method Number of grids (or grid hierarchy) % SOR (Successive Over-Relaxation) n = input('Enter number of equations, n: '); A = zeros(n,n+1); x1 = zeros(1,n); A=[5 -2 3 -1;-3 9 1 2;2 -1 -7 3]; x1 = [0 0 0]; tol = input('Enter tolerance, tol: '); m = input('Enter maximum number of iterations, m: '); w = input('Enter the parameter w (omega): '); k = 1; while k <= m err = 0; for i = 1 : n s = 0; for j = 1 : n s = s-A(i,j)*x1(j); end s = w*(s+A(i,n+1))/A(i,i); if abs(s) > err err = abs(s); end x1(i) = x1(i)+s; end if err <= tol break; else k = k+1; end end fprintf('The solution vector after %d iterations is :\n', k); for i = 1 : n fprintf(' %11.8f \n', x1(i)); end %% Multigrid test case with visulization % Author: Ben Beaudry clc; clear; close all load A_b.mat; A = full(A); % Unsparce matrix to show full power of Multigrid pre = 2; % Number of presmoothing iterations post = 2; % Number of postsmoothing iterations % cycle = 1; % Type of multigrid cycle (1=V-cycle, 2=W-cycle, 3=F-cycle) smooth = 1; % Smoother type (1=Jacobi, 2=Gauss-Seidel) grids = 5; % Max grids in cycle maxit = 10; % Max iterations of solver tol = 1e-02; % Tolerance of solver %% Solvers % solve directly t=cputime; x_D = A\b; fprintf('Direct Solve Time: %g Seconds\n',cputime-t) % V-Cycle t=cputime; [x_V,res_V,it_V] = multigrid(A,b,pre,post,1,smooth,grids,maxit,tol); fprintf('V-Cycle Solve Time: %g Seconds\n',cputime-t) % W-Cycle t=cputime; [x_W,res_W,it_W] = multigrid(A,b,pre,post,2,smooth,grids,maxit,tol); fprintf('W-Cycle Solve Time: %g Seconds\n',cputime-t) % F-Cycle t=cputime; [x_F,res_F,it_F] = multigrid(A,b,pre,post,3,smooth,grids,maxit,tol); fprintf('F-Cycle Solve Time: %g Seconds\n',cputime-t) % max it for iterative methods it = 100; % Gauss-Siedel t=cputime; L = tril(A); U = triu(A,1); x_G = zeros(length(b),1); res_G= zeros(it,1); for g = 1:it x_G = L\(b-U*x_G); r = b - A * x_G; res_G(g) = norm(r); if res_G(g) < tol break; end end fprintf('Gauss-Seidel Solve Time: %g Seconds\n',cputime-t) % Jacobi t=cputime; d = diag(A); dinv = 1./d; LU = tril(A,-1)+triu(A,1); U = triu(A,1); x_J = zeros(length(b),1); res_J= zeros(it,1); for j = 1:it x_J = dinv.*(b-(LU*x_J)); r = b - A * x_J; res_J(j) = norm(r); if res_J(j) < tol break; end end fprintf('Jacobi Solve Time: %g Seconds\n',cputime-t) %% Plotting figure; hold on plot(1:g,res_G(1:g),'o-','DisplayName','Guass-Seidel') plot(1:j,res_J(1:j),'o-','DisplayName','Jacobi') plot(1:it_V,res_V(1:it_V),'o-','DisplayName','V-Cycle Multigrid') plot(1:it_F,res_F(1:it_F),'o-','DisplayName','F-Cycle Multigrid') plot(1:it_W,res_W(1:it_W),'o-','DisplayName','W-Cycle Multigrid') set(gca,'XLim',[0 100]); grid on legend('location','best') ylabel('Relative Convergance') xlabel('Iterations') title('Convergance of Numerical System') hold off MULTIGRID FUNC.
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
aartechindia
RPRP SERIAL CHAIN MANIPULATOR & 3RPR PLANAR PARALLEL MANIPULATOR
Rprp 3 Rpr
Rprp 3 Rpr
SumitTripathi
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian Vasquez
Sebastian Vasquez
profe que pena la demora ese es mi trabajo
Martha
Martha
MarthaPaz
Eccentric orbits on a Schwarzschild background. Talk given 2015/11/12 at Institut des Hautes Études Scientifiques (IHES), Paris.
Finding self-force quantities in a post-Newtonian expansion
Finding self-force quantities in a post-Newtonian expansion
Lisa Erkens
c
Md Nasfik
Md Nasfik
Md. Nasfikur R. Khan
小波变换程序
小波变换程序
byron zhao
小波变换程序
小波变换程序
byron zhao
Abstract
Abstract
Geophysics-IASBS
ODE 45 code matlab
ode45 task.docx
ode45 task.docx
likeme123456
Algorithms/Number Theory for Network Security
Number Theory for Security
Number Theory for Security
Abhijit Mondal
R data visualization
An example of R code for Data visualization
An example of R code for Data visualization
Liang (Leon) Zhou
東京大学松尾研究室 強化学習サマースクール2020 第5回 https://deeplearning.jp/reinforcement_cource-2020s/
Control as Inference (強化学習とベイズ統計)
Control as Inference (強化学習とベイズ統計)
Shohei Taniguchi
University of manchester mathematical formula tables
University of manchester mathematical formula tables
Gaurav Vasani
ME_541_HW_04
ME_541_HW_04
Jared Fertig
Use the same variable names and write the function F = Force(x,ks,kc,l0,S) ; function l0 = Compute_Rest_Length(x) ; function z = Equations_Of_Motion(xv,m,ks,kc,l0,S) ; in octave. And answer the 6 questions below #!/usr/bin/env octave % Only modify this file where you see a "% TODO" % Functions that do not contain this should not be modified. % If you modify them for debugging, please remove/comment those modifications. % This line tells octave that this is not a function file. 1; % Workaround fltk bug. You might need to comment this line out. graphics_toolkit("gnuplot"); % Meanings of commonly encountered variables: % n = number of particles % x = 2*n dimensional column vector with the positions of the particles % v = 2*n dimensional column vector with the velocities of the particles % Note that the ordering is always x1 y1 x2 y2 x3 y3 ... % ks = spring constant % kc = penalty collision strength % l0 = matrix of spring rest lengths. % l0(i,j) = initial length of spring between particles i and j (i<j) % Note that l0(i,j) should not be used if i>=j. % S = matrix indicating which springs exist % S(i,j) = 1 if there is a spring between particles i and j (i<j) % Note that S(i,j) should not be used if i>=j. % m = mass of the particles (all particles have the same mass) % Computes the total potential energy for the system. function E = Potential_Energy(x,ks,kc,l0,S) n = rows(S); E = 0; % For each pair of particles (i<j) for i = 1:n xi = x(2*i-1:2*i,1); % Position of particle i for j = i+1:n % If there is a spring between particles i and j if S(i,j)>0 xj = x(2*j-1:2*j,1); % Position of particle j % Compute the potential energy of the spring. E = E + .5*ks/l0(i,j)*(norm(xi-xj)-l0(i,j))^2; end end % Compute the potential energy of the penalty collision force for particle i % If the particle is inside the radius 2 circle centered at the origin, % then there is no collision (no force, zero potential energy). % Otherwise, the energy rises quadratically with distance from the circle. E = E + .5*kc*max(norm(xi)-2,0)^2; end end % Computes the total energy for the system. function E = Total_Energy(x,v,m,ks,kc,l0,S) n = rows(S); KE = 0; % Kinetic energy for particle = 1/2 m ||v||^2 for i = 1:n vi = v(2*i-1:2*i,1); KE = KE + .5*m*(vi'*vi); end % Total energy is kinetic + potential E = KE + Potential_Energy(x,ks,kc,l0,S); end % Computes the total force for all of the particles in the system. x is a 2*n % dimensional vector. On exit, F should be a 2*n dimensional vector containing % the total force on each of the n particles. The force can be deduced from the % potential energy. In particular, F(k) is the negative partial derivative of PE % with respect to x(k). Here k=1..2*n and PE is the quantity computed by % Potential_Energy. Treat the Potential_Energy function as a regular math % function, which is a function of its input x. function F = Force(x,ks,kc,l0,S) n = rows(S); F = zeros(2*n,1); % TODO end % Computes the total momentum p and angular momentum L for t.
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
acteleshoppe
DSP LAB MANUAL SOLUTION
DSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docx
MUMAR57
LAPLACE MATERI
Laplace_1.ppt
Laplace_1.ppt
cantatebrugyral
Similar to matlab codes.pdf
(20)
The Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
Sary
Sary
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Rprp 3 Rpr
Rprp 3 Rpr
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian Vasquez
Martha
Martha
Finding self-force quantities in a post-Newtonian expansion
Finding self-force quantities in a post-Newtonian expansion
Md Nasfik
Md Nasfik
小波变换程序
小波变换程序
小波变换程序
小波变换程序
Abstract
Abstract
ode45 task.docx
ode45 task.docx
Number Theory for Security
Number Theory for Security
An example of R code for Data visualization
An example of R code for Data visualization
Control as Inference (強化学習とベイズ統計)
Control as Inference (強化学習とベイズ統計)
University of manchester mathematical formula tables
University of manchester mathematical formula tables
ME_541_HW_04
ME_541_HW_04
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
DSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docx
Laplace_1.ppt
Laplace_1.ppt
Recently uploaded
aaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
How libraries can support authors with open access requirements for UKRI funded books Wednesday 22 May 2024, 14:00-15:00.
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
plant breeding method
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
parmarsneha2
This presentation explores the advantages and obstacles associated with Open Educational Resources (OER).
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
dimpy50
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024. He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
Fish and Chips activity for Food unit.
Fish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction. This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
Geographical themes connected with Taylor Swift's ERAS tour - coming to the UK in June 2024
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
Incheon National University Capstone Design Final Presentation - Team Password 486 With Seungjun Rye(CSE), Eunbin Lee(BIZ). Jeonggyo Lee(ECON)
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
bu07226
Clear articulation of the 21st century skills in the Matatag curriculum
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
JenilouCasareno
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
How libraries can support authors with open access requirements for UKRI funded books Wednesday 22 May 2024, 14:00-15:00.
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
Let us know about Maruti Suzuki, a successful Joint venture in India.
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful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f
CarlosHernanMontoyab2
https://app.box.com/s/tkvuef7ygq0mecwlj72eucr4g9d3ljcs
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
Nguyen Thanh Tu Collection
Child centred education is an educational approach that priorities the interest, needs and abilities of the child in the learning process.
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
Powerpoint presentation
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
Recently uploaded
(20)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Fish and Chips - have they had their chips
Fish and Chips - have they had their chips
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
matlab codes.pdf
1.
function bergschrund() % solve
ode for steady glacier thickness with ice flux q = x*(1-x/2) %% Parameters n = 3; mu = 0.1; %% Numerical solutions of rescaled boundary layer problems opts = odeset('reltol',1e-6); xinf = 10; xeps = 1e-4; Heps = 2^(n/(2*n+2))*(n+2)^(1/(2*n+2))*xeps^(1/2); % analytical approximation of singular behaviour [xh2,Hh2] = ode45(@(x,H) ((n+2)*x.*H.^(-(n+2))).^(1/n)-1 , [xeps xinf] , Heps , opts); xinf = 10; Hinf = ((n+2)*xinf).^(1/(n+2)); % analytical approximation of far field behaviour [xh1,Hh1] = ode45(@(x,H) 1-((n+2)*x.*H.^(-(n+2))).^(1/n) , [xinf 0] , Hinf , opts); Hhstar = Hh1(end), %% Numerical solution opts = odeset('reltol',1e-6); xeps = 1e-4; Heps = mu^(- n/(2*n+2))*2^(n/(2*n+2))*(n+2)^(1/(2*n+2))*xeps^(1/2); % analytical approximation of singular behaviour at x = 2 [xn,Hn] = ode45(@ode_fun,[2-xeps 0],Heps,opts); function dHdx = ode_fun(x,H) dHdx = (1-((n+2)*x.*(1-x/2).*H.^(-(n+2))).^(1/n))/mu; end %% Outer solution x = linspace(0,2,100); H = ((n+2)*x.*(1-x/2)).^(1/(n+2)); %% Inner solutions x1 = mu^((n+2)/(n+1))*xh1; H1 = mu^(1/(n+1))*Hh1; x2 = 2-mu^((n+2)/(n+1))*xh2; H2 = mu^(1/(n+1))*Hh2; %% Plot solutions figure(1); clf; set(gcf,'Paperpositionmode','auto','units','centimeters','position',[2 4 12 8]); set(gcf,'DefaultAxesFontSize',12,'DefaultTextFontSize',12); plot(xn,Hn,'b-','linewidth',2); hold on; plot(x,H,'k--',x1,H1,'r--',x2,H2,'r--'); xlabel('$x$','interpreter','latex'); ylabel('$H$','interpreter','latex'); xlim([0 2]); % %% Save figure % print(gcf,'-depsc2',mfilename,'-loose'); %% Plot other numerical solutions of boundary layer at x = 0 figure(2); clf; set(gcf,'Paperpositionmode','auto','units','centimeters','position',[2 4 12 8]); set(gcf,'DefaultAxesFontSize',12,'DefaultTextFontSize',12); xinf = 10;
2.
x = linspace(0,xinf,100); plot(x,((n+2)*x).^(1/(n+2)),'k--','linewidth',2);
% far-field behaviour hold on; xinf = 10; H0s = [0.9:.02:1.1]*Hhstar; % guesses at initial value for H0 = H0s [xh1,Hh1] = ode45(@(x,H) 1-((n+2)*x.*H.^(-(n+2))).^(1/n) , [0 xinf] , H0 ); plot(xh1,Hh1,'-'); end xlabel('$hat{x}$','interpreter','latex'); ylabel('$hat{H}$','interpreter','latex'); % %% Save figure % print(gcf,'-depsc2',[mfilename,'2'],'-loose'); end
3.
function carbon_cycles() % solves
equations for albedo and CO2 partial pressure % da/dt = B(T) - a % dp/dt = alpha*(1-w*p^mu*e^T) % T = T(a,p) % plots trajectories on phase plane % % IJH 28 Sept 2016 %% Dimensionless parameters ap = 0.58; am = 0.11; c1 = 0.2; c2 = 0.6; mu = 0.3; q = 1.37; lambda = 0.25; nu = 0.18; alpha = .01; % 1.05 / .01 w = 1; % 1 / .15 %% Scaling parameters (for plotting dimesional quantity) sc.p = 36; % [Pa] sc.p = 1; % to plot as dimensionless %% Functions B = @(theta) ap-(ap-am)/2*(1+tanh(c1+c2*theta)); Theta = @(a,p) q/nu*(1-a)-1/nu+lambda*p; dadt = @(a,p) B(Theta(a,p)) - a; dpdt = @(a,p) alpha*(1-w*p.^mu.*exp(Theta(a,p))); dydt = @(t,y) [ dadt(y(1),y(2)) ; dpdt(y(1),y(2)) ]; % y = [a,p] %% Nullclines a = linspace(am,ap,100+2); a = a(2:end-1); p = NaN*a; for i = 1:length(a) p(i) = fzero(@(x) dadt(a(i),x),[-1e3 1e3]); % root-finding for each a along a nullcline end a1 = a; p1 = p; p = NaN*a; for i = 1:length(a) p(i) = fzero(@(x) dpdt(a(i),x),[0 1e3]); % root-finding for each a along p nullcline end a2 = a; p2 = p; %% Plot phase plane with nullclines and setup axes for solutions figure(1); clf; width = 2; fontsize = 14; set(gcf,'DefaultAxesFontSize',fontsize,'DefaultTextFontSize',fontsize) ; % set(gcf,'units','centimeters','Paperpositionmode','auto','position',[2 2 20 10]); ax(1) = axes('position',[0.1 0.2 0.35 0.75]); plot(sc.p*p1,a1,'k-',sc.p*p2,a2,'b-','linewidth',width); % nullclines xlabel('$p / [p]$','interpreter','latex'); ylabel('$a$','interpreter','latex');
4.
ylim([am,ap]); xlim([0 2*sc.p]); hold on; ax(2)
= axes('position',[0.6 0.6 0.35 0.35]); hold on; box on; set(gca,'XTickLabel',{}); ylabel('$a$','interpreter','latex'); ax(3) = axes('position',[0.6 0.2 0.35 0.35]); hold on; box on; xlabel('$t / [t]$','interpreter','latex'); ylabel('$p / [p]$','interpreter','latex'); %% Solve trajectories and add to figures n_trajectories = 1; length_trajectory = 10/alpha; for n = 1:n_trajectories p0 = 2*rand; a0 = am+(ap-am)*rand; % random starting point % [p0,a0] = ginput(1); p0 = p0/sc.p; % graphical input for trajectory starting point (click on phase plane) opts = odeset('reltol',1e-6); [t,y] = ode45(dydt,[0 length_trajectory],[a0,p0],opts); % use ode45 to solve equations a = y(:,1); p = y(:,2); axes(ax(1)); plot(sc.p*p,a,'r-',sc.p*p(1),a(1),'ro','linewidth',width); axes(ax(2)); plot(t,a,'r-','linewidth',width); axes(ax(3)); plot(t,sc.p*p,'r-','linewidth',width); end % %% Save figure % axes(ax(1)); text(0.95,0.95,['$alpha = $',num2str(alpha)],'units','normalized','horizontalalignment','right', 'verticalalignment','top','interpreter','latex'); % print(gcf,'-depsc2',[mfilename,'_alpha',num2str(alpha),'.eps'],'- loose'); end
5.
% greenhouse factor
gamma for varying tau_s when T = T_s (tau/tau_s)^(R/M_a/c_p) % IJH 22 Sept 2018 clear; %% Parameters M_a = 29e-3; %kg/mol R = 8.3; %J/K/mol g = 9.8; %m/s^2 c_p = 10^3; %J/kg/K %% Calculate gamma(tau_s) z = linspace(0,1,101); % pts to discretise integral tau_ss = linspace(0,10,101); % values of tau_s gammas = NaN*tau_ss; for j = 1:length(tau_ss) tau_s = tau_ss(j); gammas(j) = exp(-2*tau_s) + tau_s*trapz(z,2*z.^(4*R/M_a/c_p).*exp(-2*tau_s*z)); % calculate integral expression for gamma using trapezium rule end %% Plot gamma(tau_s) figure(1); clf; set(gcf,'Paperpositionmode','auto','units','centimeters','position',[2 4 12 8]); set(gcf,'DefaultAxesFontSize',12,'DefaultTextFontSize',12); plot(tau_ss,gammas,'b-','linewidth',2); ylim([0 1]); hold on; plot(tau_ss,1-2*tau_ss*4*R/(4*R+M_a*c_p),'r--'); % small tau_s approx plot(tau_ss,(2*tau_ss).^(-4*R/M_a/c_p).*gamma(1+4*R/M_a/c_p),'r-- '); % large tau_s approx xlabel('Optical thickness $tau_s$','interpreter','latex'); ylabel('Greenhouse factor $gamma$','interpreter','latex'); %% Save figure % print(gcf,'-depsc2',mfilename,'-loose');
6.
% mountain glacier
model % IJH 18 October 2020 clear; set(0,'DefaultTextInterpreter','latex'); set(0,'DefaultTextFontSize',12); set(0,'DefaultAxesFontSize',12); fn = mfilename; % dimensionless parameters pp.n = 3; % flow-law exponent pp.a_fun = @(x) 1-x; % net accumulation funtion pp.dt = 1e-2; % timestep % steady state x_st = linspace(0,2,101)'; H_st = ((pp.n+2)*x_st.*(1-x_st/2)).^(1/(pp.n+2)); % initial condition t = 0; l = 1; % sigma = l*10.^(linspace(-6,0,101))'; % exponential spacing n = 400; dx0 = 1e-7; r = fzero(@(r) 1/dx0-(r.^(n+1)-1)/(r-1),1.1); sigma = l*[cumsum(dx0*r.^(0:n)')]; % geometric spacing % sigma = [0.1*sigma(1:end-1); linspace(0.1,1,201)']; % geometric spacing + constant spacing x = sigma; H = max(0,(pp.n+2)*x.*(l/2-x/2)).^(1/(pp.n+2)); x2 = linspace(-4,0,401)'; % ghost characteristics in x<0 H2 = 0*x2.^0; x = [x2; x]; H = [H2; H]; s = zeros(size(x)); % solve characteristic equations ts = t; xs = x; Hs = H; ss = s; i1 = 1:length(x); % indices of characeteristics i2 = []; % indices of shocks while t+pp.dt<3 i2 = find(s); % indices of shocks i3 = find(isnan(x)); % indices of terminated characteristics i4 = find(x<0); % indices of 'ghost' characteristics i1 = setdiff(1:length(x),union(i2,[i3;i4])); % indices of characeteristics a = pp.a_fun(x).*(x>=0); % accumulation rate H(i1) = H(i1) + pp.dt*a(i1); % advance H along characteristics H(i2) = H(i2) + pp.dt*a(i2); % advance H along shock H(H<=0) = 0; % cap H = 0 x(i1) = x(i1) + pp.dt*H(i1).^(pp.n+1); % advance characteristics x(i2) = x(i2) + pp.dt*(H(i2).^(pp.n+1)-H(s(i2)).^(pp.n+1))/(pp.n+2); % advance shocks x(i4) = min(x(i4)+pp.dt*1,0); % advance 'ghost' charatacteristics at speed 1 in x<0 t = t + pp.dt; % advance time ii = union(i1,i2); % indices of characteristics and shocks tmps = find(x(ii(1:end-1))>x(ii(2:end))); % locate intersections % label downstream characteristics of shocks if ~isempty(tmps) for tmp = flip(tmps') if s(ii(tmp+1))>0 s(ii(tmp)) = s(ii(tmp+1)); % if crashed into a shock, take over that shock else
7.
s(ii(tmp)) = ii(tmp+1);
% if crashed into a characteristic, that becomes downstream characteristic end x(ii(tmp+1)) = NaN; % terminated characteristics s(ii(tmp+1)) = 0; end end ts = [ts t]; xs = [xs x]; Hs = [Hs H]; ss = [ss s]; end % blank out various entries xs(xs<=0) = NaN; xs(Hs<=0) = NaN; Hs(Hs<=0) = NaN; ss(ss<=0) = NaN; % plot solutions figure(1); clf; set(gcf,'Paperpositionmode','auto','Units','centimeters','Position',[2 4 20 8]); width = 1; ax(1) = subplot(1,2,1); xpts = 1:10:size(xs,1); plot(xs(xpts,:)',ts(:)','k-','linewidth',width); % characteristics curves hold on; plot(xs'.*ss'.^0,ts(:)','r.'); % shocks xlabel('$x$') ylabel('$t$'); xlim([0 3]); box off; ax(2) = subplot(1,2,2); xpts = 1:10:size(xs,1); plot3(xs(xpts,:)',ts(:)',0*Hs(xpts,:)','-','color',0.8*[1 1 1],'linewidth',width); % characteristics curves hold on; plot3(xs'.*ss'.^0,ts(:)',0*Hs','r.'); % shocks tpts = 1:20:size(ts,2); hold on; plot3(xs(:,tpts),ones(length(x),1)*ts(tpts),Hs(:,tpts),'b- ','linewidth',width); % solution through time xlabel('$x$') ylabel('$t$'); zlabel('$H$'); xlim([0 3]); ylim([0 3]); ax(2).Position = ax(2).Position + [0 0.05 0 0]; % axes(ax(2)); view(10,40); print(gcf,'-depsc2',[fn]); % axes(ax(2)); view(10,40); print(gcf,'-depsc2',[fn,'_fig1']); % l = 3; % axes(ax(2)); view(10,40); print(gcf,'-depsc2',[fn,'_fig2']); % l = 1;
8.
function sea_ice() % solves
sea ice model % dH/dt = - Fo - Q/(1+H) Q<=0 % - Fo - Q Q>0 % for H>=0, OR H = 0 % uses a single ODE for both cases H>=0 and H<0. Numerical errors % causes H to go slightly below 0; dHdt is then set to zero until it % becomes positive allowing ice to start to grow again %% Parameters Fo = 0; Q0 = 0; omega = 2*pi*.1; Q = @(t) Q0 + cos(omega*t); %% Solve ODE opts = odeset('reltol',1e-8); [t,H] = ode45(@dHdt_fun,[0 2*2*pi/omega],0,opts); % ODE function dHdt = dHdt_fun(t,H) dHdt = ( -Fo-Q(t)./(1+H) ).*( Q(t)<=0 ).*( H>=0 ) + ... ( -Fo-Q(t) ).*( Q(t)>0 ).*( H>=0 ) + ... max(0,-Fo-Q(t)./(1+H)).*( H<0 ); end %% Plot solution figure(1); clf; width = 2; fontsize = 14; set(gcf,'DefaultAxesFontSize',fontsize,'DefaultTextFontSize',fontsize) ; set(gcf,'units','centimeters','Paperpositionmode','auto','position',[2 2 20 10]); plot(omega/2/pi*t,H,'linewidth',width); % hold on; plot(omega/2/pi*t,dHdt_fun(t,H)); % derivative hold on; plot(omega/2/pi*t,max(0,-1-Q(t)/Fo),'r--'); % quasi- steady approximation (small omega) xlabel('$omega t / 2pi$','interpreter','latex'); ylabel('$H / [H]$','interpreter','latex'); % %% Save figure % text(0.02,0.95,['$omega/2pi = $',num2str(omega/2/pi)],'interpreter','latex','units','normalized','ho rizontalalignment','left','verticalalignment','top'); % print(gcf,'- depsc2',[mfilename,'_omega',num2str(omega/2/pi),'.eps'],'-loose'); end
Download now