[simscape] how can I write a difference between output and input?
Show older comments
Hello all,
I've modelize a thermal component. my system put a heat flow Q at the node A. my component has to consume a part of this heat flow (Qcons) and i need to put out the rest of the heat flow at a node B.
the equation i want to put is B.Q == A.Q - Qcons
but i have an error :"Unexpected function or variable 'B'.
i have this in my variable: Q = { 0, 'J/s' };
and this in the fonction setup: through ( Q, A.Q, B.Q );
What can I do?
Thanks
Answers (1)
Babak
on 30 Nov 2012
M = foundation.thermal.thermal;
M is defined as an element of a structure. The structure names are fixed. I don't know if your M is also by itself a structure or not. But if it is then it might have its subelements like M.a and M.b
In your code we don't see how the foundation structure is fully defined. If it has an element like foundation.thermal.thermal.Q then M.Q would be meaningful, but if foundation.thermal.thermal.Q is not defined then M.Q is not defined either.
Now, you cannot change Q before calling M.Q. If structure M has an element named Q, it is a fixed name and you cannot change Q to
Q = { 0, 'J/s' };
or this Q doesn't have anything to do with the Q in M.Q
Categories
Find more on Foundation and Custom Domains in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!