Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'WSMSetValues' topicStudent Support Forum > General > Archives > "WSMSetValues"

Next Comment >Help | Reply To Topic
Author Comment/Response
Tatjana
05/10/13 02:14am

I am trying to assign values to some model parameters using WSMSetValues function, however, it seems to be working only with values greater than 10^-4. Of course, I could manually type in these values in Model Center and it would work fine, but I wish to do this programmatically. Here is an example and I have attached the model(saved as total):

these are my parameters:
param = {"TT1.C2" -> 1. 10^-7, "TT1.C1" -> 1. 10^-7,
"TT1.R6" -> 10000., "TT1.R5" -> 10000., "TT1.R4" -> 10000.,
"TT1.R3" -> 5400., "TT1.R2" -> 10000., "TT1.R1" -> 10000.};

here I use WSMSetValues to assign new values:
WSMSetValues["filter", param];

this checks the values:
WSMModelData["filter", "ParameterValues"]

and this is the output where you can see C1 and C2 are assigned 0 values:
{TT1\[UpPointer]resistor1\[UpPointer]useHeatPort -> False,
TT1\[UpPointer]resistor1\[UpPointer]T ->
TT1\[UpPointer]resistor1\[UpPointer]T\[UnderBracket]ref,
TT1\[UpPointer]resistor1\[UpPointer]R -> TT1\[UpPointer]R1,
TT1\[UpPointer]resistor1\[UpPointer]T\[UnderBracket]ref -> 300.15,
TT1\[UpPointer]resistor1\[UpPointer]alpha -> 0,
TT1\[UpPointer]resistor2\[UpPointer]useHeatPort -> False,
TT1\[UpPointer]resistor2\[UpPointer]T ->
TT1\[UpPointer]resistor2\[UpPointer]T\[UnderBracket]ref,
TT1\[UpPointer]resistor2\[UpPointer]R -> TT1\[UpPointer]R2,
TT1\[UpPointer]resistor2\[UpPointer]T\[UnderBracket]ref -> 300.15,
TT1\[UpPointer]resistor2\[UpPointer]alpha -> 0,
TT1\[UpPointer]resistor3\[UpPointer]useHeatPort -> False,
TT1\[UpPointer]resistor3\[UpPointer]T ->
TT1\[UpPointer]resistor3\[UpPointer]T\[UnderBracket]ref,
TT1\[UpPointer]resistor3\[UpPointer]R -> TT1\[UpPointer]R3,
TT1\[UpPointer]resistor3\[UpPointer]T\[UnderBracket]ref -> 300.15,
TT1\[UpPointer]resistor3\[UpPointer]alpha -> 0,
TT1\[UpPointer]resistor4\[UpPointer]useHeatPort -> False,
TT1\[UpPointer]resistor4\[UpPointer]T ->
TT1\[UpPointer]resistor4\[UpPointer]T\[UnderBracket]ref,
TT1\[UpPointer]resistor4\[UpPointer]R -> TT1\[UpPointer]R4,
TT1\[UpPointer]resistor4\[UpPointer]T\[UnderBracket]ref -> 300.15,
TT1\[UpPointer]resistor4\[UpPointer]alpha -> 0,
TT1\[UpPointer]resistor5\[UpPointer]useHeatPort -> False,
TT1\[UpPointer]resistor5\[UpPointer]T ->
TT1\[UpPointer]resistor5\[UpPointer]T\[UnderBracket]ref,
TT1\[UpPointer]resistor5\[UpPointer]R -> TT1\[UpPointer]R5,
TT1\[UpPointer]resistor5\[UpPointer]T\[UnderBracket]ref -> 300.15,
TT1\[UpPointer]resistor5\[UpPointer]alpha -> 0,
TT1\[UpPointer]resistor6\[UpPointer]useHeatPort -> False,
TT1\[UpPointer]resistor6\[UpPointer]T ->
TT1\[UpPointer]resistor6\[UpPointer]T\[UnderBracket]ref,
TT1\[UpPointer]resistor6\[UpPointer]R -> TT1\[UpPointer]R6,
TT1\[UpPointer]resistor6\[UpPointer]T\[UnderBracket]ref -> 300.15,
TT1\[UpPointer]resistor6\[UpPointer]alpha -> 0,
TT1\[UpPointer]capacitor1\[UpPointer]C -> TT1\[UpPointer]C1,
TT1\[UpPointer]capacitor2\[UpPointer]C -> TT1\[UpPointer]C2,
TT1\[UpPointer]R1 -> 10000, TT1\[UpPointer]R2 -> 10000,
TT1\[UpPointer]R3 -> 5400, TT1\[UpPointer]R4 -> 10000,
TT1\[UpPointer]R5 -> 10000, TT1\[UpPointer]R6 -> 10000,
TT1\[UpPointer]C1 -> 0, TT1\[UpPointer]C2 -> 0}

Thank you

Attachment: filterTotal.mo, URL: ,

Subject (listing for 'WSMSetValues')
Author Date Posted
WSMSetValues Tatjana 05/10/13 02:14am
Re: WSMSetValues Malte Lenz 05/16/13 02:09am
Next Comment >Help | Reply To Topic