MATLAB integration of 2x2 system












0















I got the following matrice:



enter image description here



which I want to integrate with MATLAB. The obvious solution would be:



enter image description here



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!










share|improve this question

























  • 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
















0















I got the following matrice:



enter image description here



which I want to integrate with MATLAB. The obvious solution would be:



enter image description here



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!










share|improve this question

























  • 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














0












0








0








I got the following matrice:



enter image description here



which I want to integrate with MATLAB. The obvious solution would be:



enter image description here



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!










share|improve this question
















I got the following matrice:



enter image description here



which I want to integrate with MATLAB. The obvious solution would be:



enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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



















  • 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

















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












1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer
























  • 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











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
});


}
});














draft saved

draft discarded


















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









0














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.






share|improve this answer
























  • 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
















0














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.






share|improve this answer
























  • 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














0












0








0







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

How to fix TextFormField cause rebuild widget in Flutter