Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can't run my main Matlab file related to ODE solution

  1. Mar 10, 2013 #1
    Hey, guys

    Can you please help me to spot mistakes in numerical solution of following diffusivty equation:

    ∂P/∂t= 0.001127*k/(μ*ϕ*c_t )*((∂P/∂x)^2*c+(∂^2 P)/(∂x^2 )).

    Matlab give the following command:

    Undefined function or variable 'r'.

    Error in function_handle2 (line 9)
    for i=1:r

    Error in odearguments (line 88)
    f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

    Error in ode15s (line 149)
    [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

    Error in Diffusivity_equation (line 41)

    I don't know how to interpret the last command. M files containing relevant commands are attached.

    Attached Files:

  2. jcsd
  3. Mar 14, 2013 #2


    User Avatar

    Staff: Mentor

    I get an error on line 10 of function_handle2. When I comment it out, I get an error because dss004 is undefined.
  4. Mar 14, 2013 #3
    Hey, mate

    You can download dss004 m file from the following link:

    I couldn't upload the dss004 file, so decided to redirect you to my previous post where I have already atttached dss004.
  5. Mar 14, 2013 #4
    Guys, I need to solve by Matlab the following PDE:

    I am desperate about finding solution; I have tried many approaches, and the files attached on topic start is my last approach.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook