1 view (last 30 days)

Show older comments

Hi,

I am currently working on a project where I am trying to code and plot a function in the form of (F1 * S1) + (F2 * S2) + (F3 * S1^2) + (F22 * S2^2) + (2 *F12 * S1 * S2) =>1 where S1 and S2 are known and F1,F2,F3,F22, and F12 are equations that vary in a loop.

If you are familiar with the Tsai Wu failure criterion, that is what I am trying to code to produce the tension and compression values.

I feel like I have gone down a PHD rabbit hole and was trying to see if maybe I was going about it wrong.

My current strategy is to use syms for the variables I am trying to solve for in the "F" equations, then solve the equation, use all the solved equations to solve for the unkowns, then substitute back into the original equation.

The code is extremly sloppy and I am prepared to start over. It currently does not run, although I have gotten it to graph under certain circumstances. I would rather not post my code, just looking for ideas on how to solve the problem.

John D'Errico
on 19 Jul 2021

I don't know what it means when you call something an equation that varies in a loop. This is certainly not a PHD level rabbit hole. It does sound as if you are beyond your comfortable depth in the deep end of the pool though.

You have two unknowns. You want to find the locus of points where that inequality is satisfied. If the coefficients were constant, then what you have is a simple conic section. An issue is, depending on those coefficients a conic section can describe anything from a circle, to an elliptical region to a hyperbola or parabola. (Again, not doctoral level, more like high school algebra at that point.)

As a function of what the coefficients are, there is a simple set of rules to determine which conic sectrion applies. So while I don't know what you are trying to say about an equation that varies in a loop, at any iteration in that loop, those parameters are not a function of S1 and S2. And that means, at that point, you have a simple conic section. So plot it, and the set of points that fall on the desired side of the section.

The thing is, what you need to do is break this down into a set of SMALL problems. And that is how you should ALWAYS solve any problem that is too complicated for you to solve. Thus, given the set of CONSTANT coefficients, you can write a simple code that will plot the locus of points that satisfy your inequality. Then worry about how those coefficients will vary in a "loop".

I really cannot say much more than this. This seems to be, on the face of things, a moderately simple problem. Just break it down into smaller problems that you can see how to solve.

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

Start Hunting!