[simscape] how can I write a difference between output and input?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
2 Commenti
Babak
il 28 Nov 2012
Please post all your code. The error says that you have not defined B before using it. So MATLAB doesn't recognize it!
Risposte (1)
Babak
il 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
0 Commenti
Vedere anche
Categorie
Scopri di più su Foundation and Custom Domains in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!