MATLAB integration of 2x2 system
I got the following matrice:
which I want to integrate with MATLAB. The obvious solution would be:
which is exactly what I am trying to achieve. I am using symbolic calculation for this. (example only for one variable)
syms aiso w w1 w2
With the matrice definition
A = [1/2/aiso 1/2; -1/2/aiso 1/2];
Now I integrate symbolically via
A = int(A,w);
Which gives me the result
A = [ w*1/(2*aiso), w*1/2; -w*1/(2*aiso), w*1/2]
That is obviously right but since I only used one symbolic variable that's not quite the case I need. I need the solution from above, which is stated in vector notation on the second picture and which should look like this in MATLAB:
A = [ (w1)*1/(2*aiso) + (w2)*1/2; (w1)*1/(2*aiso) - (w2)1/2]
Is there a way to do this in MATLAB?
Thanks a lot in advance and have a nice day!
matlab matrix integration symbolic-math
add a comment |
I got the following matrice:
which I want to integrate with MATLAB. The obvious solution would be:
which is exactly what I am trying to achieve. I am using symbolic calculation for this. (example only for one variable)
syms aiso w w1 w2
With the matrice definition
A = [1/2/aiso 1/2; -1/2/aiso 1/2];
Now I integrate symbolically via
A = int(A,w);
Which gives me the result
A = [ w*1/(2*aiso), w*1/2; -w*1/(2*aiso), w*1/2]
That is obviously right but since I only used one symbolic variable that's not quite the case I need. I need the solution from above, which is stated in vector notation on the second picture and which should look like this in MATLAB:
A = [ (w1)*1/(2*aiso) + (w2)*1/2; (w1)*1/(2*aiso) - (w2)1/2]
Is there a way to do this in MATLAB?
Thanks a lot in advance and have a nice day!
matlab matrix integration symbolic-math
You may want to createw
as a symbolic vectorw = sym('w', [2,1])
or integrate w.r.t[w1;w2]
.
– Chris H.
Nov 21 '18 at 22:10
Thanks for the reply! But this isn't working for me. When I try int(dA,[w1 w2]), MATLAB interprets it as an integration interval with lower and upper border. Any other ideas maybe?
– William D.
Nov 22 '18 at 11:23
add a comment |
I got the following matrice:
which I want to integrate with MATLAB. The obvious solution would be:
which is exactly what I am trying to achieve. I am using symbolic calculation for this. (example only for one variable)
syms aiso w w1 w2
With the matrice definition
A = [1/2/aiso 1/2; -1/2/aiso 1/2];
Now I integrate symbolically via
A = int(A,w);
Which gives me the result
A = [ w*1/(2*aiso), w*1/2; -w*1/(2*aiso), w*1/2]
That is obviously right but since I only used one symbolic variable that's not quite the case I need. I need the solution from above, which is stated in vector notation on the second picture and which should look like this in MATLAB:
A = [ (w1)*1/(2*aiso) + (w2)*1/2; (w1)*1/(2*aiso) - (w2)1/2]
Is there a way to do this in MATLAB?
Thanks a lot in advance and have a nice day!
matlab matrix integration symbolic-math
I got the following matrice:
which I want to integrate with MATLAB. The obvious solution would be:
which is exactly what I am trying to achieve. I am using symbolic calculation for this. (example only for one variable)
syms aiso w w1 w2
With the matrice definition
A = [1/2/aiso 1/2; -1/2/aiso 1/2];
Now I integrate symbolically via
A = int(A,w);
Which gives me the result
A = [ w*1/(2*aiso), w*1/2; -w*1/(2*aiso), w*1/2]
That is obviously right but since I only used one symbolic variable that's not quite the case I need. I need the solution from above, which is stated in vector notation on the second picture and which should look like this in MATLAB:
A = [ (w1)*1/(2*aiso) + (w2)*1/2; (w1)*1/(2*aiso) - (w2)1/2]
Is there a way to do this in MATLAB?
Thanks a lot in advance and have a nice day!
matlab matrix integration symbolic-math
matlab matrix integration symbolic-math
edited Nov 22 '18 at 8:18


