Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13700 > unrolled thread
| Started by | Johan Rhodin <johanr@wolfram.com> |
|---|---|
| First post | 2013-03-05 09:15 +0000 |
| Last post | 2013-03-07 08:58 +0000 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Strange behavior of System Modeler Johan Rhodin <johanr@wolfram.com> - 2013-03-05 09:15 +0000
Re: Strange behavior of System Modeler awnl <awnl@gmx-topmail.de> - 2013-03-06 03:12 +0000
Re: Strange behavior of System Modeler Johan Rhodin <johanr@wolfram.com> - 2013-03-07 08:58 +0000
| From | Johan Rhodin <johanr@wolfram.com> |
|---|---|
| Date | 2013-03-05 09:15 +0000 |
| Subject | Re: Strange behavior of System Modeler |
| Message-ID | <kh4d3c$6vi$1@smc.vnet.net> |
Go to Preferences -> Global -> Translation and add your example to the list of Dynamic State Selection classes. Restart. The model will now simulate as you expect it to. /Johan ----- Original Message ----- From: "awnl" <awnl@gmx-topmail.de> Sent: Sunday, March 3, 2013 10:00:57 PM Subject: Re: Strange behavior of System Modeler Hi, > > I have just started studying WSM and the Modelica language by implementing the simple pendulum model (class) es. described on p.33 of Peter Fritzson's book Introduction to "Modeling and Simulation of Technical and Physical Systems with Modelica". The code (pendulum equation written as a DAE) is: > > model DAEExample "DAEExample" > constant Real PI=3.14159265358979; > parameter Real m=1,g=9.81,l=0.5; > output Real F; > output Real x(start=0.5),y(start=0); > output Real vx,vy; > equation > m*der(vx)=-x/l*F; > m*der(vy)=-y/l*F - m*g; > der(x)=vx; > der(y)=vy; > x^2 + y^2=l^2; > end DAEExample; > > I run the example in WSM and I get totally meaningless results. > The solver is the default one (DASSL) which, I think, is the right one for handling DAEs. > > Any ideas? Just a followup to my recent post: you can use manual state selection (dynamic state selection is one of the tricks that Dymola uses to get this right) to get correct solutions with WSM like this: model DAEExample constant Real PI=3.14159265358979; parameter Real m=1,g=9.81,l=0.5; Real F; Real x(start=0.5,stateSelect=StateSelect.always); Real y(start=0); Real vx(start=0); Real vy(start=0); equation m*der(vx) = -x/l*F; m*der(vy) = -y/l*F - m*g; der(x) = vx; der(y) = vy; x^2 + y^2 = l^2; end DAEExample; hth, albert
[toc] | [next] | [standalone]
| From | awnl <awnl@gmx-topmail.de> |
|---|---|
| Date | 2013-03-06 03:12 +0000 |
| Message-ID | <kh6c7f$b16$1@smc.vnet.net> |
| In reply to | #13700 |
Hi Johan, > Go to Preferences -> Global -> Translation and add your example to > the list of Dynamic State Selection classes. Restart. The model will > now simulate as you expect it to. It's very good to know that. Is there any way I could have known that this option exists? Actually I didn't even search for it, as I didn't expect it to exist. I have in another case had problems to find information about some details of what version and features of Modelica were actually implemented in which version of System Modeler. Is there a detailed specification/listing of such details anywhere on the web? regards, albert
[toc] | [prev] | [next] | [standalone]
| From | Johan Rhodin <johanr@wolfram.com> |
|---|---|
| Date | 2013-03-07 08:58 +0000 |
| Message-ID | <kh9ks2$1r7$1@smc.vnet.net> |
| In reply to | #13700 |
Hi, Yes, this option is documented in the the User Guide, see section 4.2.5 "Translation" (http://reference.wolfram.com/system-modeler/user-guide/system-modeler-user-guide.pdf) See the release notes for what changes from version to version: http://www.wolfram.com/system-modeler/quick-revision-history.html /Johan On 3/5/13 9:13 PM, awnl wrote: > Hi Johan, > >> Go to Preferences -> Global -> Translation and add your example to >> the list of Dynamic State Selection classes. Restart. The model will >> now simulate as you expect it to. > It's very good to know that. Is there any way I could have known that > this option exists? Actually I didn't even search for it, as I didn't > expect it to exist. I have in another case had problems to find > information about some details of what version and features of Modelica > were actually implemented in which version of System Modeler. Is there a > detailed specification/listing of such details anywhere on the web? > > regards, > > albert >
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web