How to solve a system of Algebraic Equations in Simulink

I am looking for a solution to solve a system of Algebraic Equations. I am currently building a vehicle suspension model, I am trying to find the x,y,z location of a unknown point with 3 known point & length.
The problem I am trying to solve is: The location of point A, B, C are known, and also the length of AD, BD and CD are known, so find the location of D. And the set of equations to find D is:
  • 1st equation: AD^2=(D.x-A.x)^2+(D.y-A.y)^2+(D.z-A.z)^2
  • 2nd equation: BD^2=(D.x-B.x)^2+(D.y-B.y)^2+(D.z-B.z)^2
  • 3rd equation: CD^2=(D.x-C.x)^2+(D.y-C.y)^2+(D.z-C.z)^2
Given that the x, y, z of point A is: A.x=103mm A.y=350mm A.z=142mm and the length of AD is 172.064mm . And for B: B.x=-127mm B.y=350mm B.z=128mm, Length of BD=183.527mm . And for C: C.x=-15mm C.y=500mm C.z=540mm Length of CD=401.103mm
I have managed to find the location of D using the MATLAB solve function as following:
S = solve((x-103)^2 +(y-350)^2+(z-142)^2 == 172.064^2, (x+127)^2 +(y-350)^2+(z-128)^2 == 183.527^2,(x+15)^2 +(y-500)^2+(z-548)^2 == 401.103^2)
dx=subs(S.x) dy=subs(S.y) dz=subs(S.z)
However, I would like to integrate these equation into my Simulink suspension model to do geometry analysis, but the Simulink MATLAB function block does not allow me to use the "solve" function, is there other way I can model this in Simulink?

Answers (0)

Categories

Find more on Simulation in Help Center and File Exchange

Tags

Asked:

on 18 May 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!