Troubleshooting PDEs in MATLAB: Why is My Function Not Affecting the Plot?

Click For Summary

Discussion Overview

The discussion revolves around troubleshooting issues related to solving partial differential equations (PDEs) in MATLAB, specifically focusing on why changes to a function do not affect the resulting plot. The scope includes technical explanations and practical troubleshooting steps.

Discussion Character

  • Technical explanation, Debate/contested, Meta-discussion

Main Points Raised

  • One participant describes their experience with a MATLAB function for solving PDEs, noting that modifications to the function do not change the output plot.
  • Another participant suggests that MATLAB may save compiled versions of functions, which could prevent recompilation unless the function is altered in a way that MATLAB recognizes.
  • A later reply asks for guidance on how to locate and remove compiled files to ensure MATLAB recompiles the function.
  • Another participant provides vague recollections about finding compiled files in the same directory as the .m file, indicating they have a different extension.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the exact cause of the issue, but there is a shared understanding that compiled files may be involved in the problem. Multiple approaches to troubleshooting are discussed without resolution.

Contextual Notes

There are limitations regarding the specifics of file extensions for compiled files and the exact nature of the recompilation process in MATLAB, which remain unresolved.

Who May Find This Useful

Users troubleshooting PDEs in MATLAB, particularly those encountering issues with function recompilation and output changes.

member 428835
Hi PF!

I am trying to solve a pde in MATLAB and started by using the generic code mathwork supplies and then augmenting for my purpose. After defining the function below and run the script, i can do anything to the ##f## and nothing changes. I can literally delete the line and still I receive the same plot. Any idea why?
Code:
function [c,f,s] = pdex1pde(x,t,u,DuDx)
c = 1;
f = DuDx;%pdedu/dx
s = u;
 
Physics news on Phys.org
Sometimes when MATLAB compiles a function, it saves the compilation and will not recompile unless it knows the function has changed. Sometimes this goes wrong. I have had to remove compiled files from the directory to force MATLAB to recompile a new version. I forget what extension the compiled file had. I remember that I had a lot of problems when the files were on a network drive. Sometimes modification dates on network drive files do not get updated correctly to indicate a change.
 
Do you know how to remove or where to look to remove compiled files from the directory to force MATLAB to recompile a new version?

Thanks for taking interest to this!
 
My memory is vague on this. Look in the same directory with your .m file that defines the function. It will have the same function name but will have a different extension.
 
  • Like
Likes   Reactions: member 428835
Thanks a ton!
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 41 ·
2
Replies
41
Views
10K
  • · Replies 1 ·
Replies
1
Views
3K