Demo entry 6625716

octave

   

Submitted by anonymous on Jun 21, 2017 at 20:19
Language: Octave. Code size: 212 Bytes.

%特征根
lambda = roots([0.5, 0.75, -0.75]);
%边值条件
z = [-5; 5];
Phi = normcdf(z, 0, 1);
%任意常数
C = exp(z * lambda') \ Phi;
%解析解
vExact = C' * exp(lambda * linspace(z(1), z(2)));
v0Exact = C' * exp(lambda * 0)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).