Model block-spring

Description

A qualitative model of the block-spring system.

Source: PROLOG programming for artificial intelligence, 3rd Edition, Harlow, 2001, ISBN 0-201-40375-7.

Download

Program source code: model_block-spring.pl

Listing

% Figure 20.14  A qualitative model of the block-spring system.
 
 
% Model of block on spring
 
landmarks( x, [ minf, zero, inf]).        % Position of block
landmarks( v, [ minf, zero, v0, inf]).    % Velocity of block
landmarks( a, [ minf, zero, inf]).        % Acceleration of block
 
correspond( x:zero, a:zero).
 
legalstate( [ X, V, A])  :-
  deriv( X, V),
  deriv( V, A),
  MinusA = a:_,
  sum( A, MinusA, a:zero/std),    % MinusA = -A
  mplus( X, MinusA).              % Spring pulling mass back
 
initial( [ x:zero/inc, v:v0/std, a:zero/dec]).

Comments

pl/prolog/pllib/model_block-spring.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0