Model block-spring


A qualitative model of the block-spring system.

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


Program source code:


% 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]).


pl/prolog/pllib/model_block-spring.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna) Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0