The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.