اطلاعیه

Collapse
No announcement yet.

خطا در کد مدل سازی

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    خطا در کد مدل سازی

    سلام کسی میتونه خطای این کد رو بگیره:
    ممنون
    کد:
    % Model of memristor in MATLAB enviroment
    %----------------------------------------
    function Memristor_Matlab
    Ron=100; Roff=16*(10^3);
    Rinit=11*(10^3); DR=Roff-Ron;
    tmin=0; tmax=3;% time interval
    N=500; % number of steps is N+1
    OsaT=tmin:(tmax-tmin)/N:tmax; % time axis
    x0=(Roff-Rinit)/DR; %initial condition
    
    [t,x]=ode23t(@ODE_Memri_A,OsaT,x0);% calling ODE
    
    V=1*sin(2*pi*1*t); % input voltage
    I=V./(Roff-x*DR); % current
    
    %---- drawing the results---
    figure(1);
    plot(V,I);
    title('I-V curve');
    xlabel('V[volt]');
    ylabel('I[amp]');
    
    figure(2);
    plot(Flux,Charge);
    title('Flux-Charge curve');
    xlabel('Flux');
    ylabel('Charge');
    
    %----intagration of U and I ---
    Flux=(t(2)-t(1))*filter(1,[1 -1],V);
    charge=(t(2)-t(1))*filter(1,[1 -1],I);
    
    %----ODE definition---
    function dx=ODE_Memri_A(t,x)
    D=10e-9;
    Ron=100;
    Roff=16e3;
    DR=Roff-Ron;
    uv=1e-14; %dopant mobility
    k=(uv*Ron)/(D^2);
    p=10;
    %%% ODE definition
    V=sin(2*pi*t); % input voltage
    Fx=(1-(2*x-1)^(2*p));
    dx=K*(V/(Roff-x*DR))*FX;

    کد:
    Error in ==> ode23t at 221
    [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn,
    ...
    
    Error in ==> Memristor_Matlab at 11
    [t,x]=ode23t(@ODE_Memri_A,OsaT,x0);% calling ODE
    انما الحیوة عقیدة و جهاد

    #2
    پاسخ : خطا در کد ممریستور

    :NO:
    کسی نیست به داد ما برسه از اساتید متلب
    انما الحیوة عقیدة و جهاد

    دیدگاه


      #3
      پاسخ : خطا در کد مدل سازی

      سلام
      کمی مشکل داشت برطرفشون کردم
      موفق باشید...
      کد:
      function Memristor_Matlab
      clc
      clear all
      Ron=100; Roff=16*(10^3);
      Rinit=11*(10^3); DR=Roff-Ron;
      tmin=0; tmax=3;% time interval
      N=500; % number of steps is N+1
      OsaT=tmin:(tmax-tmin)/N:tmax; % time axis
      x0=(Roff-Rinit)/DR; %initial condition
      
      [t,x]=ode23t(@ODE_Memri_A,OsaT,x0);% calling ODE
      
      V=1*sin(2*pi*1*t); % input voltage
      I=V./(Roff-x*DR); % current
      
      %---- drawing the results---
      figure(1);
      plot(V,I);
      title('I-V curve');
      xlabel('V[volt]');
      ylabel('I[amp]');
      
      %----intagration of U and I ---
      Flux=(t(2)-t(1))*filter(1,[1 -1],V);
      charge=(t(2)-t(1))*filter(1,[1 -1],I);
      
      figure(2);
      plot(Flux,charge);
      title('Flux-Charge curve');
      xlabel('Flux');
      ylabel('Charge');
      
      
      end
      %----ODE definition---
      function dx=ODE_Memri_A(t,x)
      D=10e-9;
      Ron=100;
      Roff=16e3;
      DR=Roff-Ron;
      uv=1e-14; %dopant mobility
      K=(uv*Ron)/(D^2);
      p=10;
      %%% ODE definition
      V=sin(2*pi*t); % input voltage
      FX=(1-(2*x-1)^(2*p));
      dx=K*(V/(Roff-x*DR))*FX;
      end
      :read:
      قنديل، تنديس قطره هايي است كه تسليم جاذبه زمين نشدند. "چگوآرا"

      دیدگاه

      لطفا صبر کنید...
      X