Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: about simulink integrator block error
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
lady firmament

Posts: 14
Registered: 10/17/12
about simulink integrator block error
Posted: Oct 17, 2012 11:45 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

The first error : Derivative input 1 of 'm_LuGre_h_simpleblock/LuGre model2/Subsystem/Subsystem2/Integrator1' at time 3.155443620884047e-030 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances).
And another error is_
Index expression out of bounds. Attempted to access element 3. The valid range is 1-1.

Function 'LuGre model2/Subsystem/Subsystem2/oil_film_thickness_h' (#25.148.149), line 7, column 10:
"3"
Launch diagnostic report.
1
fcn
7
Index expression out of bounds. Attempted to access element 3. The valid range is 1-1.
2
fcn
15
Index expression out of bounds. Attempted to access element 2. The valid range is 1-1.
3
fcn
15
Undefined function or variable 'y'. The first assignment to a local variable determines its class
This error is in embedded matlab function before entering the integrator block , actually i need to use the result of the outlet of integrator block as input to embedded matlab function.
1 function y = fcn(u)
2 v=abs(u(1));
3 K_dec_p=1/0.25; %=1/to_hp
4 K_dec_n=1/1; %=1/to_hn
5 K_rest=1/40; %=1/to_ho
6 if v>1e-3;
7 if(u(3)<=u(2))
8 T=K_dec_p;
9 else
10 T=K_dec_n;
11 end
12else
13 T=K_rest
14end
15y=T*(u(2)-u(3))



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.