NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Cavalcanti
Posts: 1
0 Kudos

Solving Riccati equation

I have experience with Systembuild only.

 

I saw that Xmath has a module with a function to solve the Riccati equation. How can I use this function in Systembuild?

Member
rfwilson
Posts: 12
0 Kudos

Re: Solving Riccati equation

The Riccati equation can be solved in SystemBuild using a UserCodeBlock where internally the function XmathExecute is called to solve the Riccatti equation using Xmath.

This Riccati equation solver could be placed in a slower periodic SuperBlock so that it is not recalculated every time step.

Another UserCodeBlock (file scoped with the Ricatti solver UserCodeBlock) could return the new A and B matricies.

 

But, the real problem is how to inject the new A and B matrix into your model.

The SystemBuild StateSpace block A,B,C and D matricies can be only changed during simulation initialization.

You would have to create your own StateSpace SuperBlock using the matrix multiple blocks, UserCodeBlock(returns new A,B), intergator block and summer blocks to calculate.

 

Xdot = Ax + Bu;

Y      = Cx + Du;

 

It would be much easier if there were a StateSpace block that had the A and B matricies as inputs.

 

Note: using SystemBuild the UserCodeBlocks and StateSpace SuperBlock dimensions are fixed and would have to be determined before hand.

 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page