Banghua Zhao
1,2851720
1,2851720
asked Nov 21 '18 at 20:27
William D.William D.
82
82
You may want to createw
as a symbolic vectorw = sym('w', [2,1])
or integrate w.r.t[w1;w2]
.
– Chris H.
Nov 21 '18 at 22:10
Thanks for the reply! But this isn't working for me. When I try int(dA,[w1 w2]), MATLAB interprets it as an integration interval with lower and upper border. Any other ideas maybe?
– William D.
Nov 22 '18 at 11:23
add a comment |
You may want to createw
as a symbolic vectorw = sym('w', [2,1])
or integrate w.r.t[w1;w2]
.
– Chris H.
Nov 21 '18 at 22:10
Thanks for the reply! But this isn't working for me. When I try int(dA,[w1 w2]), MATLAB interprets it as an integration interval with lower and upper border. Any other ideas maybe?
– William D.
Nov 22 '18 at 11:23
You may want to create
w
as a symbolic vector w = sym('w', [2,1])
or integrate w.r.t [w1;w2]
.– Chris H.
Nov 21 '18 at 22:10
You may want to create
w
as a symbolic vector w = sym('w', [2,1])
or integrate w.r.t [w1;w2]
.– Chris H.
Nov 21 '18 at 22:10
Thanks for the reply! But this isn't working for me. When I try int(dA,[w1 w2]), MATLAB interprets it as an integration interval with lower and upper border. Any other ideas maybe?
– William D.
Nov 22 '18 at 11:23
Thanks for the reply! But this isn't working for me. When I try int(dA,[w1 w2]), MATLAB interprets it as an integration interval with lower and upper border. Any other ideas maybe?
– William D.
Nov 22 '18 at 11:23
add a comment |
1 Answer
1
active
oldest
votes
You can integrate each component of the matrix dA
to get A
:
syms aiso w w1 w2
dA = [1/2/aiso 1/2; -1/2/aiso 1/2];
A = [int(dA(1,1),w1)+int(dA(1,2),w2) int(dA(2,1),w1)+int(dA(2,2),w2)]
disp(A)
Output:
[ w2/2 + w1/(2*aiso), w2/2 - w1/(2*aiso)]
It is not elegant but it works.
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420007%2fmatlab-integration-of-2x2-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can integrate each component of the matrix dA
to get A
:
syms aiso w w1 w2
dA = [1/2/aiso 1/2; -1/2/aiso 1/2];
A = [int(dA(1,1),w1)+int(dA(1,2),w2) int(dA(2,1),w1)+int(dA(2,2),w2)]
disp(A)
Output:
[ w2/2 + w1/(2*aiso), w2/2 - w1/(2*aiso)]
It is not elegant but it works.
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
add a comment |
You can integrate each component of the matrix dA
to get A
:
syms aiso w w1 w2
dA = [1/2/aiso 1/2; -1/2/aiso 1/2];
A = [int(dA(1,1),w1)+int(dA(1,2),w2) int(dA(2,1),w1)+int(dA(2,2),w2)]
disp(A)
Output:
[ w2/2 + w1/(2*aiso), w2/2 - w1/(2*aiso)]
It is not elegant but it works.
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
add a comment |
You can integrate each component of the matrix dA
to get A
:
syms aiso w w1 w2
dA = [1/2/aiso 1/2; -1/2/aiso 1/2];
A = [int(dA(1,1),w1)+int(dA(1,2),w2) int(dA(2,1),w1)+int(dA(2,2),w2)]
disp(A)
Output:
[ w2/2 + w1/(2*aiso), w2/2 - w1/(2*aiso)]
It is not elegant but it works.
You can integrate each component of the matrix dA
to get A
:
syms aiso w w1 w2
dA = [1/2/aiso 1/2; -1/2/aiso 1/2];
A = [int(dA(1,1),w1)+int(dA(1,2),w2) int(dA(2,1),w1)+int(dA(2,2),w2)]
disp(A)
Output:
[ w2/2 + w1/(2*aiso), w2/2 - w1/(2*aiso)]
It is not elegant but it works.
answered Nov 21 '18 at 22:37


Banghua ZhaoBanghua Zhao
1,2851720
1,2851720
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
add a comment |
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
This works grat for this special case. But I plan to advance to more sophisticated entries like
– William D.
Nov 22 '18 at 11:09
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
Thank you - I just tried it!This works great for this special case, where integration equal a simple multiplication with the vector w. But I finally plan to andvance towards matrices with entries containing dependencies like dA(1,1) = w2*w1/aiso and dA(1,2) = w1^2*w2/2; for example. So maybe there's another more general way. (?)
– William D.
Nov 22 '18 at 11:21
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
@WilliamD. Currently, I can only come out of this way. I will update my answer once I know more general way.
– Banghua Zhao
Nov 22 '18 at 12:47
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
Thanks for the effort!
– William D.
Nov 22 '18 at 15:24
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420007%2fmatlab-integration-of-2x2-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You may want to create
w
as a symbolic vectorw = sym('w', [2,1])
or integrate w.r.t[w1;w2]
.– Chris H.
Nov 21 '18 at 22:10
Thanks for the reply! But this isn't working for me. When I try int(dA,[w1 w2]), MATLAB interprets it as an integration interval with lower and upper border. Any other ideas maybe?
– William D.
Nov 22 '18 at 11:23