Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plot a function in function of a function

Tags:

plot

matlab

I don't know if I'll be able to fully explain what I need. But I'll try.

I've got curved frame and on this frame, I have to draw a graph of forces/moments/stress. The frame has 9 intervals. For now I stretched the frame and draw the diagrams on the stretched -zero- line.

But what should I do if I want to draw it on the real frame?

A few examples:

  • I try to do something like this: enter image description here

  • This is the real frame: enter image description here

With corresponding forces affecting the frame.

If I stretch the final forces/moment/stress diagrams, it looks like this: enter image description here

And I need it like this: enter image description here

I hope you know what I mean :-) I'm not a Photoshop guy :-)

Edit: In my opinion, if you draw any plot, you draw it in function of the zero line, but what if you change the zero line to different function.

It's like plotting 2 lines ans fill the area between them, but only the bottom line is function of a normal zero line, and the second line is a function the first line.

  • I think we could go from a point where: enter image description here So that the second function will draw correspondigly to the first function function. :-)

Any thoughts welcome :-)

like image 785
Jan Verner Avatar asked Apr 17 '13 06:04

Jan Verner


People also ask

How do you graph a function that is related?

Graphing A Function Rule To graph a function, you have to select x-values and plug them into the equation. Once you plug those values into the equation, you will get a y-value. Your x-values and your y-values make up your coordinates for a single point.

What does it mean to plot a graph as a function of something?

The graph of a function f is the set of all points in the plane of the form (x, f(x)). We could also define the graph of f to be the graph of the equation y = f(x). So, the graph of a function if a special case of the graph of an equation. Example 1. Let f(x) = x2 - 3.


1 Answers

General idea for such plot is following:

Let curve from your top plot described as y = f(x). In matlab your receive set of points:

x = x0:dx:xf;
y = f(x);

f should be external function or formula.

Than you have zero-line function y2 = g(x2). The first problem you need to convert this function into parametric form like y2=gy(t), x2=gx(t). If you will have such parametric representation you can recieve two point sets placed on equal distances on zero-line curve:

t=x0:dx:xf;  % same as x above
x2=gx(t);
y2=gy(t);

The second problem that you need to receive normal vector for each point of zero-curve.

If you have direct formula y2 = g(x2), you can use equation:

nx - x2(k) + g'(x2(k))*(ny-y2(k)) = 0

nx^2 + ny^2 = 1

g' denotes derivative of g; x2(k), y2(k) - points of zero-line curve; nx, ny are components of normal vector for each point.

Let you receive two sets nx and ny for each t defined above.

Finally you will have set of required points for force curve:

x=x2+nx;
y=y2+ny;
like image 69
Danil Asotsky Avatar answered Oct 27 '22 09:10

Danil Asotsky