Commit 1d3f5e37 authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

Changed constructor of quantity.Domain to use obligatory arguments

parent 97d997c1
......@@ -250,7 +250,7 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
deltaCOD = diff(d);
assert(misc.alln(deltaCOD >= 0), 'The domain for the composition f(g(.)) must be monotonically increasing');
d = quantity.Domain('grid', d, 'name', domainName);
d = quantity.Domain(domainName, d);
end
function obj_hat = compose(obj, g, optionalArgs)
......@@ -373,7 +373,7 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
end
for k = 1:length(newGrid)
myDomain(k) = quantity.Domain('grid', newGrid{k}, 'name', gridNames{k});
myDomain(k) = quantity.Domain(gridNames{k}, newGrid{k});
end
end
elseif nargin == 3
......@@ -391,7 +391,7 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
newGrid = myDomain;
myDomain = quantity.Domain.empty();
for k = 1:length(newGrid)
myDomain(k) = quantity.Domain('grid', newGrid{k}, 'name', gridNames{k});
myDomain(k) = quantity.Domain(gridNames{k}, newGrid{k});
end
else
myDomain = obj(1).domain;
......@@ -1297,19 +1297,22 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
end
if obj(1).isConstant
newDomain(1:length( gridNew )) = quantity.Domain();
for i = 1 : length(gridNew)
newDomain(i) = quantity.Domain(...
'grid', gridNew{i}, 'name', gridNameNew{i});
newDomain(i) = ...
quantity.Domain(gridNameNew{i}, gridNew{i});
end
else
[gridIndexNew, logIdx] = obj(1).domain.gridIndex(gridNameNew);
gridIndexNew = obj(1).domain.gridIndex(gridNameNew);
newDomain = obj(1).domain;
for i = 1 : length(gridIndexNew)
newDomain(gridIndexNew(i)) = quantity.Domain(...
'grid', gridNew{i}, 'name', gridNameNew{i});
newDomain(gridIndexNew(i)) = ...
quantity.Domain(gridNameNew{i}, gridNew{i});
end
assert(isequal({newDomain.name}, obj(1).gridName), 'rearranging grids failed');
assert(isequal({newDomain.name}, obj(1).gridName), ...
'rearranging grids failed');
end
......@@ -1394,8 +1397,8 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
assert(numel(myGrid) > 1, 'If the state transition matrix is computed for constant values, a spatial domain has to be defined!')
myDomain = [quantity.Domain('grid', myGrid, 'name', gridName1), ...
quantity.Domain('grid', myGrid, 'name', gridName2)];
myDomain = [quantity.Domain(gridName1, myGrid), ...
quantity.Domain(gridName2, myGrid)];
if obj.isConstant
% for a constant system matrix, the matrix exponential
......@@ -1952,8 +1955,8 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
if all(isGrid)
newDomain = quantity.Domain();
else
newDomain = quantity.Domain('grid', obj(kObj).grid{~isGrid}, ...
'name', obj(kObj).gridName{~isGrid});
newDomain = quantity.Domain(obj(kObj).gridName{~isGrid}, ...
obj(kObj).grid{~isGrid});
end
[I.domain] = deal(newDomain);
......
......@@ -5,12 +5,13 @@ classdef Domain < handle & matlab.mixin.CustomDisplay
% * EquidistantDomain
% * multi dimensional
properties
properties (SetAccess = protected)
% The discrete points of the grid for the evaluation of a
% continuous quantity. For an example, the function f(x) should be
% considered on the domain x \in X = [0, 1]. Then, a grid can be
% generated by X_grid = linspace(0, 1).
grid double {mustBeReal};
grid double {mustBeReal, mustBeFinite, mustBe.ascending};
% TODO add mustBeVector
% a speaking name for this domain; Should be unique, so that the
% domain can be identified by the name.
......@@ -28,21 +29,12 @@ classdef Domain < handle & matlab.mixin.CustomDisplay
end
methods
function obj = Domain(varargin)
function obj = Domain(name, grid)
%DOMAIN initialize the domain
%
if nargin >= 1
myParser = misc.Parser();
myParser.addParameter('grid', [], @(g) isvector(g) || isempty(g));
myParser.addParameter('name', '', @ischar);
myParser.parse(varargin{:});
% todo: assertions
% * ascending ?
obj.grid = myParser.Results.grid(:);
obj.name = myParser.Results.name;
myParser.unmatchedWarning();
obj.grid = grid(:);
obj.name = name;
end
end
......@@ -285,9 +277,9 @@ classdef Domain < handle & matlab.mixin.CustomDisplay
myGrids = {obj.grid};
myGrids = myGrids(I);
newObj(1:length(myGrids)) = quantity.Domain();
for k = 1:length(myGrids)
newObj(k) = quantity.Domain('grid', myGrids{k}, ...
'name', sortedNames{k}); %#ok<AGROW>
newObj(k) = quantity.Domain(sortedNames{k}, myGrids{k});
end
else
newObj = obj;
......@@ -339,7 +331,7 @@ classdef Domain < handle & matlab.mixin.CustomDisplay
d = quantity.Domain.empty();
for k = 1:length(grids)
d = [d quantity.Domain('grid', grids{k}, 'name', gridNames{k})];
d = [d quantity.Domain(gridNames{k}, grids{k})];
end
end
......@@ -363,11 +355,11 @@ classdef Domain < handle & matlab.mixin.CustomDisplay
O = ones(o);
O(:) = linspace(0, 1, gridSize(k));
g(k) = quantity.Domain('grid', O, 'name', name{k});
g(k) = quantity.Domain(name{k}, O);
end
end
function [myDomain, unmatched]= parser(varargin)
function [myDomain, unmatched] = parser(varargin)
%% domain parser
domainParser = misc.Parser();
domainParser.addParameter('domain', {}, @(g) isa(g, 'quantity.Domain'));
......@@ -394,8 +386,7 @@ classdef Domain < handle & matlab.mixin.CustomDisplay
% initialize the domain objects
myDomain = quantity.Domain.empty();
for k = 1:numel(myGrid)
myDomain(k) = quantity.Domain('grid', myGrid{k}, ...
'name', myGridName{k});
myDomain(k) = quantity.Domain(myGridName{k}, myGrid{k});
end
else
% else case: the domains are specified as domain
......
......@@ -6,7 +6,7 @@ end
function testCompose(testCase)
t = quantity.Domain('grid', linspace(0, 2), 'name', 't');
t = quantity.Domain('t', linspace(0, 2));
f = quantity.Discrete(sin(t.grid * 2 * pi) , 'domain', t, 'name', 'f' );
g = quantity.Discrete( 0.5 * t.grid, 'domain', t, 'name', 'g');
h = quantity.Discrete( 2 * t.grid, 'domain', t, 'name', 'h');
......@@ -19,8 +19,8 @@ testCase.verifyWarning(@()f.compose(h), 'quantity:Discrete:compose')
% verify f(tau) = sin( tau * 2pi ); g(z, t) = t + z^2
% f( g(z, t ) ) = sin( (t + z^2 ) * 2pi )
tau = quantity.Domain('grid', linspace(-1, 3), 'name', 'tau' );
z = quantity.Domain('grid', linspace(0, 1, 51), 'name', 'z');
tau = quantity.Domain('tau', linspace(-1, 3));
z = quantity.Domain('z', linspace(0, 1, 51));
f = quantity.Discrete( sin( tau.grid * 2 * pi ), 'domain', tau );
g = quantity.Discrete( ( z.grid.^2 ) + t.grid', 'domain', [z, t] );
......@@ -35,9 +35,9 @@ testCase.verifyEqual(fg.on, F.on, 'AbsTol', 1e-2)
% g(z, t) = z + t
% f(z, g(z,t) ) = 2*z + t
z = quantity.Domain('grid', linspace(0, 1, 11), 'name', 'z');
t = quantity.Domain('grid', linspace(0, 1, 21), 'name', 't');
tau = quantity.Domain('grid', linspace(0, 2, 31), 'name', 'tau');
z = quantity.Domain('z', linspace(0, 1, 11));
t = quantity.Domain('t', linspace(0, 1, 21));
tau = quantity.Domain('tau', linspace(0, 2, 31));
f = quantity.Discrete( z.grid + tau.grid', 'domain', [z, tau]);
g = quantity.Discrete( z.grid + t.grid', 'domain', [z, t]);
......@@ -71,8 +71,8 @@ end % testQuadraticNorm()
function testSort(tc)
t = linspace(0, pi, 7)';
domA = quantity.Domain('grid', t, 'name', 'a');
domB = quantity.Domain('grid', t, 'name', 'b');
domA = quantity.Domain('a', t);
domB = quantity.Domain('b', t);
q = quantity.Discrete(sin(t) .* cos(t'), ...
'domain', [domA, domB]);
......@@ -91,8 +91,8 @@ function testBlkdiag(tc)
% init some data
syms z zeta
z = quantity.Domain('grid', linspace(0, 1, 21), 'name', 'z');
zeta = quantity.Domain('grid', linspace(0, 1, 41), 'name', 'zeta');
z = quantity.Domain('z', linspace(0, 1, 21));
zeta = quantity.Domain('zeta', linspace(0, 1, 41));
A = quantity.Discrete(cat(4, ...
cat(3, 1 + z.grid .* zeta.grid', - z.ones .* zeta.grid'), ...
......@@ -187,7 +187,7 @@ end % testFlipGrid();
function testScalarPlusMinusQuantity(testCase)
z = quantity.Domain('grid', linspace(0, 1, 7), 'name', 'z');
z = quantity.Domain('z', linspace(0, 1, 7));
f = quantity.Discrete( ( [2; 1] + zeros(2, 1) .* z.grid' )', ...
'domain', z);
......@@ -198,7 +198,7 @@ end % testScalarPlusMinusQuantity
function testNumericVectorPlusMinusQuantity(testCase)
z = quantity.Domain('grid', linspace(0, 1, 7), 'name', 'z');
z = quantity.Domain('z', linspace(0, 1, 7));
f = quantity.Discrete( [1+z.grid, 2+sin(z.grid)] , ...
'domain', z);
......@@ -210,8 +210,8 @@ testCase.verifyEqual(on(f+a), f.on()+1);
end % testNumericVectorPlusMinusQuantity
function testUnitaryPluasAndMinus(testCase)
z = quantity.Domain('grid', linspace(0, 1, 7), 'name', 'z');
zeta = quantity.Domain('grid', linspace(0, 1, 7), 'name', 'zeta');
z = quantity.Domain('z', linspace(0, 1, 7));
zeta = quantity.Domain('zeta', linspace(0, 1, 7));
q = quantity.Discrete(cat(4, ...
cat(3, 1 + z.grid .* zeta.grid', - z.grid .* zeta.ones'), ...
......@@ -285,12 +285,12 @@ end
function testExp(testCase)
% 1 spatial variable
z = quantity.Domain('grid', linspace(0, 1, 3), 'name', 'z');
z = quantity.Domain('z', linspace(0, 1, 3));
s1d = quantity.Discrete(1 + z.grid .* z.grid.', 'domain', z);
testCase.verifyEqual(s1d.exp.on(), exp(s1d.on()));
% diagonal matrix
zeta = quantity.Domain('grid', linspace(0, 1, 4), 'name', 'zeta');
zeta = quantity.Domain('zeta', linspace(0, 1, 4));
s2dDiag = quantity.Discrete(cat(4, ...
cat(3, 1 + z.grid .* zeta.grid', zeros(z.n, zeta.n)), ....
cat(3, zeros(z.n, zeta.n), z.grid.^2 .* zeta.ones')), 'domain', [z, zeta]);
......@@ -300,8 +300,8 @@ end
function testExpm(testCase)
z = quantity.Domain('grid', linspace(0, 1, 3), 'name', 'z');
zeta = quantity.Domain('grid', linspace(0, 1, 4), 'name', 'zeta');
z = quantity.Domain('z', linspace(0, 1, 3));
zeta = quantity.Domain('zeta', linspace(0, 1, 4));
mat2d = quantity.Discrete(...
{1 + z.grid .* zeta.grid', 3 * z.ones .* zeta.grid'; ...
......@@ -382,7 +382,7 @@ end
function testDiag2Vec(testCase)
% quantity.Symbolic
syms z
do = quantity.Domain('grid', linspace(0,1,3), 'name', 'z');
do = quantity.Domain('z', linspace(0,1,3));
myMatrixSymbolic = quantity.Symbolic([sin(0.5*z*pi)+1, 0; 0, 0.9-z/2], 'domain', do);
myVectorSymbolic = diag2vec(myMatrixSymbolic);
testCase.verifyEqual(myMatrixSymbolic(1,1).valueContinuous, myVectorSymbolic(1,1).valueContinuous);
......@@ -568,8 +568,8 @@ end
function testOn(testCase)
% init data
domainVecA = quantity.Domain('grid', linspace(0, 1, 27), 'name', 'z');
domainVecB = quantity.Domain('grid', linspace(0, 1, 41), 'name', 'zeta');
domainVecA = quantity.Domain('z', linspace(0, 1, 27));
domainVecB = quantity.Domain('zeta', linspace(0, 1, 41));
[value] = createTestData(domainVecA.grid, domainVecB.grid);
a = quantity.Discrete(value, 'size', [2, 3], ...
'domain', [domainVecA, domainVecB], 'name', 'A');
......@@ -581,8 +581,8 @@ testCase.verifyEqual(permute(value, [2, 1, 3, 4]), ...
testCase.verifyEqual(createTestData(linspace(0, 1, 100), linspace(0, 1, 21)), ...
a.on({linspace(0, 1, 100), linspace(0, 1, 21)}), 'AbsTol', 100*eps);
d24z = quantity.Domain('grid', linspace(0, 1, 24), 'name', 'z');
d21zeta = quantity.Domain('grid', linspace(0, 1, 21), 'name', 'zeta');
d24z = quantity.Domain('z', linspace(0, 1, 24));
d21zeta = quantity.Domain('zeta', linspace(0, 1, 21));
testCase.verifyEqual(createTestData(linspace(0, 1, 24), linspace(0, 1, 21)), ...
a.on( [d24z, d21zeta] ), 'AbsTol', 24*eps);
......@@ -601,9 +601,9 @@ testCase.verifyEqual(permute(createTestData(linspace(0, 1, 21), linspace(0, 1, 2
end
%% test on on 3-dim domain
z = quantity.Domain('grid', 0:3, 'name', 'z');
t = quantity.Domain('grid', 0:4, 'name', 't');
x = quantity.Domain('grid', 0:5, 'name', 'x');
z = quantity.Domain('z', 0:3);
t = quantity.Domain('t', 0:4);
x = quantity.Domain('x', 0:5);
Z = quantity.Discrete( z.grid, 'domain', z);
T = quantity.Discrete( t.grid, 'domain', t);
......@@ -638,8 +638,8 @@ function testMtimesZZeta2x2(testCase)
%%
z11_ = linspace(0, 1, 11);
z11 = quantity.Domain('grid', z11_, 'name', 'z');
zeta11 = quantity.Domain('grid', z11_, 'name', 'zeta');
z11 = quantity.Domain('z', z11_);
zeta11 = quantity.Domain('zeta', z11_);
a = quantity.Discrete(ones([z11.n, z11.n, 2, 2]), 'size', [2, 2], ...
'domain', [z11, zeta11], 'name', 'A');
......@@ -1089,9 +1089,9 @@ testCase.verifyEqual(AB2c.on(), tst)
testCase.verifyEqual(cAB2.on(), tst)
%% test plus on different domains
z = quantity.Domain('grid', 0:3, 'name', 'z');
t = quantity.Domain('grid', 0:4, 'name', 't');
x = quantity.Domain('grid', 0:5, 'name', 'x');
z = quantity.Domain('z', 0:3);
t = quantity.Domain('t', 0:4);
x = quantity.Domain('x', 0:5);
T = quantity.Discrete( t.grid, 'domain', t);
Z = quantity.Discrete( z.grid, 'domain', z);
......@@ -1119,8 +1119,8 @@ V = cat(3, v{:});
b = quantity.Discrete(v, 'grid', {z, t}, 'gridName', {'z', 't'});
c = quantity.Discrete(V, 'grid', {z, t}, 'gridName', {'z', 't'});
Z = quantity.Domain('grid', z, 'name', 'z');
T = quantity.Domain('grid', t, 'name', 't');
Z = quantity.Domain('z', z);
T = quantity.Domain('t', t);
d = quantity.Discrete(V, 'domain', [Z, T]);
......@@ -1176,8 +1176,8 @@ end
function testValue2Cell(testCase)
v = rand([100, 42, 2, 3]);
Z = quantity.Domain('grid', linspace(0,1,100), 'name', 'z');
T = quantity.Domain('grid', linspace(0,1,42), 'name', 't');
Z = quantity.Domain('z', linspace(0,1,100));
T = quantity.Domain('t', linspace(0,1,42));
V = quantity.Discrete( quantity.Discrete.value2cell(v, [100, 42], [2, 3]), ...
'domain', [Z, T]);
verifyTrue(testCase, misc.alln(v == V.on()));
......@@ -1245,8 +1245,8 @@ function testSubs(testCase)
myTestArray = ones(21, 41, 2, 3);
myTestArray(:,1,1,1) = linspace(0, 1, 21);
myTestArray(:,:,2,:) = 2;
z = quantity.Domain('grid', linspace(0, 1, 21), 'name', 'z');
zeta = quantity.Domain('grid', linspace(0, 1, 41), 'name', 'zeta');
z = quantity.Domain('z', linspace(0, 1, 21));
zeta = quantity.Domain('zeta', linspace(0, 1, 41));
quan = quantity.Discrete(myTestArray, 'domain', [z, zeta]);
......@@ -1270,15 +1270,15 @@ testCase.verifyEqual(quanZetaZeta.on(), quanZetaZetaReference);
testCase.verifyEqual(quanEta(1).gridName, {'eta', 'zeta'})
testCase.verifyEqual(quanPt.on(), shiftdim(quan.on({1, quan(1).grid{2}})));
testCase.verifyEqual( gridSize( quanZetaZeta.subs( quantity.Domain('grid', linspace(0,1,3), 'name', 'zeta')) ), 3);
testCase.verifyEqual( gridSize( quanZetaZeta.subs( ...
quantity.Domain('zeta', linspace(0,1,3))) ), 3);
% 4d-case
myTestArray4d = rand(11, 21, 31, 41, 1, 2);
x1 = quantity.Domain('grid', linspace(0, 1, 11), 'name', 'z');
x2 = quantity.Domain('grid', linspace(0, 1, 21), 'name', 'zeta');
x3 = quantity.Domain('grid', linspace(0, 1, 31), 'name', 'eta');
x4 = quantity.Domain('grid', linspace(0, 1, 41), 'name', 'beta');
x1 = quantity.Domain('z', linspace(0, 1, 11));
x2 = quantity.Domain('zeta', linspace(0, 1, 21));
x3 = quantity.Domain('eta', linspace(0, 1, 31));
x4 = quantity.Domain('beta', linspace(0, 1, 41));
quan4d = quantity.Discrete(myTestArray4d, 'domain', [x1, x2, x3, x4], 'name', 'fun5d');
quan4dAllEta = quan4d.subs({'z', 'zeta', 'eta', 'beta'}, {'eta', 'eta', 'eta', 'eta'});
......
......@@ -7,7 +7,7 @@ end
function testEquality(testCase)
d = quantity.Domain('grid', 0, 'name', 'd');
d = quantity.Domain('d', 0);
e = quantity.Domain.empty();
dd = d;
......@@ -23,7 +23,7 @@ end
function testDomainInit(testCase)
Z = linspace(0,pi, 3);
d = quantity.Domain('name', 'z', 'grid', Z);
d = quantity.Domain('z', Z);
D = [d d];
testCase.verifyEqual( ndims(D), 2);
......@@ -33,9 +33,9 @@ end
function testSort(testCase)
z = linspace(0, pi, 3);
a = quantity.Domain('grid', z, 'name', 'a');
b = quantity.Domain('grid', z, 'name', 'b');
c = quantity.Domain('grid', z, 'name', 'c');
a = quantity.Domain('a', z);
b = quantity.Domain('b', z);
c = quantity.Domain('c', z);
d = [a b c];
......@@ -54,7 +54,7 @@ end
function testDomainGridLength(testCase)
Z = linspace(0,pi, 3);
d = quantity.Domain('name', 'z', 'grid', Z);
d = quantity.Domain('z', Z);
D = [d d];
testCase.verifyEqual( cellfun(@(v) numel(v), {Z, Z}), D.gridLength)
......@@ -64,7 +64,7 @@ end
function testDomainNumGridElements(testCase)
Z = linspace(0,pi, 3);
d = quantity.Domain('name', 'z', 'grid', Z);
d = quantity.Domain('z', Z);
D = [d d];
testCase.verifyEqual( D.numGridElements, prod([length(Z), length(Z)]));
......@@ -75,7 +75,7 @@ function testEmpty(testCase)
d = quantity.Domain();
e = quantity.Domain.empty();
o = quantity.Domain('grid', 1, 'name', '');
o = quantity.Domain('', 1);
testCase.verifyTrue( isempty(d) )
testCase.verifyTrue( isempty(e) )
......@@ -99,12 +99,12 @@ s = linspace(0, 1);
z = linspace(0, 1, 71)';
t = linspace(0, 1, 51);
S = quantity.Domain('grid', s, 'name', 's');
Z = quantity.Domain('grid', z, 'name', 'z');
T = quantity.Domain('grid', t, 'name', 't');
Ps = quantity.Domain('grid', s, 'name', 'p');
St = quantity.Domain('grid', t, 'name', 's');
Pt = quantity.Domain('grid', t, 'name', 'p');
S = quantity.Domain('s', s);
Z = quantity.Domain('z', z);
T = quantity.Domain('t', t);
Ps = quantity.Domain('p', s);
St = quantity.Domain('s', t);
Pt = quantity.Domain('p', t);
a = [Z, T, S];
b = [Ps, St];
......@@ -137,9 +137,9 @@ z = linspace(0, 2*pi, 71)';
t = linspace(0, 3*pi, 51);
s = linspace(0, 1);
S = quantity.Domain('grid', s, 'name', 's');
Z = quantity.Domain('grid', z, 'name', 'z');
T = quantity.Domain('grid', t, 'name', 't');
S = quantity.Domain('s', s);
Z = quantity.Domain('z', z);
T = quantity.Domain('t', t);
a = [Z, T, S];
......
......@@ -7,7 +7,7 @@ end
function testVec2Diag(testCase)
% quantity.Symbolic
syms z
Z = quantity.Domain('grid', linspace(0, 1, 3), 'name', 'z');
Z = quantity.Domain('z', linspace(0, 1, 3));
myMatrixSymbolic = quantity.Symbolic([sin(0.5*z*pi)+1, 0; 0, 0.9-z/2], ...
'domain', Z);
myVectorSymbolic = quantity.Symbolic([sin(0.5*z*pi)+1; 0.9-z/2], ...
......@@ -380,8 +380,8 @@ end
function testCast2Quantity(testCase)
syms z t
d = [quantity.Domain('grid', linspace(0, 1, 5), 'name', 'z'), ...
quantity.Domain('grid', linspace(0, 2, 2), 'name', 't')];
d = [quantity.Domain('z', linspace(0, 1, 5)), ...
quantity.Domain('t', linspace(0, 2, 2))];
x = quantity.Symbolic(sin(z * t * pi), 'domain', d);
......@@ -392,8 +392,8 @@ end
function testMrdivide(testCase)
syms z t
d = [quantity.Domain('grid', linspace(0, 1, 5), 'name', 'z'), ...
quantity.Domain('grid', linspace(0, 2, 2), 'name', 't')];
d = [quantity.Domain('z', linspace(0, 1, 5)), ...
quantity.Domain('t', linspace(0, 2, 2))];
x = quantity.Symbolic(sin(z * t * pi), 'domain', d);
o = x / x;
......@@ -408,8 +408,8 @@ end
function testMTimesConstants(testCase)
syms z t
d = [quantity.Domain('grid', linspace(0, 1, 5), 'name', 'z'), ...
quantity.Domain('grid', linspace(0, 2, 2), 'name', 't')];
d = [quantity.Domain('z', linspace(0, 1, 5)), ...
quantity.Domain('t', linspace(0, 2, 2))];
x = quantity.Symbolic(sin(z * t * pi), 'domain', d);
% test multiplicaiton iwth a constant scalar
......@@ -481,7 +481,7 @@ f1 = sinh(z * pi);
f2 = cosh(z * pi);
f = quantity.Symbolic([f1 ; f2 ], 'name', 'f', 'domain', ...
quantity.Domain('grid', linspace(0,1,11), 'name', 'z'));
quantity.Domain('z', linspace(0,1,11)));
d2f = f.diff(2);
d1f = f.diff(1);
......@@ -529,8 +529,8 @@ end
function testPlus(testCase)
syms z zeta
Z = quantity.Domain('grid', linspace(0, 1, 3), 'name', 'z');
Zeta = quantity.Domain('grid', linspace(0, 1, 4), 'name', 'zeta');
Z = quantity.Domain('z', linspace(0, 1, 3));
Zeta = quantity.Domain('zeta', linspace(0, 1, 4));
%% 1 + 2 variables
fSymVec3 = quantity.Symbolic([sinh(pi * z)], 'name', 'sinh', 'domain', Z);
......@@ -601,7 +601,7 @@ f1 = sinh(z * pi);
f2 = cosh(z * pi);
f = quantity.Symbolic([f1 ; f2 ], 'name', 'sinhcosh', 'domain', ...
quantity.Domain('grid', linspace(0,1,3), 'name', 'z'));
quantity.Domain('z', linspace(0,1,3)));
F = f * f.';
val = F.on();
......@@ -627,7 +627,7 @@ end
function testVariable(testCase)
syms z
q = quantity.Symbolic(z, 'domain', quantity.Domain('grid', 1, 'name', 'z'));
q = quantity.Symbolic(z, 'domain', quantity.Domain('z', 1));
verifyEqual(testCase, q.variable, z);
......@@ -639,7 +639,7 @@ syms z;
f1 = (sin(z .* pi) );
f2 = z;
f3 = (cos(z .* pi) );
d = quantity.Domain('grid', linspace(0, 1, 3).', 'name', 'z');
d = quantity.Domain('z', linspace(0, 1, 3).');
f = quantity.Symbolic([f1, f2; 0, f3], ...
'domain', d);
......@@ -697,7 +697,7 @@ syms Z;
f1 = (sin(Z .* pi) );
f2 = Z;
f3 = (cos(Z .* pi) );
z = quantity.Domain('grid', linspace(0, 1, 4), 'name', 'Z');
z = quantity.Domain('Z', linspace(0, 1, 4));
R1 = quantity.Symbolic([f1, f2; 0, f3], ...