Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LRT_infinite_dimensional_systems
conI
Commits
5ee5a6e5
Commit
5ee5a6e5
authored
Apr 04, 2020
by
Ferdinand Fischer
Browse files
Fixed quantity.Symbolic/int
parent
acbe8f5d
Changes
3
Show whitespace changes
Inline
Side-by-side
+quantity/Symbolic.m
View file @
5ee5a6e5
...
...
@@ -745,35 +745,6 @@ classdef Symbolic < quantity.Function
'domain'
,
obj
(
1
)
.
domain
);
end
% expm()
function
C
=
int
(
obj
,
z
,
a
,
b
)
% from help sym/int:
% "int(S,v,a,b) is the definite integral of S with respect to v
% from a to b."
if
nargin
==
2
grdIdx
=
obj
(
1
)
.
domain
.
gridIndex
(
z
);
a
=
obj
(
1
)
.
grid
{
grdIdx
}(
1
);
b
=
obj
(
1
)
.
grid
{
grdIdx
}(
end
);
end
if
nargin
==
3
b
=
a
;
a
=
z
;
z
=
num2cell
(
obj
(
1
)
.
variable
);
end
if
nargin
==
1
assert
(
obj
.
nargin
==
1
,
'Not Implemented'
)
z
=
obj
(
1
)
.
grid
{
1
};
a
=
z
(
1
);
b
=
obj
.
variable
;
z
=
num2cell
(
obj
(
1
)
.
variable
);
end
C
=
obj
.
cumInt
(
z
,
a
,
b
);
end
% int()
function
C
=
cumInt
(
obj
,
domain
,
lowerBound
,
upperBound
)
% CUMINT cumulative integration
% result = cumInt(obj, domain, lowerBound, upperBound)
...
...
+signals/SignalModel.m
View file @
5ee5a6e5
+unittests/+quantity/testSymbolic.m
View file @
5ee5a6e5
...
...
@@ -132,6 +132,18 @@ fFlipped2 = f.flipGrid({'z', 'zeta'});
tc
.
verifyEqual
(
fReference2
.
on
,
fFlipped2
.
on
,
'AbsTol'
,
10
*
eps
);
end
% testFlipGrid();
function
testInt
(
testCase
)
t
=
sym
(
't'
);
T
=
quantity
.
Domain
.
defaultDomain
(
10
,
't'
);
f
=
quantity
.
Symbolic
(
sin
(
t
),
'domain'
,
T
);
F
=
int
(
f
);
testCase
.
verifyEqual
(
F
,
double
(
int
(
sin
(
t
),
t
,
0
,
1
)
),
'AbsTol'
,
6e-17
);
end
function
testCumInt
(
testCase
)
tGrid
=
linspace
(
pi
,
1.1
*
pi
,
51
)
'
;
sGrid
=
tGrid
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment