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: Using piecewise-constant functions in ode Simulink
Replies: 1   Last Post: Feb 23, 2013 11:58 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Phil Goddard

Posts: 349
Registered: 1/27/12
Re: Using piecewise-constant functions in ode Simulink
Posted: Feb 23, 2013 11:58 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


> I want to integrate the multiplication of a cosine with a
> piecewise-constant function (e.g. 1 from 0 to 1/1000, -1 from 1/1000 to
> 2/1000, ...)


Why don't you use a square wave that changes from 1 to -1 and back every thousandths of a second?

> y at t=3/1000 should be 8.00487e-4 if I solve analytically but Simulink
> has 8.29766161000261e-4 :( :(


That's not really a meaningful comparison.
Simulink is, by its nature, an approximation, and its accuracy depends not just on the problem, but also the solver and the solver parameters being used.

Phil.



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.