Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/How to find the steady state using events function for pde?

How to find the steady state using events function for pde?

PuTI / 2025-02-23
How to find the steady state using events function for pde?
Matlab News

Hi,
I am solving coupled reaction diffusion PDEs of the form:

I am using the ‘pdepe’ function to solve them. I have become aware that there is an ‘events’ functionality embedded into the ‘pdepe’ solver that allows the user to trigger an event when a certain event occurs. This is because the pdepe solver uses the ODE15s solver for dynamic time integration. I would like to use this functionality to find when the ‘steady state’ event occurs. I believe there are limited examples when using this functionality for PDEs.

I am using the following code to call ‘pdepe’ in the function file:
optns = odeset(‘Events’,@ssEvent);
[sol1,tsol,sole,te,ie] = pdepe(m, @(x, t, c, DcDx)PDE_PSw_EK(x, t, c, DcDx, alpha,…
kappa, eta, gamma, mu),IC, BC, chi, t, optns);
I then resolved the ‘sol1’ into following components.
% Concentration Profiles c(i, j, k)(Solutions)
c1 = sol1(:, :, 1); % Substrate Conc.
c2 = sol1(:, :, 2); % Mox Conc.
Standard syntax for PDEs for event function is as:
function [value,isterminal,direction] = pdevents(m,t,xmesh,umesh)
value = umesh;
isterminal = zeros(size(umesh));
direction = zeros(size(umesh));
end
One of my questions is, is the ‘umesh’ the same as ‘sol1’?
Do I have to provide a matrix to ‘isterminal’ to inform the function to terminate or just a single value is enough? Same for direction.
Currently I am using the following script to try to find the steady state. But it is not working very well so I am here.
function [value, isterminal, direction] = ssEvent(m, t, xmesh, umesh)

% Compute the absolute difference between successive time steps
diff_solution = abs(diff(umesh, 1, 2)); % Max change in solution across time

% Define steady-state condition (threshold for change)
steady_threshold = 1e-4;

% Event occurs when the maximum solution change is below the threshold
value = diff_solution – steady_threshold;

isterminal = 0; % Stop integration when steady state is reached
direction = 0; % Detects steady state in both increasing & decreasing directions

end
Eventual goal is to make a graph like this. Where I want to extract the time against the event and plot it against the gamma. This graph was made using another method though.

Also I would appreciate if respected members can give some pointers on how to rid of numerical oscillations while computing errors.Hi,
I am solving coupled reaction diffusion PDEs of the form:

I am using the ‘pdepe’ function to solve them. I have become aware that there is an ‘events’ functionality embedded into the ‘pdepe’ solver that allows the user to trigger an event when a certain event occurs. This is because the pdepe solver uses the ODE15s solver for dynamic time integration. I would like to use this functionality to find when the ‘steady state’ event occurs. I believe there are limited examples when using this functionality for PDEs.

I am using the following code to call ‘pdepe’ in the function file:
optns = odeset(‘Events’,@ssEvent);
[sol1,tsol,sole,te,ie] = pdepe(m, @(x, t, c, DcDx)PDE_PSw_EK(x, t, c, DcDx, alpha,…
kappa, eta, gamma, mu),IC, BC, chi, t, optns);
I then resolved the ‘sol1’ into following components.
% Concentration Profiles c(i, j, k)(Solutions)
c1 = sol1(:, :, 1); % Substrate Conc.
c2 = sol1(:, :, 2); % Mox Conc.
Standard syntax for PDEs for event function is as:
function [value,isterminal,direction] = pdevents(m,t,xmesh,umesh)
value = umesh;
isterminal = zeros(size(umesh));
direction = zeros(size(umesh));
end
One of my questions is, is the ‘umesh’ the same as ‘sol1’?
Do I have to provide a matrix to ‘isterminal’ to inform the function to terminate or just a single value is enough? Same for direction.
Currently I am using the following script to try to find the steady state. But it is not working very well so I am here.
function [value, isterminal, direction] = ssEvent(m, t, xmesh, umesh)

% Compute the absolute difference between successive time steps
diff_solution = abs(diff(umesh, 1, 2)); % Max change in solution across time

% Define steady-state condition (threshold for change)
steady_threshold = 1e-4;

% Event occurs when the maximum solution change is below the threshold
value = diff_solution – steady_threshold;

isterminal = 0; % Stop integration when steady state is reached
direction = 0; % Detects steady state in both increasing & decreasing directions

end
Eventual goal is to make a graph like this. Where I want to extract the time against the event and plot it against the gamma. This graph was made using another method though.

Also I would appreciate if respected members can give some pointers on how to rid of numerical oscillations while computing errors. Hi,
I am solving coupled reaction diffusion PDEs of the form:

I am using the ‘pdepe’ function to solve them. I have become aware that there is an ‘events’ functionality embedded into the ‘pdepe’ solver that allows the user to trigger an event when a certain event occurs. This is because the pdepe solver uses the ODE15s solver for dynamic time integration. I would like to use this functionality to find when the ‘steady state’ event occurs. I believe there are limited examples when using this functionality for PDEs.

I am using the following code to call ‘pdepe’ in the function file:
optns = odeset(‘Events’,@ssEvent);
[sol1,tsol,sole,te,ie] = pdepe(m, @(x, t, c, DcDx)PDE_PSw_EK(x, t, c, DcDx, alpha,…
kappa, eta, gamma, mu),IC, BC, chi, t, optns);
I then resolved the ‘sol1’ into following components.
% Concentration Profiles c(i, j, k)(Solutions)
c1 = sol1(:, :, 1); % Substrate Conc.
c2 = sol1(:, :, 2); % Mox Conc.
Standard syntax for PDEs for event function is as:
function [value,isterminal,direction] = pdevents(m,t,xmesh,umesh)
value = umesh;
isterminal = zeros(size(umesh));
direction = zeros(size(umesh));
end
One of my questions is, is the ‘umesh’ the same as ‘sol1’?
Do I have to provide a matrix to ‘isterminal’ to inform the function to terminate or just a single value is enough? Same for direction.
Currently I am using the following script to try to find the steady state. But it is not working very well so I am here.
function [value, isterminal, direction] = ssEvent(m, t, xmesh, umesh)

% Compute the absolute difference between successive time steps
diff_solution = abs(diff(umesh, 1, 2)); % Max change in solution across time

% Define steady-state condition (threshold for change)
steady_threshold = 1e-4;

% Event occurs when the maximum solution change is below the threshold
value = diff_solution – steady_threshold;

isterminal = 0; % Stop integration when steady state is reached
direction = 0; % Detects steady state in both increasing & decreasing directions

end
Eventual goal is to make a graph like this. Where I want to extract the time against the event and plot it against the gamma. This graph was made using another method though.

Also I would appreciate if respected members can give some pointers on how to rid of numerical oscillations while computing errors. pdepe, ode15s MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

Optimal decimation to Log Simulation Data
2025-05-18

Optimal decimation to Log Simulation Data

I need to use a scope to display the current i and the power P as functions of the voltage V, with the curves obtained for various irradiance levels and temperatures
2025-05-18

I need to use a scope to display the current i and the power P as functions of the voltage V, with the curves obtained for various irradiance levels and temperatures

Break in and break away points on Root Locus
2025-05-18

Break in and break away points on Root Locus

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss