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: code operating speed is very slow
Replies: 1   Last Post: May 13, 2010 8:07 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Wenxu Li

Posts: 11
Registered: 5/13/10
code operating speed is very slow
Posted: May 13, 2010 4:05 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I try to simulate a one DoF mass-spring system,the code is as follows:
%M02, solution

function y=friction_force(t,x)

My question is when I use y(2)=Frictionforce*sign(x(2))/m-k/m*x(1), i.e. without minus
before Frictionforce, the code operates very quickly, while I add a minus, it is very slow, more than half an hour to get the results. Can anybody tell what is the matter?

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

[Privacy Policy] [Terms of Use]

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